Thanks @amaster. I’m now trying some different approaches (to this seemingly common need) to return nested nodes as a sequence - and seeing if non-exotic queries can solve it.
So to test, I changed requirement to abide by restrictions and only return 1 Node Type. (Ex: collapse all those Restaurant nodes, RestArea nodes etc into a common “Waypoint” nodes.)
And trying a Recurse DQL query now, it is not clear to me how to build a nested sequence when I get errors of “recurse queries require that all predicates are specified in one level.”
How then would one get a nested sequence from:
Node w predicate X pointing to → Node w predicate X pointing to → Node w predicate X pointing to → Node?
Ex: Waypoint node with NextStop pointing to → Waypoint node with NextStop pointing to → Waypoint node
I’d imagine a Shortest Path query perhaps could do it IF you knew both the starting Waypoint and chose an ending Waypoint (among many)… But if the requirement changes to “let’s map out all the various paths” ie, “predicate X can return an array of Nodes / AvailableNextStops can be an array of possible next stops”, then I would image Recurse is the only way to achieve that query - to build a such a nested map?
But it’s not clear how to create a nested recurse query with the “one level” limitation?