I'm trying basic JanusGraph operations on JVM.
When I attempt to simply create an edge between two vertices and calling vertex1.edges()
I'm getting a result of org.janusgraph.graphdb.transaction.RelationConstructor
rather Iterator<Edge>
, which is against api.
I could regenerate the same result on Gremlin console once as shown below. But I'm getting proper org.janusgraph.graphdb.query.ResultSetIterator
in my subsequent attempts.
gremlin> person = graph.addVertex(label, 'person')
==>v[163844144]
gremlin> graph.tx().commit()
==>null
gremlin> person2 = graph.addVertex(label, 'anotherperson')
==>v[245764240]
gremlin> person.addEdge("knows", person2);
==>e[2pjoxy-2pjqy8-29ed-42bkwg][163844144-knows->245764240]
gremlin> graph.tx().commit()
==>null
gremlin> person.class
==>class org.janusgraph.graphdb.vertices.StandardVertex
gremlin> mye = person.edges(Direction.BOTH, "knows")
==>e[2pjoxy-2pjqy8-29ed-42bkwg][163844144-knows->245764240]
gremlin> mye.class
==>class org.janusgraph.graphdb.transaction.RelationConstructor$1$1
Could someone please explain why and/or suggest a workaround? Thank you!