I am using janusgraph to develop my java backend. I want to prepare my query on the elements regardless being edges or vertices before specifying to query edges or vertices this will give me flexibility in my code when it comes to building the query dynamically on the properties.
So my question is,Can I use gremlin to prepare the query before starting from V or E ?
For example if I want to apply the same query to Edges and vertices I will write:
g.V().has("p1","v1").has("p2","v1").has("p3","v1")
g.E().has("p1","v1").has("p2","v1").has("p3","v1")
What I am seeking for is something like this
gt = grahTraversal.has("p1","v1").has("p2","v1").has("p3","v1")
gt.E()
gt.V()
Thanks