This is not quite the same thing as I asked. I don’t care about the actual nodes, I only care about the amount of nodes.

All I care is to find UIDs whose list lengths are the same, without caring about the content of these lists.

For example, given a genealogy tree find all people who have the same number of siblings as their number of children. Naturally their brothers and sisters are not the same people as their children. And the query would find people who have 4 siblings and 4 children, as well as those who only have 1 sibling and 1 child. But not those who have 3 siblings and 2 children, or 5 children but 1 sibling.

Hum, I was trying to accomplish what I understood from your queries. What the syntaxes would mean. But as you explained it better, I can see that the queries are far from it. And I can say that is not possible to do it in a practical way. Bellow follows a kind of “hack” way to do comparisons and getting a meaningful result from it (Like “true/false”).

It is “hacky”, which means it can’t have the desired result in other scenarios and it abuses from the query system.

I’ve used the other sample of yours to do this example.

{
var(func: uid(0x7)) {
A as count(Links) #It has 2 links
}
var(func: uid(0x6)) {
B as count(Links) #It has 1 link
}
var() {
G as sum(val(A))
T as sum(val(B))
}
me() {
result: math( G > T )
}
}

Result

{
"data": {
"me": [
{
"result": true
}
]
}
}

And this needs a deeper look and thought to answer.

For curiosity and to better understand the fundamentals, why does dgraph not support two functions:

What is preventing dgraph from being able to process this? If it can evaluate a function on one side, shouldn’t it also be able to evaluate a function on the other side of an equation? Maybe this is a little deeper subject than the OP, sorry.