I would like to formulate an SPARQL query that asks if there exist a undirected path between node a and d.
My data looks as follows:
<a> <p1> <b>
<c> <p2> <b>
<c> <p3> <d>
Here is a small ascii drawing of the same data
(a) --> (b) <-- (c) --> (d)
I tried with the following query:
ASK
WHERE {
<a> (<>|^<>)* <d> .
}
How do I make an ASK SPARQL query that returns yes when asked if there is an undirected path between a and d?