I am just starting out with cypher but I must say I could use more examples in the documentation but that's just how I learn
I have a "tree-like" database :
A->B1/B2 (several) -> C(several) -> D(several). I am trying to aggregate several properties at different levels. For example, how many B1 and B2 does A have, how many Cs does A have and so on. I would ideally expand this later on to show what is the average count of Cs for all B1s in A.
The output would ideally look like:
A.name, #B1s, #C, average(#C) per B1 for A
My cypher-fu is still quite limited but I can for example get the first level counts and averages, ie, how many B1s or B2s I have per A. Where I start to struggle is how to count total number of Cs and average number of Cs per B1 in A, or both B1s, B2s, etc.
I imagine you can query it directly, for specific limited questions that you have started to describe. In order to help with that it would be very helpful if you could provide a simple example graph (e.g. CREATE statements), and describe some specific query(s). For clarity, providing the right answer (hand calculated) would be ideal.
Thanks everyone. I ended up going with something very simple, basically doing several subqueries/CALL {} for the time being. It actually works well because the "tree" is stereotyped enough I don't need to think recurrently!