I am trying to retrieve data from linkedgeodata.org/sparql
Prefix lgdo: <http://linkedgeodata.org/ontology/>
Select *
From <http://linkedgeodata.org>
{
?s a lgdo:Restaurant .
?s rdfs:label ?l .
?s geo:geometry ?g .
Filter(bif:st_intersects (?g, bif:st_point (48.143889, 17.109722), 5.1)) .
}
But response is empty. I want to retrieve restaurants in Bratislava....5km from coordinates.
I used similar sparql code like in the example, I changed only class to restaurant and coordinates of the city, so I dont know where I am doing mistake.(http://linkedgeodata.org/OnlineAccess/SparqlEndpoints?v=bpg)
Prefix lgdo: <http://linkedgeodata.org/ontology/>
Select *
From <http://linkedgeodata.org>
{
?s a lgdo:Amenity .
?s rdfs:label ?l .
?s geo:geometry ?g .
Filter(bif:st_intersects (?g, bif:st_point (12.372966, 51.310228), 0.1)) .
}
You can see all types of things that fall within those coordinates by running the following query:
Prefix lgdo: <http://linkedgeodata.org/ontology/>
Select ?type, count(?s)
From <http://linkedgeodata.org>
{
?s a ?type .
?s rdfs:label ?l .
?s geo:geometry ?g .
Filter(bif:st_intersects (?g, bif:st_point (48.143889, 17.109722), 5.1)) .
} GROUP BY ?type
This query, using GROUP BY
and COUNT
, gives you counts for all different types
. As you can see there are no restaurants falling in geographical area. Your query is not wrong, the database does not contain any restaurants for the given coordinates.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With