What is the meaning InV step in gremlin terminology?
Asked Answered
T

1

8

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.

Theurich answered 1/7, 2020 at 11:31 Comment(1)
Please feel free to suggest improvements to the wording.Adao
I
8

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.

Incompetence answered 1/7, 2020 at 12:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.