Skip to content Skip to sidebar Skip to footer

Gremlin: How Works Io Import With Python

I am trying to know what are the functions called from the command g.io('file.json').read().iterate() I see that a 'read' step is put in the step_instructions but I can't found the

Solution 1:

First of all to be clear on the nomenclature, io() is a step, while read() and write() are step modulators and those modulators can only apply to io() step to tell it to read or write respectively. Therefore, as io() currently only works with a string file name consequently you can only read/write from/to files.

If you want to send "a lot of data" with Python, I'd first consider what you mean by that in size. If you're talking millions of vertices and edges, you should first check if the graph database you are using has its own bulk loading tool. If it does, you should use that. You may also consider methods using Gremlin/Spark as described here in the case of JanusGraph. Finally, if you must use pure Gremlin to do your bulk loading, then parameterized traversal with your Python object (I assume a list/dict of some sort) is probably the approach to take. This blog post might offer some inspiration in that line of thinking.

Post a Comment for "Gremlin: How Works Io Import With Python"