query-ac3d940f99be4b211c9b1171ccece7c1

rq turtle/ttl

TODO

Use at

PREFIX gas: <http://www.bigdata.com/rdf/gas#>
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 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
SELECT ?station ?line (CEIL(?depth/10)*10 as ?layer) {
  SERVICE gas:service {
       gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ; gas:in wd:Q4351569 ; gas:out ?station ; gas:out1 ?depth ; gas:out2 ?pred .
       gas:program gas:linkType wdt:P197 . }
  FILTER(?station != wd:Q4351569)
                      ?pred wdt:P625 ?cds.
                      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 .
  ?station wdt:P17 wd:Q159 .
  BIND(CONCAT('LINESTRING(', STR(?lon1), ' ', STR(?lat1), ',', STR(?lon2), ' ', STR(?lat2), ')') AS ?str) . BIND(STRDT(?str, geo:wktLiteral) AS ?line) 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "ru,en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?cds") v5("?coords") v2("?depth"):::projected v6("?lat1") v8("?lat2") v12("?layer") v11("?line"):::projected v7("?lon1") v9("?lon2") v3("?pred") v1("?station"):::projected v10("?str") a1((" ")) a2((" ")) a3((" ")) a4((" ")) a5((" ")) a6((" ")) a7((" ")) a8((" ")) c3(["gas:program"]):::iri c22(["ru,en"]):::literal c1(["wd:Q4351569"]):::iri c11(["p:direct/P197"]):::iri c18(["wd:Q159"]):::iri c5(["com.bigdata.rdf.graph.analytics.BFS"]):::literal c20(["bd:serviceParam"]):::iri f0[["?station != 'wd:Q4351569'"]] f0 --> v1 subgraph s1["http://www.bigdata.com/rdf/gas#service"] style s1 stroke-width:4px; c3 --"gas:gasClass"--> c5 c3 --"gas:in"--> c1 c3 --"gas:out"--> v1 c3 --"gas:out1"--> v2 c3 --"gas:out2"--> v3 c3 --"gas:linkType"--> c11 end v3 --"p:direct/P625"--> v4 bind1[/"if(http://www.w3.org/2001/XMLSchema#double(?depth / '10^^xsd:integer') = http://www.w3.org/2001/XMLSchema#integer(?depth / '10^^xsd:integer'),?cds,'')"/] v2 --o bind1 v4 --o bind1 bind1 --as--o v5 v3 --"p:P625"--> a1 a1 --"p:statement/value/P625"--> a2 a2 --"wikibase:geoLatitude"--> v6 v3 --"p:P625"--> a3 a3 --"p:statement/value/P625"--> a4 a4 --"wikibase:geoLongitude"--> v7 v1 --"p:P625"--> a5 a5 --"p:statement/value/P625"--> a6 a6 --"wikibase:geoLatitude"--> v8 v1 --"p:P625"--> a7 a7 --"p:statement/value/P625"--> a8 a8 --"wikibase:geoLongitude"--> v9 v1 --"p:direct/P17"--> c18 bind2[/"concat('LINESTRING(',str(?lon1),' ',str(?lat1),',',str(?lon2),' ',str(?lat2),')')"/] v7 --o bind2 v6 --o bind2 v9 --o bind2 v8 --o bind2 bind2 --as--o v10 bind3[/"STRDT(?str,'geo:wktLiteral')"/] v10 --o bind3 bind3 --as--o v11 subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c20 --"wikibase:language"--> c22 end bind4[/"numeric-ceil(?depth / '10^^xsd:integer') * '10^^xsd:integer'"/] v2 --o bind4 bind4 --as--o v12