Reputation: 219
In the gremlin console one can easily create an in-memory TinkerGraph to play with (or load one of the sample graphs):
gremlin> graph = TinkerGraph.open()
gremlin> g = graph.traversal()
Is is possible to expose this graph / its traversal source to a GLV (such as gremlin-python)?
I am really surprised that this seems not to be a thing. Using a in-memory TinkerGraph easily in a GLV would:
Upvotes: 2
Views: 302
Reputation: 46216
You can only access TinkerGraph (or any other graph) with Python if hosted in Gremlin Server. The reason isn't too surprising. Gremlin Language Variants are meant to be lightweight which means they aren't complete implementations of the Gremlin Virtual Machine (GVM). Without a complete GVM (which performance actual traversal execution) you can't have a graph implementation, like TinkerGraph, to instantiate. This is why we have Gremlin Server to host the GVM in the JVM for gremlin-python to talk to over bytecode. So, at least you get the benefit of Gremlin in your native language of Python but you just don't get as integrated an experience as Java.
I'd agree that it would be great to have a TinkerGraph (or other Python graph systems) working in Python but that would be a lot of work as you would have to build a GVM for Python.
Upvotes: 3