query-26aa20c0c42678d0cdab02c3bd5a0b77
19:10, 27 January 2018 (UTC) Andy's edits; Talk to Andy); Pigsonthewing (Andy Mabbett-- 20:18, 27 January 2018 (UTC)) talk (Andrew Gray: Okay, all running now. Report below to confirm when they're all done... Pigsonthewing@
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 distinct ?train_station ?train_stationLabel ?station_code_old ?station_code_new WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?train_station wdt:P31 wd:Q55488.
?train_station wdt:P17 wd:Q145.
{?train_station wdt:P296 ?station_code_old} UNION { ?train_station wdt:P4755 ?station_code_new }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?station_code_new"):::projected
v2("?station_code_old"):::projected
v1("?train_station"):::projected
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q55488"]):::iri
c8(["wd:Q145"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"wdt:P31"--> c6
v1 --"wdt:P17"--> c8
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P4755"--> v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P296"--> v2
end
union0r <== or ==> union0l
end