Search code examples
c#.netgremlin-servertinkergraph

Using String IDs with TinkerGraph


I'm pointing some .Net code at Tinkergraph, for testing purposes, that uses Neptune when deployed. Our Neptune database uses Strings as IDs (always UUIDs, but string objects)

When I query the graph features from the console (I'm using the standard docker image with some tweaks) I see:-

NumericIds: true,
StringIds: true,
UuidIds: true

I have been unable to find a way to get the graph to use strings as IDs. The best I've managed is to switch it to UUIDs.

gremlin.tinkergraph.vertexIdManager=UUID

gremlin.tinkergraph.edgeIdManager=UUID

gremlin.tinkergraph.vertexPropertyIdManager=UUID

This can work, but has meant I've had to change a lot of casts in the original C# code to .ToString() and do a bit of extra work around code that uses dymanics.

Ideally, I'd like the returned Ids to be strings, not System.Guid.

I have looked through the Java code at the IdManagers and I can't see a STRING one. Is there one in the default implementation?


Solution

  • Rather than specify UUID or LONG use ANY to enable String IDs with TinkerGraph.

    The possible values are defined in this file: https://tinkerpop.apache.org/javadocs/current/full/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.DefaultIdManager.html