Search code examples
recursionsparqlrdfsemantic-web

Definition of a recursive query in SPARQL


Can we call the below query a recursive query? if not, what can we call it?

select ?x ?y 
where{
?x p1* ?y
}

Solution

  • Yes, property path operators, such as *, offer a limited recursion in SPARQL. However, note that variables are not allowed in property paths, so your query is syntactically invalid.