我对groupCount
使用结果节点执行更多查询感到有些困惑。我一直在 Neo4j 控制台中这样做。例如,使用 TinkerGraph 数据集:
gremlin> g = TinkerGraphFactory.createTinkerGraph()
==> tinkergraph[vertices:6 edges:6]
gremlin> g.V.getClass()
==> class com.tinkerpop.gremlin.groovy.GremlinGroovyPipeline
gremlin> m = [:]
gremlin> g.V.out.groupCount(m)
==> v[2]
==> v[4]
==> v[3]
==> v[3]
==> v[5]
==> v[3]
gremlin> m
==> v[2]=1
==> v[4]=1
==> v[3]=3
==> v[5]=1
gremlin> m.getClass()
==> class java.util.LinkedHashMap
gremlin> m = m.keySet()
==> v[2]
==> v[4]
==> v[3]
==> v[5]
gremlin> m.getClass()
==> class java.util.HashMap$KeySet
gremlin> m.outE
==> [StartPipe, OutEdgesPipe]
==> [StartPipe, OutEdgesPipe]
==> [StartPipe, OutEdgesPipe]
==> [StartPipe, OutEdgesPipe]
gremlin> m.outE.map
==> [StartPipe, OutEdgesPipe, PropertyMapPipe]
==> [StartPipe, OutEdgesPipe, PropertyMapPipe]
==> [StartPipe, OutEdgesPipe, PropertyMapPipe]
==> [StartPipe, OutEdgesPipe, PropertyMapPipe]
如何m
用作GremlinGroovyPipeline
对象?我期待与此类似的结果:
gremlin> m.outE
==> e[7][1-knows->2]
==> e[8][1-knows->4]
==> e[9][1-created->3]
==> e[12][6-created->3]
==> e[10][4-created->5]
==> e[11][4-created->3]