gremlin 术语中的 InV 步骤是什么意思?
What is the meaning InV step in gremlin terminology?
特别是按照这里的教程:https://kelvinlawrence.net/book/Gremlin-Graph-Guide.html#walk (3.3.2)
我不明白这个说法outE().inV()
取自g.V().has('airport','code','LCY').outE().inV().path()
解释是:
"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.
然后在 3.3 中。开始遍历图 我们在 Table 1 中找到以下定义:
outV Outgoing vertex.
inV Incoming vertex.
到底是怎么回事传入顶点=出边另一端的顶点
如果有的话,我认为 出边另一端的顶点 如果是 OutV 而不是 InV。
因此有人可以阐明 inV 和 outV 的含义吗?
我们是说如果我有一条有向边 A -> B,那条边的入点是 B,那条边的出点是 A?不确定,但如果是这样,该术语的基础如何,听起来违反直觉,因为在使用 Vertex 时看起来恰恰相反。
全看角度
从直接边的角度来看,边是从一个顶点出来并进入另一个顶点,所以起点是 outV
,终点是 inV
。
从顶点的角度来看,情况恰恰相反,输出顶点将是从我到它们的连接点。对于这种情况,您可以使用直接到达传出顶点的 out
步骤(相当于 outE().inV()
)。
我理解你的困惑,一开始我也在为这个问题苦苦挣扎。
特别是按照这里的教程:https://kelvinlawrence.net/book/Gremlin-Graph-Guide.html#walk (3.3.2)
我不明白这个说法outE().inV()
取自g.V().has('airport','code','LCY').outE().inV().path()
解释是:
"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.
然后在 3.3 中。开始遍历图 我们在 Table 1 中找到以下定义:
outV Outgoing vertex.
inV Incoming vertex.
到底是怎么回事传入顶点=出边另一端的顶点
如果有的话,我认为 出边另一端的顶点 如果是 OutV 而不是 InV。
因此有人可以阐明 inV 和 outV 的含义吗?
我们是说如果我有一条有向边 A -> B,那条边的入点是 B,那条边的出点是 A?不确定,但如果是这样,该术语的基础如何,听起来违反直觉,因为在使用 Vertex 时看起来恰恰相反。
全看角度
从直接边的角度来看,边是从一个顶点出来并进入另一个顶点,所以起点是 outV
,终点是 inV
。
从顶点的角度来看,情况恰恰相反,输出顶点将是从我到它们的连接点。对于这种情况,您可以使用直接到达传出顶点的 out
步骤(相当于 outE().inV()
)。
我理解你的困惑,一开始我也在为这个问题苦苦挣扎。