LOSM: Linked Open Street Map beta version

A new service to query OpenstreetMap
through a clear Sparql endpoint.

5

simple points to achieve

simple points to achieve

  1. Query data with SPARQL and LinkedGeoData
  2. Include the full updated OpenStreetMap Dataset
  3. An update every 15 minutes
  4. Create queries with Jena spatial and WKT literals
  5. Online translation from SPARQL to Overpass Turbo
Some queries you can execute with LOSM Sparql endpoint

#Obtain OSM URI, latitude and longitude of nodes named "London"
SELECT ?link ?lat ?lon
WHERE  {  
   ?link rdfs:label "London" .  
   ?link geo:lat ?lat .
   ?link geo:long ?lon.

}

 #Obtain OSM URI and name of nodes in the nearby of the city center of London (limit expressed in meters)  
SELECT ?object ?name 
WHERE  {  
   ?link rdfs:label "London" .  
   ?link geo:lat ?lat .
   ?link geo:long ?lon.

   ?object spatial:nearby(?lat ?lon 100 'm') . 

   ?object rdfs:label ?name. 
}

 #Obtain OSM URI and name of nodes in the nearby of the city center of London (limit expressed in kilometers)  
SELECT ?object ?name 
WHERE  {  
   ?link rdfs:label "London" .  
   ?link geo:lat ?lat .
   ?link geo:long ?lon.

   ?object spatial:nearby(?lat ?lon 100 'mi') . 

   ?object rdfs:label ?name. 
}

#Obtain OSM URI and name of nodes in the nearby of the city center of London (limit expressed in miles)  
SELECT ?object ?name 
WHERE  {  
   ?link rdfs:label "London" .  
   ?link geo:lat ?lat .
   ?link geo:long ?lon.

   ?object spatial:nearby(?lat ?lon 100 'km') . 

   ?object rdfs:label ?name. 
}

#Results filtering by LinkedGeoData classes corresponding to Open Street Map tags 
SELECT ?object ?name 
WHERE  {  
   ?link rdfs:label "London" .  
   ?link geo:lat ?lat .
   ?link geo:long ?lon.

   ?object spatial:nearby(?lat ?lon 100 'm') . 

   ?object a lgdo:DrinkingWater. 
}

#Results filtering by LinkedGeoData classes and properties 
SELECT ?object ?name 
WHERE  {  
   ?link rdfs:label "London" .  
   ?link geo:lat ?lat .
   ?link geo:long ?lon.

   ?object spatial:nearby(?lat ?lon 100 'm') . 

   ?object lgdo:HighwayThing lgdo:BusStop. 
}


 #Results filtering by LinkedGeoData classes corresponding to Open Street Map keys 
SELECT ?object ?name 
WHERE  {  
   ?link rdfs:label "London" .  
   ?link geo:lat ?lat .
   ?link geo:long ?lon.

   ?object spatial:nearby(?lat ?lon 100 'm') . 

   ?object a lgdo:Amenity. 
}


 #Connected elements
SELECT ?object ?name 
WHERE  {  
   ?link rdfs:label "Bari" .  
   ?link geo:lat ?lat .
   ?link geo:long ?lon.

   ?object spatial:nearby(?lat ?lon 1000 'm') . 

   ?object a lgdo:DrinkingWater . 
   ?object geo:lat ?lat2 .
   ?object geo:long ?lon2.
   
   ?cinema spatial:nearby(?lat2 ?lon2 200 'm') . 

   ?cinema a lgdo:Cinema .
}

#Using  spatial:withinCircle
SELECT ?object ?name 
WHERE  {  
   ?link rdfs:label "London" .  
   ?link geo:lat ?lat .
   ?link geo:long ?lon.

   ?object spatial:withinCircle(?lat ?lon 100 'm') . 

   ?object a lgdo:Amenity. 
}


 #Using  spatial:withinBox
SELECT ?object ?name 
WHERE  {  

   ?object spatial:withinBox(50.746 7.157 50.748 7.154) . 

   ?object rdfs:label ?name .   
}


#Using spatial:within together with a WKT (POLYGON in this case)
SELECT ?object ?name 
WHERE  {  
?object spatial:within("POLYGON((50.746 7.157,50.746 7.154,50.748 7.154,50.748 7.157))") .
?object rdfs:label ?name
}