thisVertex/thisEdge literals
-
Syntax:
-
thisVertex or thisEdge
These special literals can be used in goal restrictions to reference a vertex or an edge on the path.
This can save an extra variable and consequently improve query performance.
-
Example:
- Instead of
from u: V{Alpha}, v: V{Beta}, w: V{Gamma} with u --> v and degree(v)>10 and v --> w report ... end
you can write a path expression with an intermediate goal restriction:
from u: V{Alpha}, w: V{Gamma} with u --> &{Beta @ degree(thisVertex)>10} --> w report ... end