query-839f7bb2027546ece4377e242e4c75a8
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 ?countryLabel ?haspic ?count WHERE {
{
SELECT ?country ("Σ" AS ?haspic) (COUNT(DISTINCT ?item) AS ?count) WHERE {
?item wdt:P31 wd:Q1362233;
wdt:P17 ?country;
}
GROUP BY ?country
}
UNION
{
SELECT ?country ("s obrázkem / whit picture" AS ?haspic) (COUNT(DISTINCT ?item) AS ?count) WHERE {
?item wdt:P31 wd:Q1362233;
wdt:P17 ?country;
wdt:P18 _:b1.
}
GROUP BY ?country
}
UNION
{
SELECT ?country ("bez obrázku / whitout picture" AS ?haspic) (COUNT(DISTINCT ?item) AS ?count) WHERE {
?item wdt:P31 wd:Q1362233;
wdt:P17 ?country.
MINUS { ?item wdt:P18 _:b3. }
}
GROUP BY ?country
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "cs". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?count"):::projected
v2("?country")
v5("?haspic"):::projected
v1("?item")
a1((" "))
a2((" "))
c8(["cs"]):::literal
c6(["bd:serviceParam"]):::iri
c2(["wd:Q1362233"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c2
v1 --"wdt:P17"--> v2
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P18"--> a2
end
bind2[/"'bez obrázku / whitout picture'"/]
bind2 --as--o v5
bind3[/"count(?item)"/]
v1 --o bind3
bind3 --as--o v5
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c2
v1 --"wdt:P17"--> v2
v1 --"wdt:P18"--> a1
bind5[/"'s obrázkem / whit picture'"/]
bind5 --as--o v5
bind6[/"count(?item)"/]
v1 --o bind6
bind6 --as--o v5
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c2
v1 --"wdt:P17"--> v2
bind8[/"'Σ'"/]
bind8 --as--o v5
bind9[/"count(?item)"/]
v1 --o bind9
bind9 --as--o v5
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end