Menu

#91 Error for correct property path query with disjunction and transitivity

v6.1.3
open
nobody
None
5
2015-09-24
2015-09-24
S. Bischof
No

Virtuoso can not evaluate transitive property path expressions together with disjunction. A simple example is <x> :a|b <y>

When evaluating the following (syntactically correct) SPARQL query, Virtuoso answers with this error message:

Virtuoso 37000 Error SP031: SPARQL compiler: Variable '_::trans_subj_10_1' is used in subexpressions of the query but not assigned

SPARQL query (essentially any combination of transitivity with disjunction (either UNION or | in a path expression):

prefix : http://dbpedia.org/resource
prefix foaf: http://xmlns.com/foaf/0.1/
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#

select * where {
{ :Vienna (rdfs:subClassOf/rdf:type) ?Y }
UNION
{ :Vienna ?P [] . ?P (rdfs:domain/rdfs:subClassOf
) ?Y }
} LIMIT 100****

For verification see also dbpedia: http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=prefix+%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%3E%0D%0Aprefix+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0A%0D%0A%0D%0Aselect++where+{%0D%0A{+%3AVienna+%28rdfs%3AsubClassOf%2Frdf%3Atype%29+%3FY+}%0D%0AUNION%0D%0A{+%3AVienna+%3FP+[]+.+%3FP+%28rdfs%3Adomain%2Frdfs%3AsubClassOf*%29+%3FY+}%0D%0A}+LIMIT+100&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on

Discussion


Log in to post a comment.