Edge id is different between gremlin console and vertex program

62 views
Skip to first unread message

Saloni Agarwal

unread,
Aug 21, 2020, 10:28:21 AM8/21/20
to JanusGraph users
Hi, I'm using jansugraph with Cassandra + ES combination and doing data ingestion with OLAP mode using the vertex program.
Edge id which I'm getting from gremlin console is different from value coming from the vertex program.
Edge id from gremlin console - 
gremlin> g.E()

==>e[42bn5v-215tzs-ro5-2pjr34][122884120-Identity->163844320]

Edge id from vertex program - 
@Override
public void execute(final Vertex vertex, final Messenger<Object> messenger, final Memory memory) {
    Iterator<Edge> edgeIterator = vertex.edges(Direction.BOTH);
    while (edgeIterator.hasNext()) {
        Edge edge = edgeIterator.next();
        logger.info("edge_id = {}", edge.id().toString());
    }
}

edge_id = 245767171

How can I get the same values from both places?

HadoopMarc

unread,
Aug 23, 2020, 4:37:58 AM8/23/20
to JanusGraph users
Try this:

g.E().next().id().getRelationId()

Best wishes,

Marc

Op vrijdag 21 augustus 2020 om 16:28:21 UTC+2 schreef saloniag...@gmail.com:

Saloni Agarwal

unread,
Aug 24, 2020, 3:59:44 AM8/24/20
to JanusGraph users
Thanks Marc !!

Saloni Agarwal

unread,
Aug 24, 2020, 7:09:26 AM8/24/20
to janusgra...@googlegroups.com
though I wanted to know, is there a way to get edge id rather than relationid from vertex program?


--
You received this message because you are subscribed to a topic in the Google Groups "JanusGraph users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/janusgraph-users/k578ktX_m5Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to janusgraph-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/58c147c4-277e-4d5b-bd9a-590d4ddb0ff4n%40googlegroups.com.

HadoopMarc

unread,
Aug 24, 2020, 9:48:23 AM8/24/20
to JanusGraph users
Without repeating your experiment I do not understand how the edge.id().toString() logging can result in a single number. Can you also log the edge.id().getClass() ?

I would expect the edge.id() to be an instance of:


(as it is for OLTP g.E().next().id().getClass())

HTH,    Marc

Op maandag 24 augustus 2020 om 13:09:26 UTC+2 schreef saloniag...@gmail.com:

HadoopMarc

unread,
Aug 25, 2020, 3:07:53 PM8/25/20
to JanusGraph users
See my answer to the parallel thread on this forum: https://groups.google.com/g/janusgraph-users/c/9nfJVk0t9WM

Op maandag 24 augustus 2020 om 15:48:23 UTC+2 schreef HadoopMarc:
Message has been deleted

Saloni Agarwal

unread,
Aug 26, 2020, 12:46:40 PM8/26/20
to JanusGraph users
Thanks Marc, for the above thread. It was helpful.

regards,
Saloni

Reply all
Reply to author
Forward
0 new messages