in particular following the tutorial here: https://kelvinlawrence.net/book/Gremlin-Graph-Guide.html#walk (3.3.2)
I do not understand this statement outE().inV()
Taken from g.V().has('airport','code','LCY').outE().inV().path()
The explanation is:
"Start at the LCY vertex, find all outgoing edges and also find all of the vertices that are on the other ends of those edges". The inV step gives us the vertex at the other end of the outgoing edge.
and then in 3.3. Starting to walk the graph we find in Table 1 the following definition:
outV Outgoing vertex.
inV Incoming vertex.
How on earth Incoming vertex = the vertex at the other end of the outgoing edge
If anything, i would think that the vertex at the other end of the outgoing edge if the OutV and not InV.
Hence can someone clarify the meaning of both inV and outV ?
Are we saying that if i have a directed Edge A -> B, the incoming vertex of that Edge, is B, and the Outgoing Vertex of that Edge is A ? Not sure, but if so, how the basis of that terminology, it sounds counter intuitive as it sees to be the opposite when working with Vertex.
It's all depends on the point of view.
From a direct edge point of view, the edge is going out from a vertex and getting into another, so the starting point will be the outV
and the endpoint will be the inV
.
For the vertex point of view it will be the opposite, the outgoing vertices will be the one that connected from me to them. for that case, you can use the out
step that goes directly to the outgoing vertex (equivalent to outE().inV()
).
I understand your confusion I was struggling with that also at the beginning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With