Search code examples
gremlingremlinpython

Gremlin BatchGraph in python


I cannot find an implementation of BatchGraph (https://github.com/tinkerpop/blueprints/wiki/Batch-Implementation) in python connector (https://pypi.python.org/pypi/gremlinpython)

Could anyone assist me with this?


Solution

  • I've received an answer from TinkerPop Jira ticket, that BatchGraph was deprecated.

    In general, massive batch loads (say millions of things) should be done with OLAP and anything less is probably best done with a groovy script. If you want to do it from python i would just write a parameterized script like:

    data.each {
      g.addV('name', it.name, 'age', it.age).iterate()
    }
    

    where "data" is a parameter you pass with the script. "data" is just a List and the number of maps represents your batch size. Use sessionless requests so that Gremlin Server auto-commits. If you have further follow up questions, please ask them on the gremlin-users mailing list - thanks.