Geospatial
Regions & Areas
Query by administrative regions, countries, or custom geographic areas. Use Wikidata's hierarchical location data for precise geographic filtering.
Administrative Hierarchy Properties
Wikidata uses hierarchical properties to describe where entities are located.
The key property is wdt:P131 (located in administrative territorial entity).
| Property | ID | Description |
|---|---|---|
| located in | wdt:P131 |
Administrative territorial entity |
| country | wdt:P17 |
Country of location |
| continent | wdt:P30 |
Continent |
Query by Country
Universities in Germany
#defaultView:Map
SELECT ?uni ?uniLabel ?coord ?city ?cityLabel
WHERE {
?uni wdt:P31/wdt:P279* wd:Q3918 ; # university
wdt:P17 wd:Q183 ; # country: Germany
wdt:P625 ?coord .
OPTIONAL { ?uni wdt:P131 ?city . }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en,de" .
}
}
Hierarchical Location Query
Use property paths with wdt:P131* to traverse the administrative hierarchy.
This finds entities at any level within a region.
All Museums in California (Any Administrative Level)
#defaultView:Map
SELECT ?museum ?museumLabel ?coord
WHERE {
?museum wdt:P31/wdt:P279* wd:Q33506 ; # museum
wdt:P131* wd:Q99 ; # in California (recursive)
wdt:P625 ?coord .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
LIMIT 200
Cultural Heritage by Region
Archaeological Sites in Greece
#defaultView:Map
SELECT ?site ?siteLabel ?coord
?period ?periodLabel
WHERE {
?site wdt:P31 wd:Q839954 ; # archaeological site
wdt:P17 wd:Q41 ; # Greece
wdt:P625 ?coord .
OPTIONAL { ?site wdt:P2348 ?period . }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en,el" .
}
}
Historic Buildings in Paris
#defaultView:Map
SELECT ?building ?buildingLabel ?coord
(YEAR(?inception) AS ?built)
WHERE {
?building wdt:P31/wdt:P279* wd:Q41176 ; # building
wdt:P131* wd:Q90 ; # in Paris
wdt:P625 ?coord ;
wdt:P1435 ?heritage . # has heritage status
OPTIONAL { ?building wdt:P571 ?inception . }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en,fr" .
}
}
ORDER BY ?built
LIMIT 200
Urban Infrastructure by Region
Metro Stations by City
SELECT ?city ?cityLabel (COUNT(?station) AS ?stationCount)
WHERE {
?station wdt:P31 wd:Q928830 ; # metro station
wdt:P131 ?city .
?city wdt:P31/wdt:P279* wd:Q515 . # city
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
GROUP BY ?city ?cityLabel
ORDER BY DESC(?stationCount)
LIMIT 30
Query by Continent
Capitals in Africa
#defaultView:Map
SELECT ?capital ?capitalLabel ?country ?countryLabel ?coord
WHERE {
?country wdt:P31 wd:Q6256 ; # country
wdt:P30 wd:Q15 ; # continent: Africa
wdt:P36 ?capital . # capital
?capital wdt:P625 ?coord .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}