query-1c5e5234c57a144e02483c63185424c1
Propertiesinstance of (P31)sex or gender (P21)country of citizenship (P27)continent (P30)
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 ?citizenshipLabel (COUNT(DISTINCT ?item) AS ?ccount)
WHERE
{
?item wdt:P31 wd:Q5.
?item wdt:P21 wd:Q6581072.
?item wdt:P27 ?citizenship.
?citizenship wdt:P31 wd:Q6256.
?citizenship wdt:P30 wd:Q15.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?citizenshipLabel ORDER BY DESC(?ccount)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?ccount")
v3("?citizenship")
v2("?item"):::projected
c10(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q6581072"]):::iri
c6(["wd:Q6256"]):::iri
c8(["wd:Q15"]):::iri
v2 --"wdt:P31"--> c2
v2 --"wdt:P21"--> c4
v2 --"wdt:P27"--> v3
v3 --"wdt:P31"--> c6
v3 --"wdt:P30"--> c8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind1[/"count(?item)"/]
v2 --o bind1
bind1 --as--o v4