query-32eb910e67d2b97def528d25a6b2337f
title: München: Stadtbezirke, Stadtteile und Stadtviertel SELECT DISTINCT ?name (GROUP_CONCAT(DISTINCT ?klasse; SEPARATOR = ", ") AS ?istEin) ?orgEinheit ?article (GROUP_CONCAT(DISTINCT ?teil; SEPARATOR=", ") as ?teile) (GROUP_CONCAT(DISTINCT ?partOfLabel; SEPARATOR=", ") as ?teilVon) ?item (GROUP_CONCAT(DISTINCT ?lang; SEPARATOR = ", ") AS ?sprachen) WHERE { VALUES ?klassen { wd:Q253019 wd:Q123705 wd:Q253270 } ?item (wdt:P131*) wd:Q1726; wdt:P31 ?klassen. OPTIONAL { ?item wdt:P131 ?territoryEntity. } OPTIONAL { ?item p:P131 :b15. :b15 pq:P582 ?end. } OPTIONAL { ?item wdt:P361 ?partOf. } OPTIONAL { ?item wdt:P31 ?instanceOf. } OPTIONAL { ?article schema:about ?item; schema:isPartOf https://de.wikipedia.org/; schema:name ?page_title. } OPTIONAL { ?page schema:about ?item; schema:inLanguage ?lang. } FILTER((?lang IN("fr", "de", "tr", "it", "pl", "es", "fi", "en", "pt", "hr", "nl", "ro", "bg", "sv", "da", "lb", "cs", "sk", "sl", "hu", "et", "lv", "lt", "el", "fo", "sr"))|| (!(BOUND(?article)))) FILTER(!(BOUND(?end))) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?territoryEntity rdfs:label ?orgEinheit. ?instanceOf rdfs:label ?klasse. ?item rdfs:label ?name. ?bezirksteil rdfs:label ?teil. ?partOf rdfs:label ?partOfLabel. } } GROUP BY ?item ?name ?orgEinheit ?article ?end ORDER BY (?orgEinheit) (?name)
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: München: Stadtbezirke, Stadtteile und Stadtviertel
SELECT DISTINCT ?name (GROUP_CONCAT(DISTINCT ?klasse; SEPARATOR = ", ") AS ?istEin) ?orgEinheit ?article (GROUP_CONCAT(DISTINCT ?teil; SEPARATOR=", ") as ?teile) (GROUP_CONCAT(DISTINCT ?partOfLabel; SEPARATOR=", ") as ?teilVon) ?item (GROUP_CONCAT(DISTINCT ?lang; SEPARATOR = ", ") AS ?sprachen) WHERE {
VALUES ?klassen {
wd:Q253019
wd:Q123705
wd:Q253270
}
?item (wdt:P131*) wd:Q1726;
wdt:P31 ?klassen.
OPTIONAL { ?item wdt:P131 ?territoryEntity. }
OPTIONAL {
?item p:P131 _:b15.
_:b15 pq:P582 ?end.
}
OPTIONAL { ?item wdt:P361 ?partOf. }
OPTIONAL { ?item wdt:P31 ?instanceOf. }
OPTIONAL {
?article schema:about ?item;
schema:isPartOf <https://de.wikipedia.org/>;
schema:name ?page_title.
}
OPTIONAL {
?page schema:about ?item;
schema:inLanguage ?lang.
}
FILTER((?lang IN("fr", "de", "tr", "it", "pl", "es", "fi", "en", "pt", "hr", "nl", "ro", "bg", "sv", "da", "lb", "cs", "sk", "sl", "hu", "et", "lv", "lt", "el", "fo", "sr"))|| (!(BOUND(?article))))
FILTER(!(BOUND(?end)))
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?territoryEntity rdfs:label ?orgEinheit.
?instanceOf rdfs:label ?klasse.
?item rdfs:label ?name.
?bezirksteil rdfs:label ?teil.
?partOf rdfs:label ?partOfLabel.
}
}
GROUP BY ?item ?name ?orgEinheit ?article ?end
ORDER BY (?orgEinheit) (?name)