query-c10a47f756552ee54038a175b1c3152c
: you can speed up the query and avoid the timeout by reversing the property path like thisWikidata:SPARQL query service/query optimization#Inverse property pathsThe query is correct, but runs slowly. Using a technique described at Cito: Ismael Olea Wikidata:SPARQL query service/query optimization#Inverse property paths
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?item WHERE {
?item wdt:P131* wd:Q81802.
wd:Q271669 ^wdt:P279*/^wdt:P31 ?item.
}
Query found at
- https://www.wikidata.org/wiki/User:Olea/Ejemplos_de_consultas_WDQS
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2021/12
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
a1((" "))
c4(["wd:Q271669"]):::iri
c2(["wd:Q81802"]):::iri
v1 --"wdt:P131"--> c2
a1 --"wdt:P279"--> c4
v1 --"wdt:P31"--> a1