【发布时间】:2018-04-30 10:14:31
【问题描述】:
样本数据:TinkerPop Modern
总结:我想找到创建了 2 个软件的人。
我从基础开始,并正确计数
g.V().hasLabel("Person").as("from" ,"to1" )
.repeat(bothE().as("e1").otherV().as("to1").dedup("from", "to1")).times(1)
.emit(filter(hasLabel("Software"))).hasLabel("Software")
.group().by(select("from").by("name")).by(count()).as("c")
结果:
>> {'Marko': 1, 'Peter': 1, 'Josh': 2}
所以我尝试应用过滤器但它不起作用(即结果不正确),我尝试了什么:
g.V().hasLabel("Person").as("from")
.repeat(bothE().as("e1").otherV().as("to1").dedup("from", "to1")).times(1)
.filter(bothE().otherV().hasLabel("Software").count(local).is(eq(1)))
.dedup()
.values("name")
知道我做错了什么吗?
样本数据:
【问题讨论】:
标签: gremlin tinkerpop3