Moved from GitHub dgraph/1494
Posted by matth3wga0:
With Neo4j, the query can be ordered by the length of the edge path, and return depth of the path in the query result, it’s useful in some scenario, such as calculating the relationship rank.
In Dgraph, the depth is only a parameter in the recurse query, I think Dgraph can go further.
START n=node:index(Name=“Steven Spielberg”) MATCH path=n-->m--l<--o RETURN o ORDER BY length(path);