query-1339bb933bd22fd1f895876c559f886a

rq turtle/ttl

Items with "instance of" = "geographical object" by country SELECT ?country ?countryLabel (count(?item) as ?count) WHERE { ?item wdt:P17 ?country . ?item wdt:P31 wd:Q618123 . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } GROUP by ?country ?countryLabel ORDER BY DESC(?count)

Use at

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#>
#Items with "instance of" = "geographical object" by country
SELECT ?country ?countryLabel (count(?item) as ?count)
WHERE {
 ?item wdt:P17 ?country . 
 ?item wdt:P31 wd:Q618123 .
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP by ?country ?countryLabel
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?count") v3("?country"):::projected v2("?item"):::projected c5(["bd:serviceParam"]):::iri c3(["wd:Q618123"]):::iri c7(["en"]):::literal v2 --"wdt:P17"--> v3 v2 --"wdt:P31"--> c3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind1[/"count(?item)"/] v2 --o bind1 bind1 --as--o v4