Query 0 - Find_Closest_Populated_Place:
PREFIX dataset:
PREFIX geof:
PREFIX geo:
PREFIX opengis:
PREFIX geonames:
SELECT ?f (geof:distance(?cGeoWKT, "GIVEN_POINT_IN_WKT"^^geo:wktLiteral, opengis:metre) as ?distance)
WHERE {
GRAPH dataset:geonames {
?f geonames:featureCode geonames:P.PPL.
?f geonames:hasGeometry ?cGeo.
?cGeo geonames:asWKT ?cGeoWKT.
}
}
ORDER BY ASC(?distance)
LIMIT 1
Query 1 - Find_Closest_Motorway:
PREFIX dataset:
PREFIX geof:
PREFIX geo:
PREFIX opengis:
PREFIX rdf:
PREFIX lgd:
SELECT ?c ?type ?label (geof:distance(?cGeoWKT, "GIVEN_POINT_IN_WKT"^^geo:wktLiteral, opengis:metre) as ?distance) ?cGeoWKT
WHERE {
GRAPH dataset:lgd {
?c rdf:type lgd:Motorway.
?c rdfs:label ?label.
?c lgd:hasGeometry ?cGeo.
?cGeo lgd:asWKT ?cGeoWKT.
}
}
ORDER BY ASC(?distance)
LIMIT 1