You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, there's no direct way to do this. You would have to graph.run(...).to_subgraph() and then manually iterate through the nodes and relationships to convert them into NetworkX format.
Out of interest, how would you expect to map the node labels and relationship types onto a NetworkX graph?
Well a simple solution such as https://neo4j.com/labs/apoc/4.1/export/graphml/ what is happening for t.graphml.all would do the job already i.e. having a Networkx MultiDiGraph with an edge attribute relationship_kin / node_kind to store the label /type and then all the attributer as key/value lookups.
hi @geoHeil ,
i am not familiar with NetworkX but if you just need a graphml export what about a tiny CALL apoc.export.graphml.all(null, {stream:true}) ?
frompy2neoimportGraphg=Graph(name="test")
# Create testdata on db1g.run("CREATE (n:MyNode) SET n.id = 1")
g.run("CREATE (n:MyNode2) SET n.id = 2")
# Extract data from db1graphml=g.run(
"CALL apoc.export.graphml.all(null, {stream:true}) yield file, nodes, relationships, properties, data RETURN file, nodes, relationships, properties, data"
).to_data_frame()
print(graphml)
how can I export the graph to networkx which is obtained by running some cypher query?
The text was updated successfully, but these errors were encountered: