query-bd086e0d96c0539c507a3a15f268d94b
Was playing around some more today. Here's the railway map for one municipality in Norway.
Use at
- https://query.wikidata.org/sparql
prefix osmt: <https://www.openstreetmap.org/wiki/Key:>
prefix osmm: <https://www.openstreetmap.org/meta/>
prefix osm: <https://www.openstreetmap.org/>
prefix osmrel: <https://www.openstreetmap.org/relation/>
prefix osmway: <https://www.openstreetmap.org/way/>
prefix osmnode: <https://www.openstreetmap.org/node/>
prefix geo: <http://www.opengis.net/ont/geosparql#>
prefix ogc: <http://www.opengis.net/rdf#>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
select ?s ?railway ?geo where {
?s osmt:railway ?railway .
filter(?railway = "rail")
?s rdf:type osm:way .
?s geo:hasGeometry ?geo .
# ?s ?p ?o .
osmrel:10143487 ogc:sfContains ?s .
}
# limit 1000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?geo"):::projected
v1("?railway"):::projected
v2("?s"):::projected
c6([https://www.openstreetmap.org/relation/10143487]):::iri
c4([https://www.openstreetmap.org/way]):::iri
f0[["?railway = 'rail'"]]
f0 --> v1
v2 --https://www.openstreetmap.org/wiki/Key:railway--> v1
v2 --"a"--> c4
v2 --"geo:hasGeometry"--> v3
c6 --http://www.opengis.net/rdf#sfContains--> v2