I'm trying to add a vertex with a custom ID, and while I've browsed many threads on this (e.g. here), I still can't get it to work for strings/UUIDs, only integer IDs. In fact, it appears only to accept numbers, but I'm not sure why.
gremlin> g.addV().property(T.id, 823749832)
==>v[823749832]
gremlin> g.addV().property(T.id, UUID.randomUUID())
Cannot cast java.util.UUID to java.lang.Number
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> g.addV().property(T.id, '823749832')
Cannot cast java.lang.String to java.lang.Number
Type ':help' or ':h' for help.
Display stack trace? [yN]
Any ideas?
Unless something has changed recently JanusGraph used to only support Long values for custom (user provided) IDs. Different Graph engines allow differing amounts of flexibility in terms of what can be an ID.
See also...