query-b57a4dae65338e2fd3295c8257f1a1ae
The inner query runs fast, in less than half a second:
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item WHERE {
?item wdt:P31/wdt:P279* wd:Q171634 .
?item wdt:P17 wd:Q145 .
?item wdt:P131 ?adm .
} GROUP BY ?item
HAVING (COUNT(?adm) = 2)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?_anon_42b5416610844a34809f33a099ae9de156185")
v2("?adm")
v1("?item"):::projected
a2((" "))
a1((" "))
c4(["wd:Q171634"]):::iri
c6(["wd:Q145"]):::iri
f0[[" = '2^^xsd:integer'"]]
f0 --> a1
v1 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c4
v1 --"wdt:P17"--> c6
v1 --"wdt:P131"--> v2
bind2[/"count(?adm)"/]
v2 --o bind2
bind2 --as--o v3