query-eae01953ddbc7d7bb9b83e0eb8000c0a
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 ?item ?itemLabel ?country ?countryLabel ?count
WHERE
{
?item wdt:P31 wd:Q3918 .
?item wdt:P17 ?country .
OPTIONAL {?item wdt:P2196 ?count . }
filter not exists {?item wdt:P17 wd:Q16 . }
filter not exists {?item wdt:P17 wd:Q30 . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?count"):::projected
v2("?country"):::projected
v1("?item"):::projected
c3(["wd:Q16"]):::iri
c8(["bd:serviceParam"]):::iri
c2(["wd:Q30"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c5(["wd:Q3918"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P17"--> e0c2
e0v1("?item"):::projected
e0c2(["wd:Q30"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"wdt:P17"--> c2
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"wdt:P17"--> e1c2
e1v1("?item"):::projected
e1c2(["wd:Q16"]):::iri
end
f1--EXISTS--> f1e1
f1 --> v1
f1 --> c1
f1 --> c3
v1 --"wdt:P17"--> c3
v1 --"wdt:P31"--> c5
v1 --"wdt:P17"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P2196".-> v3
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end