Neo4j export Tree

点点圈 提交于 2019-12-11 03:35:38

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!