graph icon indicating copy to clipboard operation
graph copied to clipboard

Expand section on finding parallel edges

Open krlawrence opened this issue 5 years ago • 0 comments

The examples that are used to explore parallel edge detection return results in terms of vertex pairs. It would be good to add examples that return the actual edges instead. A simple example would be to add a duplicate edge between SAF (44) and DFW (8) and then run the query below.

gremlin> g.addE('route').from(V(44)).to(V(8))
==>e[60867][44-route->8]
gremlin> g.V(44).outE().group().by().by(inV().path().by().by(label)).unfold().group().by(values).by(select(keys).fo
ld()).unfold()
==>path[v[44], route, v[13]]=[e[5020][44-route->13]]
==>path[v[44], route, v[8]]=[e[60867][44-route->8], e[5019][44-route->8]]
==>path[v[44], route, v[20]]=[e[5021][44-route->20]]
==>path[v[44], route, v[31]]=[e[5022][44-route->31]]   
gremlin> g.V(44).outE().group().by().by(inV().path().by().by(label)).unfold().group().by(values).by(select(keys).fo
ld()).unfold().filter(select(values).count(local).is(gt(1)))
==>path[v[44], route, v[8]]=[e[60867][44-route->8], e[5019][44-route->8]]       

krlawrence avatar Jul 08 '20 13:07 krlawrence