qlever icon indicating copy to clipboard operation
qlever copied to clipboard

Subquery leads to error

Open joka921 opened this issue 3 years ago • 1 comments

Suspicion 1 : The names of the variables are not correctly propagated Suspicion 2 : I made some really bad error in the query.

PREFIX schema: <http://schema.org/> PREFIX wikibase: <http://wikiba.se/ontology#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX wd: <http://www.wikidata.org/entity/> PREFIX p: <http://www.wikidata.org/prop/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> SELECT ?o WHERE { ?qleverautocomplintermediate <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o . { SELECT ?qleverautocomplintermediate ?horse WHERE { ?horse wdt:P31 ?qleverautocomplintermediate . } } } LIMIT 1

Exception: BAD QUERY (Could not find a suitable execution tree. Likely cause: Queries that require joins of the full index with itself are not supported at the moment.; in /app/src/engine/QueryPlanner.cpp, line 2213, function std::vector > QueryPlanner::fillDpTab(const QueryPlanner::TripleGraph&, const std::vector&, const std::vector >&))

joka921 avatar Oct 12 '20 09:10 joka921

@joka921 Surprisingly, this query still fails after so many years. Here is a simpler variant with the same problem:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?rdftype WHERE {
  ?type rdf:type ?rdftype .
  { SELECT ?type ?subject WHERE { ?subject wdt:P31 ?type } }
}

https://qlever.cs.uni-freiburg.de/wikidata/nAe24n

hannahbast avatar Jun 28 '22 23:06 hannahbast

This has been fixed a while ago

hannahbast avatar May 28 '23 14:05 hannahbast