Edge e = g.V(fromId).as('a').V(toId).addE(label).from('a').next()
returns and unregistered class ID error for ReferenceEdge
I have tried:
Object map = g.V(fromId).as('a').V(toId).addE(label).from('a').id().next()but it also returns an error:This works:Object map = g.V(fromId).as('a').V(toId).addE(label).from('a').property('edgeId', __.id()).valueMap().next()but I am thinking that there should be some way using Gremlin to return just the id as a string.
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/24d51df4-f9d0-4bf4-aad0-7f5ae73d5dab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Object id = g.V(fromId).as('a').V(toId).addE(label).from('a').property('edgeId', __.id()).properties('edgeId').value().next()
String eStr = "g.V('${fromId}').as('a').V('${toId}').addE('${label}').from('a').next().id().toString()"
org.apache.tinkerpop.gremlin.driver.ResultSet result = client.submit(eStr)
CompletableFuture <Edge> cf = result.all()
Object eId = cf.get()[0].getString()
// Java driver
String gremlin = "g.addV('a').as('a').addV('b').addE('to').from('a').id().next()";
ResultSet results = client.submit(gremlin);
RelationIdentifier edgeId = results.one().get(RelationIdentifier.class);
LOGGER.info(edgeId.toString());
// Java GLV
RelationIdentifier relId = (RelationIdentifier) g.E().id().next();
LOGGER.info(relId.toString());