Get attributes based on edge id #4522
-
It is known that the id of an edge is {'outVertexId': 4120, 'typeId': 10261, 'relationId': 27651, 'inVertexId': 20544}, so how do we get the corresponding attribute based on this id, I have tried many ways but I am unable to get it. Could you please provide me with the appropriate query? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can also use RelationIdentifier::toString method to construct the edge out of this representation. E.g. public class App {
public static void main(String[] args) {
org.janusgraph.graphdb.relations.RelationIdentifier id = new RelationIdentifier(4120, 10261, 27651, 20544);
System.out.println(id);
}
} which would print out the result: So you could use |
Beta Was this translation helpful? Give feedback.
g.V(4120).outE().where(inV().hasId(20544)).values('prop')
if you know there's only one edge between these two vertices.You can also use RelationIdentifier::toString method to construct the edge out of this representation. E.g.
which would print out the result:
lc3-36g-7x1-fuo
.So you could use
g.E("lc3-36g-7x1-fuo")
to find this edge.