query-6aff62a420852e7d287504509d6a29af
All towns in a country
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# defaultView:Map
SELECT ?item ?itemLabel ?itemDescription ?instance ?instanceLabel ?geolocatie ?type ?typeLabel ?municipality ?municipalityLabel ?city ?cityLabel ?locatie ?locatieLabel ?layer ?article WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en". }
?item wdt:P131 ?municipality;
wikibase:sitelinks ?layer;
wdt:P17 wd:Q31.
?municipality wdt:P131 ?city;
wdt:P31 wd:Q2785216, ?type.
OPTIONAL {
?article schema:about ?item;
schema:inLanguage "nl";
schema:isPartOf <https://nl.wikipedia.org/>.
}
OPTIONAL { ?item wdt:P31 ?instance. }
OPTIONAL { ?item wdt:P276 ?locatie. }
OPTIONAL { ?item wdt:P625 ?geolocatie. }
}
ORDER BY (?itemLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?article"):::projected
v5("?city"):::projected
v10("?geolocatie"):::projected
v8("?instance"):::projected
v2("?item"):::projected
v1("?itemLabel"):::projected
v4("?layer"):::projected
v9("?locatie"):::projected
v3("?municipality"):::projected
v6("?type"):::projected
c8(["wd:Q31"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,nl,fr,de,en"]):::literal
c2(["bd:serviceParam"]):::iri
c15([https://nl.wikipedia.org/]):::iri
c13(["nl"]):::literal
c10(["wd:Q2785216"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v2 --"wdt:P131"--> v3
v2 --"wikibase:sitelinks"--> v4
v2 --"wdt:P17"--> c8
v3 --"wdt:P131"--> v5
v3 --"wdt:P31"--> c10
v3 --"wdt:P31"--> v6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v7 -."schema:about".-> v2
v7 --"schema:inLanguage"--> c13
v7 --"schema:isPartOf"--> c15
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P31".-> v8
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P276".-> v9
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P625".-> v10
end