query-696e134dacd5c2a5b6b04ed311d85f25

rq turtle/ttl

Subway modelling on adjacent station (P197)Hello, thanks for the great work! May I raise some questions ? Have you got any thoughts on some oddities close to some stations in the map? if you go only with the #does not work wdt:P81 wd:Q834482;, the maps shows very bizarre, but looks OK when working with wdt:P81 wd:Q617574; . Any guess?

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide":["?coords", "?line","?rgb"]}
SELECT ?station ?stationLabel ?coords ?line ?layer ?rgb (SAMPLE(?image) AS ?image) (SAMPLE(?opening) AS ?opening) WHERE {
  ?station wdt:P31 wd:Q928830;
   #does not work wdt:P81 wd:Q834482;
          wdt:P81 wd:Q617574;
    wdt:P625 ?coords;
    wdt:P81 ?subwayLine;
    wdt:P197 ?pred.
  OPTIONAL { ?station wdt:P18 ?image. }
  OPTIONAL { ?station wdt:P1619 ?opening. }
  ?pred wdt:P625 ?cds;
    wdt:P31 wd:Q928830.
  BIND(IF((xsd:double(?depth / 10 )) = (xsd:integer(?depth / 10 )), ?cds, "") AS ?coords)
  ?pred (p:P625/psv:P625/wikibase:geoLatitude) ?lat1;
    (p:P625/psv:P625/wikibase:geoLongitude) ?lon1.
  ?station (p:P625/psv:P625/wikibase:geoLatitude) ?lat2;
    (p:P625/psv:P625/wikibase:geoLongitude) ?lon2.
  BIND(CONCAT("LINESTRING(", STR(?lon1), " ", STR(?lat1), ",", STR(?lon2), " ", STR(?lat2), ")") AS ?str)
  BIND(STRDT(?str, geo:wktLiteral) AS ?line)
  ?subwayLine wdt:P465 ?rgb.
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?subwayLine rdfs:label ?layer.
    ?station rdfs:label ?stationLabel.
  }
}
GROUP BY ?station ?stationLabel ?coords ?line ?layer ?rgb

Query found at