2

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?

prehfeldt
  • 2,184
  • 2
  • 28
  • 48

1 Answers1

3

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.

Michael Hunger
  • 41,339
  • 3
  • 57
  • 80