query-fbe58744badfa59b4e2f8821869f869c
TODO
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?opened
WHERE
{
{?item wdt:P31 wd:Q928830 . } # it's a metro station
UNION
{?item wdt:P31 wd:Q1793804 .} # or an S-bahn station
?item wdt:P361 wd:Q99654 # part of the S-bahn
OPTIONAL { ?item wdt:P1619 ?opened . } # it may have an opening date
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v2("?opened"):::projected
c2(["wd:Q928830"]):::iri
c5(["wd:Q99654"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,de"]):::literal
c8(["bd:serviceParam"]):::iri
c3(["wd:Q1793804"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c2
end
union0r <== or ==> union0l
end
v1 --"wdt:P361"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P1619".-> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end