query-7fcd02fa199d438087aac1e2bca21653
title:S-Bahnhöfe in Oberbayern SELECT ?page_title ?article ?item (GROUP_CONCAT(?klasse; SEPARATOR = ", ") AS ?ist_ein) ?pq_obj ?verbund (GROUP_CONCAT(DISTINCT ?velabel; SEPARATOR = ", ") AS ?verwaltungseinheiten) ?location WHERE { ?item wdt:P31 wd:Q1793804; (wdt:P131*) wd:Q10562; wdt:P31 ?instance. OPTIONAL { ?item wdt:P625 ?location. } OPTIONAL { ?item wdt:P131 ?ve. } OPTIONAL { ?item p:P31 ?statement. ?statement ps:P31 wd:Q1793804; pq:P642 ?pq_obj. ?pq_qual wikibase:qualifier pq:P642. } OPTIONAL { ?dewiki schema:about ?item; schema:isPartOf https://de.wikipedia.org/; schema:name ?de_title. } OPTIONAL { ?enwiki schema:about ?item; schema:isPartOf https://en.wikipedia.org/; schema:name ?en_title. } BIND(IF(BOUND(?dewiki), ?dewiki, ?enwiki) AS ?article) BIND(IF(BOUND(?de_title), ?de_title, IF(BOUND(?en_title), ?en_title, ?itemName)) AS ?page_title) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en". ?item rdfs:label ?itemName. ?pq_obj rdfs:label ?verbund. ?instance rdfs:label ?klasse. ?ve rdfs:label ?velabel. } } GROUP BY ?page_title ?article ?item ?pq_obj ?verbund ?location
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:S-Bahnhöfe in Oberbayern
SELECT ?page_title ?article ?item (GROUP_CONCAT(?klasse; SEPARATOR = ", ") AS ?ist_ein) ?pq_obj ?verbund (GROUP_CONCAT(DISTINCT ?velabel; SEPARATOR = ", ") AS ?verwaltungseinheiten) ?location WHERE {
?item wdt:P31 wd:Q1793804;
(wdt:P131*) wd:Q10562;
wdt:P31 ?instance.
OPTIONAL { ?item wdt:P625 ?location. }
OPTIONAL { ?item wdt:P131 ?ve. }
OPTIONAL {
?item p:P31 ?statement.
?statement ps:P31 wd:Q1793804;
pq:P642 ?pq_obj.
?pq_qual wikibase:qualifier pq:P642.
}
OPTIONAL {
?dewiki schema:about ?item;
schema:isPartOf <https://de.wikipedia.org/>;
schema:name ?de_title.
}
OPTIONAL {
?enwiki schema:about ?item;
schema:isPartOf <https://en.wikipedia.org/>;
schema:name ?en_title.
}
BIND(IF(BOUND(?dewiki), ?dewiki, ?enwiki) AS ?article)
BIND(IF(BOUND(?de_title), ?de_title, IF(BOUND(?en_title), ?en_title, ?itemName)) AS ?page_title)
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en".
?item rdfs:label ?itemName.
?pq_obj rdfs:label ?verbund.
?instance rdfs:label ?klasse.
?ve rdfs:label ?velabel.
}
}
GROUP BY ?page_title ?article ?item ?pq_obj ?verbund ?location