在 Gremlin 用户邮件列表上回答,但要关闭圈子,再次遍历:
gremlin> g.V().as("e0").outE("e").as("e").inV().as("e1").select("e0","e","e1").
gremlin> group().by(select("e0","e1").by("name")).
gremlin> by(fold().match(__.as("x").count(local).as("freq"),
gremlin> __.as("x").unfold().select("e").by("value").max().as("max")).select("freq","max")
gremlin> ).next()
==>{e0=c, e1=d}={freq=1, max=9}
==>{e0=b, e1=d}={freq=1, max=9}
==>{e0=f, e1=h}={freq=1, max=9}
==>{e0=e, e1=h}={freq=1, max=9}
==>{e0=a, e1=b}={freq=2, max=10000}
==>{e0=b, e1=c}={freq=4, max=4}
==>{e0=e, e1=f}={freq=1, max=9}
==>{e0=f, e1=g}={freq=1, max=9}
==>{e0=a, e1=c}={freq=1, max=9}