The following SPARQL query can’t be parsed although it’s valid syntax:
PREFIX pizza: <http://www.co-ode.org/ontologies/pizza/pizza.owl#>
SELECT DISTINCT ?pizza WHERE {
?pizza owl:equivalentClass
[ a owl:Class ;
owl:intersectionOf [ rdf:rest*/rdf:first ?otherClass ] ] .
}
Error message:
Error!
Parse error on line 10:
...sectionOf [ rdf:rest*/rdf:first ?otherCl
-----------------------^
Expecting 'IRIREF', 'PNAME_NS', 'VAR', '(', 'INTEGER', 'NIL', '[', 'BLANK_NODE_LABEL', 'ANON', 'DECIMAL', 'DOUBLE', 'true', 'false', 'STRING_LITERAL1', 'STRING_LITERAL2', 'STRING_LITERAL_LONG1', 'STRING_LITERAL_LONG2', 'INTEGER_POSITIVE', 'DECIMAL_POSITIVE', 'DOUBLE_POSITIVE', 'INTEGER_NEGATIVE', 'DECIMAL_NEGATIVE', 'DOUBLE_NEGATIVE', 'PNAME_LN', got '*'
That means it doesn’t consider property paths inside the anonymous blank node construct.
Indeed, the equivalent query with a named blank node works as expected:
PREFIX pizza: <http://www.co-ode.org/ontologies/pizza/pizza.owl#>
SELECT DISTINCT ?pizza
WHERE
{ ?pizza owl:equivalentClass _:b0 .
_:b0 rdf:type owl:Class ;
owl:intersectionOf _:b1 .
_:b1 (rdf:rest)*/rdf:first ?otherClass
}