[英]Fetch outgoing edge property value between two vertices in scala gremlin
[英]Gremlin: Select Vertices that have edges that share a property
这是在格林贝斯卡拉。 我在顶点处遍历(以下是“ _”的意思:
_.as("vertex").outE().as("outEdge").in().inE().as("inEdge")
.select("inEdge","outEdge").by("fullName")
.where("inEdge", P.eq("outEdge")).select("vertex")
但是我在.as(“ outEdge”)语句后引用.in()时遇到错误:
Error:(55, 40) Cannot prove that org.apache.tinkerpop.gremlin.structure.Edge <:< gremlin.scala.Vertex.
谁能帮我弄清楚这里出了什么问题,更重要的是,这是找到边缘具有匹配属性的顶点的正确方法吗?
提前致谢。
我认为语法不正确。 更改:
_.as("vertex").outE().as("outEdge").in()
至
_.as("vertex").outE().as("outEdge").inV()
当您执行outE()
您将处于一条边上,因此您必须遍历一个顶点,该顶点将是inV()
(与inV()
所在位置相邻的顶点), outV()
(从遍历outE()
或bothV()
,这将在边的任一端产生两个顶点。
我认为您比较属性的方法很有意义。 其他人可能会发布进一步简化的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.