1

I'm using python bulbs with Rexster and OrientDB.

Is there a way to bulk/batch update/insert multiple vertices or edges at the same time?

espeed
  • 4,754
  • 2
  • 39
  • 51
Derek
  • 11,980
  • 26
  • 103
  • 162

1 Answers1

1

For batch operations, it's usually best to use the Gremlin REPL.

See Marko's blog post on building a A Graph-Based Movie Recommender Engine for examples of how do use the Gremlin REPL for batch loading (note it uses Gremlin 1.x code so you'll need to adapt it for Gremlin 2.x).

Here's Gremlin 2.x code for batch loading from the Gremlin REPL:

gremlin> g = new Neo4jGraph('/tmp/neo4j-test')
==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j-test]]
gremlin> bg = new BatchGraph(g, 5)  
==>batchgraph[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j-test]]]
gremlin> l = null
==>
gremlin> "abcdefghijklmnopqrstuvwxyz".each { letter ->
gremlin>   v = bg.addVertex(it,[letter:it])
gremlin    if (l != null) bg.addEdge(v, bg.getVertex(l), 'isAfter')
gremlin>   l = letter;};
==>abcdefghijklmnopqrstuvwxyz
gremlin> bg.commit()
espeed
  • 4,754
  • 2
  • 39
  • 51
  • @stephenmallette might have more ideas on how to approach batch loading with the latest Gremlin. – espeed Jan 25 '14 at 17:26