Is it somehow possible to get the list of nodes connected through a transient relation with SPARQL?
I have elements that are connected in this way:
?a g:eastOf ?b
?b g:eastOf ?c
...
Not all nodes are connected with each other, because some are further down south. Only when nodes are vertically at the same plain there might be a g:eastOf
relationship. This means there are several groups of nodes that are not connected with each other.
So now I'd like to get all these groups of nodes (basically a list of lists). Is there a way to do that in SPARQL? Because in the SELECT
statement you have to list a finite number of variables and can't somehow express "a list of" something.
Also I'm only interested in the lists where a xsd:integer
property of all nodes is ascending when going from west to east. But that should be relatively easy after I have the solution for my first problem.