Capitals of the world

Wikimedia sparql query service allows to display geolocated data onto a map

Map of capitals is here.

Capitals are retrieved dynamically from Wikidata query service from Wikimedia by the following SPARQL query: https://bit.ly/37fFUZ2

SELECT DISTINCT ?capital ?capitalLabel ?countryLabel ?population ?location WHERE {
?country wdt:P31 wd:Q3624078.
FILTER NOT EXISTS {?country wdt:P31 wd:Q3024240}
FILTER NOT EXISTS {?country wdt:P31 wd:Q28171280}
?country wdt:P36 ?capital.
?capital wdt:P17 ?country.
?capital wdt:P625 ?location.
?capital wdt:P1082 ?population.
SERVICE wikibase:label { bd:serviceParam wikibase:language “‘+userLang+’,en” }
} ORDER BY DESC(?population)

Leave a Reply