graph-databasestitangremlin

Gremlin : Add multiple vertices in single gremlin query?


I am using Titan 0.4 + Cassandra. My use-case requires insert multiple vertices at a time. (aprrox batch size is 100 vertices at a time.) eg :

v01 = g.addVertex(["UC":"B","i":2]); v02 = g.addVertex(["UC":"H","i":1])
v03 = g.addVertex(["LC":"a"]); v04 = g.addVertex(["LC":"a"]);
v05 = g.addVertex(["LC":"d"]); v06 = g.addVertex(["LC":"h"]); 
v07 = g.addVertex(["LC":"i"]); v08 = g.addVertex(["LC":"p"]);

Is there any gremlin command to add all Eight vertices in a single request. ( something like g.addVertices() ?? )


Solution

  • Gremlin does not have an addVertices() wrapper - you'll need to call addVertex() multiple times.