query-2786ed1d62c72a32edb11a4ec918cf67
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#Map of “railway things” in Berlin, as classified by LinkedGeoData.org
#defaultView:Map
PREFIX lgdo: <http://linkedgeodata.org/ontology/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX geom: <http://geovocab.org/geometry#>
PREFIX bif: <bif:>
SELECT ?railwayThing ?geometry (SAMPLE(?label) AS ?label) ?layer WHERE {
SERVICE <http://linkedgeodata.org/sparql> {
?railwayThing a lgdo:RailwayThing;
geom:geometry [ geo:asWKT ?geometry ].
FILTER(bif:st_intersects(?geometry, bif:st_point(13.383333, 52.516667), 0.1))
OPTIONAL { ?railwayThing rdfs:label ?label. }
OPTIONAL { ?railwayThing a lgdo:Subway. BIND("subway"@en AS ?subway) }
OPTIONAL { ?railwayThing a lgdo:Rail. BIND("rail"@en AS ?rail) }
OPTIONAL { ?railwayThing a lgdo:LightRail. BIND("light rail"@en AS ?lightrail) }
OPTIONAL { ?railwayThing a lgdo:Tramway. BIND("tramway"@en AS ?tramway) }
OPTIONAL { ?railwayThing a lgdo:Platform. BIND("platform"@en AS ?platform) }
OPTIONAL { ?railwayThing a lgdo:AbandonedRailway. BIND("abandoned railway"@en AS ?abandoned) }
OPTIONAL { ?railwayThing a lgdo:HistoricThing. BIND("historic"@en AS ?historic) }
}
BIND(COALESCE(?subway, ?lightrail, ?rail, ?tramway, ?platform, ?abandoned, ?historic, "other"@en) AS ?layer)
}
GROUP BY ?railwayThing ?geometry ?layer
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?abandoned")
v1("?geometry"):::projected
v10("?historic")
v12("?label"):::projected
v11("?layer"):::projected
v6("?lightrail")
v8("?platform")
v5("?rail")
v2("?railwayThing"):::projected
v4("?subway")
v7("?tramway")
a1((" "))
c10([http://linkedgeodata.org/ontology/Subway]):::iri
c16([http://linkedgeodata.org/ontology/HistoricThing]):::iri
c6([http://linkedgeodata.org/ontology/RailwayThing]):::iri
c14([http://linkedgeodata.org/ontology/Platform]):::iri
c13([http://linkedgeodata.org/ontology/Tramway]):::iri
c11([http://linkedgeodata.org/ontology/Rail]):::iri
c15([http://linkedgeodata.org/ontology/AbandonedRailway]):::iri
c12([http://linkedgeodata.org/ontology/LightRail]):::iri
subgraph s1["http://linkedgeodata.org/sparql"]
style s1 stroke-width:4px;
f0[["bif:st_intersects(?geometry,bif:st_point('13.383333^^xsd:decimal','52.516667^^xsd:decimal'),'0.1^^xsd:decimal')"]]
f0 --> v1
v2 --"a"--> c6
a1 --"geo:asWKT"--> v1
v2 --http://geovocab.org/geometry#geometry--> a1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."rdfs:label".-> v12
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."a".-> c10
bind1[/"ssubway^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>'"/]
bind1 --as--o v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."a".-> c11
bind2[/"srail^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>'"/]
bind2 --as--o v5
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."a".-> c12
bind3[/"slight rail^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>'"/]
bind3 --as--o v6
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."a".-> c13
bind4[/"stramway^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>'"/]
bind4 --as--o v7
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v2 -."a".-> c14
bind5[/"splatform^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>'"/]
bind5 --as--o v8
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v2 -."a".-> c15
bind6[/"sabandoned railway^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>'"/]
bind6 --as--o v9
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v2 -."a".-> c16
bind7[/"shistoric^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>'"/]
bind7 --as--o v10
end
end
bind8[/"?subway?lightrail?rail?tramway?platform?abandoned?historicsother^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>'"/]
v4 --o bind8
v6 --o bind8
v5 --o bind8
v7 --o bind8
v8 --o bind8
v9 --o bind8
v10 --o bind8
bind8 --as--o v11
bind10[/"sample(?label)"/]
v12 --o bind10
bind10 --as--o v12