Nhogs / popoto

Visual query builder for Neo4j graph database
http://popotojs.com
GNU General Public License v3.0
511 stars 70 forks source link

Unable to load data from json #80

Closed RGEv1L closed 2 years ago

RGEv1L commented 2 years ago

Hi, I am trying to load popoto graph from json file. But, i am unable to feed popoto data even directly from script or console. Please guide me, I am new with popoto.

sample data: {"nodes":[{"data":{"id":"8","label":"Person","name":"Emil Eifrem","born":1978}},{"data":{"id":"0","label":"Movie","tagline":"Welcome to the Real World","title":"The Matrix","released":1999}},{"data":{"id":"7","label":"Person","name":"Joel Silver","born":1952}},{"data":{"id":"6","label":"Person","name":"Lana Wachowski","born":1965}},{"data":{"id":"5","label":"Person","name":"Lilly Wachowski","born":1967}},{"data":{"id":"4","label":"Person","name":"Hugo Weaving","born":1960}},{"data":{"id":"3","label":"Person","name":"Laurence Fishburne","born":1961}},{"data":{"id":"2","label":"Person","name":"Carrie-Anne Moss","born":1967}},{"data":{"id":"1","label":"Person","name":"Keanu Reeves","born":1964}},{"data":{"id":"154","label":"Movie","title":"Something's Gotta Give","released":2003}},{"data":{"id":"87","label":"Movie","tagline":"Pain heals, Chicks dig scars... Glory lasts forever","title":"The Replacements","released":2000}}],"edges":[{"data":{"source":"8","target":"0","relationship":"ACTED_IN"}},{"data":{"source":"7","target":"0","relationship":"PRODUCED"}},{"data":{"source":"6","target":"0","relationship":"DIRECTED"}},{"data":{"source":"5","target":"0","relationship":"DIRECTED"}},{"data":{"source":"4","target":"0","relationship":"ACTED_IN"}},{"data":{"source":"3","target":"0","relationship":"ACTED_IN"}},{"data":{"source":"2","target":"0","relationship":"ACTED_IN"}},{"data":{"source":"1","target":"0","relationship":"ACTED_IN"}},{"data":{"source":"1","target":"154","relationship":"ACTED_IN"}},{"data":{"source":"1","target":"87","relationship":"ACTED_IN"}}]}

Popotojs commented 2 years ago

Hi, You can't use data from a json file because every action is done with a cypher query and data is returned from neo4j driver. The only way I would see to use json from a file would be by creating a mockup of driver and use it instead of real one but seems very complex.

Maybe this can help: https://github.com/YizYah/neo-forgery

Note that you can start from a schema but it still needs a neo4j running database https://github.com/Nhogs/popoto-examples/tree/master/start-from-schema

RGEv1L commented 2 years ago

i have no problem with the running database. The thing is, my backend-end have APis with neo4j python driver in it. I dont want to allow Popoto to open sessions directly with neo4j. Instead it should call the APis and popoto should feed from data being ingest from the APIs. I am unable to populate Popoto with json responses returned by the APIs.