Repository navigation
Get attributes based on edge id #4522
Answered
by
li-boxuan
w158937299
asked this question in
Q&A
|
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? |
Answered by
li-boxuan
Jun 20, 2024
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 |
2 replies
Answer selected by
porunov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.