{
var(func: eq(id, 933)) @filter(type(Person)){
A1 as knows{
uid
A2 as knows{
uid
A3 as knows{
uid
}
}
}
}
}
I want A1, A2, A3 to have no duplicate nodes for each other
(Since A1, A2, A3 will be used later, recursion is not allowed)
so, How to make the query results not duplicate?
Returning to this pattern. I don’t think it is like this. I think it should look like
{ var A - edge -> Any* {
var B - edge -> Any* { var C - edge -> Any* }}}
Cuz the variable will collect all nodes on that edge and it can be one or more nodes there. Your pattern feels like it is stating that it would return always 1:1 relations.
The math part isn’t exactly what I was mentioning. You could potentially use a kind of aggregation via levels. And maybe use k-shortest-path.
Maybe I’m tired, I had a long day. But I’m not able to get what you wanna do. The main question felt to be like, “How to remove duplicate nodes from a result”. After you mentioned about counting degrees. And this last question I get totally without a north.
I’m got wrong the first issue? if not so, can you state that I was (at least one of your issues) solved?
If we sync, we might go to the k-shortest path. But I need to understand what you need for real. Show me in “before, after” with JSON results. What you would like to see as a result.
Sorry, I have no idea hwo to help you there. There’s no method to check and give the leve/degree/position of the nested levels in Dgraph. All we can do is doing manual inputs with math func. But that is somewhat useless.
Maybe we need a ticket for that feature. To give us the level, that can be useful in Recurse queries. Also, we have the k-shortest path https://dgraph.io/docs/query-language/kshortest-path-quries/#sidebar - It is very useful to see the path between two known objects. But I think it also needs some useful methods like “Give us the count of hops of each path found”. And other things.
I think that thing you wanna do only can be accomplished via your side application. Dgraph can’t do this.