Stephen Mallette
unread,Jan 25, 2013, 2:26:16 PM1/25/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to aureliu...@googlegroups.com, Eric Scrivner, Blake Eggleston, Mike Khristo
For what you are trying to accomplish it sounds like simply doing a
Gremlin script for the conversion would be best. Obviously you will
want to tweak to batch the transactions (maybe wrap in BatchGraph or
something), but:
gremlin> g = TinkerGraphFactory.createTinkerGraph()
==>tinkergraph[vertices:6 edges:6]
gremlin> target = new TinkerGraph()
==>tinkergraph[vertices:0 edges:0]
gremlin> g.V("name","marko")
==>v[1]
gremlin> target.createKeyIndex("name", Vertex.class)
==>null
gremlin> g.V.sideEffect{ElementHelper.copyProperties(it, target.addVertex())}
==>v[3]
==>v[2]
==>v[1]
==>v[6]
==>v[5]
==>v[4]
gremlin> g.E.sideEffect{ElementHelper.copyProperties(it,
target.addEdge(target.V('name',it.outV.name.next()).next(),
target.V('name', it.inV.name.next()).next(), it.label))}
==>e[10][4-created->5]
==>e[7][1-knows->2]
==>e[9][1-created->3]
==>e[8][1-knows->4]
==>e[11][4-created->3]
==>e[12][6-created->3]
Stephen
> --
>
>