Ok, the form [1zf-388-b2t-368][4184-lives->4112] derives from:
https://github.com/apache/tinkerpop/blob/3.4.7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/StringFactory.javareturn E + L_BRACKET +
edge.id() + R_BRACKET + L_BRACKET + edge.outVertex().id() + DASH + edge.label() + ARROW + edge.inVertex().id() + R_BRACKET;
You can also check in the console:
gremlin> import org.janusgraph.util.encoding.LongEncoding
gremlin> LongEncoding.encode(2571L)
==>1zf
gremlin> LongEncoding.encode(4184L)
==>388
gremlin> LongEncoding.encode(4112L)
==>368
I guess you have to typecast the
edge.id() result to the JanusGraph RelationIdentifier somehow to get the canonical form you want. My scala is a bit rusty, so I leave that to you.
Btw, it can hardly be a coincidence that someone else had the same problem in a current thread!
Marc