Search code examples
pythongraph-databasesgremlintinkerpop

custom id in gremlin_python


A custom id can be supplied to a new vertex at the Gremlin Console as follows:

gremlin> g.addV('person').property(id, 1234).next()
==>v[1234]

In the Java client it can be done as follows:

graph.addVertex(T.id, customId);

(Where T is org.apache.tinkerpop.gremlin.structure.T)

Is there an equivalent of T.id for gremlin_python to facilitate the above form?

Many thanks.


Solution

  • There is a T enum for Python at gremlin_python.process.traversal.T (source code)