问题
I want to export a Tree which has a distinct root node. I tried it with gremlin (g.saveGraphML("export.graphml")) but this is exporting the whole database. Then I tried it with g.v(783095).saveGraphML("export.graphml") which gave me an error (No signature of method: java.util.HashMap.saveGraphML() is applicable for argument types: (java.lang.String) values: [export.graphml])
Any Ideas?
回答1:
Try to create a subgraph of g into a temporary graph structure and then save that one.
g = new Neo4jGraph('/tmp/mygraph')
h = new TinkerGraph()
// some algorithm to map a subset of g to h
h.saveGraphML('subgraph.xml')
Otherwise it should be fairly easy to use gremlin to create a graph representation like geoff because it is just json and should be easy to (de)-serialize.
来源:https://stackoverflow.com/questions/6871860/neo4j-export-tree