query-7b1a36d606a83566922fa54fe1b55cf8
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?pop
WHERE
{
?item wdt:P31/wdt:P279* wd:Q5153359.
minus {?item2 wdt:P9559 [].
{?item2 wdt:P131* ?item . }
UNION
{?item2 wdt:P159/wdt:P131* ?item . } }
OPTIONAL {?item wdt:P1082 ?pop . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by desc(?pop)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v3("?item2")
v1("?pop"):::projected
a2((" "))
a1((" "))
a3((" "))
c3(["wd:Q5153359"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P9559"--> a2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P159"--> a3
a3 --"wdt:P131"--> v2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P131"--> v2
end
union0r <== or ==> union0l
end
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1082".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end