Since the recent upgrade of the DBPedia SPARQL endpoint, I am having problems with queries that always had worked before. Here are two examples:
- fetching the ancestor concepts of
http://dbpedia.org/ontology/Organisation
- this creates an error as seen below
Virtuoso 37000 Error SP031: SPARQL compiler: The name ?_:anon_7_32 is used in multiple clauses, without any logical connection
SPARQL query:
#output-format:text/html
define sql:signal-unconnected-variables 1
define sql:signal-void-variables 1
define input:default-graph-uri <http://dbpedia.org>
SELECT DISTINCT ?lc ?subj
WHERE { { { { <http://dbpedia.org/ontology/Organisation> <http://www.w3.org/2000/01/rdf-schema#subClassOf>+ ?subj . } UNION { <http://dbpedia.org/ontology/Organisation> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>/<http://www.w3.org/2000/01/rdf-schema#subClassOf>* ?subj . }
FILTER EXISTS { { ?subj <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Class> . } UNION { [ ] <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?subj . } UNION { ?subj <http://www.w3.org/2000/01/rdf-schema#subClassOf> [ ] . } } } }
OPTIONAL { ?pLabel <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.w3.org/2000/01/rdf-schema#label> . }
OPTIONAL { { ?subj ?pLabel ?lc .
FILTER ( LANGMATCHES( LANG( ?lc ), "" ) ) } UNION { ?subj ?pLabel ?lc .
FILTER ( LANGMATCHES( LANG( ?lc ), "en" ) ) } } }
LIMIT 2000
- fetching all root concepts - this query either times (when trying via simple HTTP GET) out or does not return any results (when trying using the DBPedia SPARQL web UI)
SELECT DISTINCT ?lc ?subj
FROM <http://dbpedia.org>
WHERE { { { { { { ?subj <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Class> . } UNION { [ ] <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?subj . }
FILTER NOT EXISTS { { ?subj <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?otherSubclass .
FILTER ( ?subj != ?otherSubclass ) } } } }
FILTER EXISTS { { ?subj <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Class> . } UNION { [ ] <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?subj . } UNION { ?subj <http://www.w3.org/2000/01/rdf-schema#subClassOf> [ ] . } } } }
OPTIONAL { ?pLabel <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.w3.org/2000/01/rdf-schema#label> . }
OPTIONAL { { ?subj ?pLabel ?lc .
FILTER ( LANGMATCHES( LANG( ?lc ), "" ) ) } UNION { ?subj ?pLabel ?lc .
FILTER ( LANGMATCHES( LANG( ?lc ), "en" ) ) } } }
LIMIT 2000
Considering that the queries worked before, could these now be failing due to new bugs in the Virtuoso (in particular the first query), due to configuration issues (maybe caching configuration for the second query) or due to structural changes in the ontology? Any ideas how the queries need to be changed so that they work again?