title: SPARQL recursive ancestor query
body: <p>I'm stuck with a recursive query in SPARQL, I cant wrap my head around it. I want to get all ancestors of an instance "<code>a</code>" (<code>a hasParent b, b hasParent c, c hasParent d</code>) so the result would be "<code>b, c ,and d</code>" if instance is "<code>a</code>".</p>
  
  <p>Any ideas how to construct the linked part where parent has a parent which has another parent? (The depth of the recursion is not known)</p>