Hello. I have the following piece of graph:
As you can see, the red nodes are siblings connected by relationships, NEXT and NEXT_SIBLING; moreover, the first and last child are connected to the father by FIRST_CHILD_OF and LAST_CHILD_OF.
My goal is to find a way to store into a string "A B C D" with the right order.
This is an instance of the problem, because I cannot predict the number of children, that in this case are 4.
What I tried in the RETURN is the following:
apoc.text.join( (COLLECT(TRIM(words.text))), " " )
where words is a node. Unfortunately, the words are not ordered, probably I need to take advantage of the edges in some way.
Could you please suggest a solution?