query-9a43d564b6af4208da4ca7ab994f441a

rq turtle/ttl

Original railways in ScotlandWorking on basic view of history, but lacks many of the company-station links which would allow geographical and timelayer mapping

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT DISTINCT (?railcoyLabel AS ?layer) ?railcoy ?railstatLabel ?statloc ?railstat  WHERE { 
  {?railcoy wdt:P31 wd:Q17102188.}.
  FILTER (?railcoy = wd:Q18208626).
  OPTIONAL  {?railcoy wdt:P1619 ?rcoystart.}
  OPTIONAL  {?railcoy wdt:P3999 ?rcoyfinish.}
  ?railstat wdt:P137 ?railcoy.
  ?railstat wdt:P625 ?statloc.
  optional { ?railcoy rdfs:label ?railcoyLabel. FILTER(LANG(?railcoyLabel) = "en").}
  optional { ?railstat rdfs:label ?railstatLabel. FILTER(LANG(?railstatLabel) = "en").}
  #SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

}
ORDER BY ?railcoyLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?layer") v3("?railcoy"):::projected v1("?railcoyLabel"):::projected v6("?railstat"):::projected v2("?railstatLabel"):::projected v5("?rcoyfinish") v4("?rcoystart") v7("?statloc"):::projected c4(["wd:Q17102188"]):::iri f0[["?railcoy = 'wd:Q18208626'"]] f0 --> v3 v3 --"wdt:P31"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P1619".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P3999".-> v5 end v6 --"wdt:P137"--> v3 v6 --"wdt:P625"--> v7 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."rdfs:label".-> v1 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v6 -."rdfs:label".-> v2 end bind1[/"?railcoyLabel"/] v1 --o bind1 bind1 --as--o v8