0

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?

Pete Roberts
  • 118
  • 7

1 Answers1

0

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

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
  • Thanks. That cleared something up. Am I right in thinking that Tinkergraph will hand-out LONGs when the Ids aren't user-supplied in this case? – Pete Roberts Nov 05 '20 at 16:03
  • Yes when ANY is set if you do not specify an explicit ID (of an explicit type) TinkerGraph generates LONG IDs. – Kelvin Lawrence Nov 05 '20 at 17:45