Search code examples
pythongremlintinkerpoptinkerpop3

Possibilities for creating programs with Python for graph processing in Tinkerpop


I'm just starting out with Tinkerpop and looking for the best way to achieve the following:

  • in the beginning, there is a small 'starting-graph'
  • a couple of scripts, each having some functions, will interact with this graph
  • each script will:
  • 1) read and interpret nodes, edges, their attributes and ideally also perform some network metrics to understand the 'current structure'
  • 2) based on rules in the functions, update (properties of) nodes & edges
  • within each script, there is also some interaction between the functions, in terms of "if these nodes are >x, call function B"
  • the problem-set is actually a bit larger than this..

But understanding how to work on (simultaneously running instances of) scripts for graph traversal / interpretation / updating is already very valuable.

I prefer to use Python, but willing to dive into other things if needed :)


Solution

  • I would recommend spending some time getting familiar with Gremlin.

    The Apache TinkerPop project includes support for Python. You can find details here [1] and can install using Pip. You may also find the information at [2] useful as well as the official TinkerPop docs.

    [1] http://tinkerpop.apache.org/docs/current/reference/#gremlin-python

    [2] https://github.com/krlawrence/graph