Reputation: 2933
The Tinkerpop Frames wiki says that a vertex can be given the annotation below in order to get all people that a given person "knows". But how would I find all people related to a given person regardless of what the label is on the edge that connects them? Is this possible?
@Adjacency(label="knows")
public Iterable<Person> getKnowsPeople();
Thanks!
Upvotes: 0
Views: 415
Reputation: 7562
You can't without modifying the underlying framework. In the AdjacencyAnnotationHandler.processVertex method, you will find that Frames simply calls the getVertices() method of the target Blueprints Vertex:
if (ClassUtilities.isGetMethod(method)) {
final FramedVertexIterable r = new FramedVertexIterable(framedGraph,
vertex.getVertices(
adjacency.direction(), adjacency.label()),
ClassUtilities.getGenericClass(method));
if (ClassUtilities.returnsIterable(method)) {
return r;
} else {
return r.iterator().hasNext() ? r.iterator().next() : null;
}
}
If you need the functionality you've requested, modify this statement to return all vertices or use some convention (like an asterisk in for the value of the label) to perform some expression based binding.
Upvotes: 1