Reputation: 1
I want to get the result based on these two conditions in single titan vertex query in java.
Fetch n1 edges with label knows:
v.query().labels('knows').has('id',1).limit(n1)
Fetch n2 edges with label knows:
v.query().labels('knows').has('id',2).limit(n2)
Upvotes: 0
Views: 45
Reputation: 10904
You can (and should) use Gremlin queries. The Gremlin query that solves your problem (I assume you're looking for adjacent vertices):
g.V(v).union(both("created").has("id", 1).limit(n1),
both("created").has("id", 2).limit(n2))
Doesn't make much sense IMO, but you're probably just asking for the query pattern.
Upvotes: 1