【发布时间】:2020-08-25 10:13:06
【问题描述】:
我想选择所有 l 标记的顶点以及它们的 t 标记的顶点,这些顶点按它们的邻居分组。我还想对邻居的长度施加限制。
对于 ex for neighbor limit = 2,应该输出如下内容。
[
{"l1",[t1,t2]},
{"l2",[t3]},
{"l3",[]}
]
对于 ex for neighbor limit = 1,应该输出类似下面的内容。
[
{"l1",[t1]},
{"l2",[t3]},
{"l3",[]}
]
grelify 链接https://gremlify.com/xun4v83y54/1
g.addV('Vertex').as('1').property(single, 'name', 'l1').property(single, 'label', 'l').
addV('Vertex').as('2').property(single, 'name', 'l2').property(single, 'label', 'l').
addV('Vertex').as('3').property(single, 'name', 'l3').property(single, 'label', 'l').
addV('Tag').as('4').property(single, 'name', 't1').property(single, 'label', 't').
addV('Tag').as('5').property(single, 'name', 't2').property(single, 'label', 't').
addV('Tag').as('6').property(single, 'name', 't3').property(single, 'label', 't').
addE('connected').from('1').to('4').
addE('connected').from('1').to('5').
addE('connected').from('2').to('6')
【问题讨论】:
标签: gremlin tinkerpop tinkerpop3 gremlin-server tinkergraph