query-eebdc4d2f721498e9b94e4766a404793
Propertiescountry of citizenship (P27)instance of (P31)
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?objectLabel (COUNT(?item) as ?count ) WHERE {
?item wdt:P27 wd:Q31.
?item p:P31 ?instance.
?instance ps:P31 ?object.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]" }
}
GROUP BY ?objectLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?count")
v3("?instance")
v2("?item"):::projected
v4("?object")
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;"]):::literal
c2(["wd:Q31"]):::iri
v2 --"p:direct/P27"--> c2
v2 --"p:P31"--> v3
v3 --"p:statement/P31"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind1[/"count(?item)"/]
v2 --o bind1
bind1 --as--o v5