Dear all, Using SPARQL 1.1 it is straightforward to do a path query to match a long chain in a graph, for example:
?leaf (rdfs:subClassOf)+ ?root In my case I'm trying to match trees within an RDF graph. The internal nodes of the trees are either unary or binary. This could be described by the (nearly) BNF grammar root ::= root bOp root | uOp root | leaf leaf ::= (?leaf rdf:type my:leaf) where bOp stands for a binary operation and uOp for a unary operation. In practice, bOp would be :bOp rdf:type rdf:Property :bOp rdfs:domain rdfs:Class . :bOp rdfs:range rdf:List . and the rdf:List contains only two items. Is it possible to formulate a SPARQL query to match this kind of recursive structure? If, as I suspect, it is not possible, what stratgy is commonly used when trying to find such recursive structures in an RDF graph? -- Dr Aidan Delaney web : http://www.phoric.eu/aidan twitter : @aidandelaney
