2

I am trying to write a SPARQL query on dbpedia.com to find cultural and historical locations nearby given coordinates. I found this example which finds things within 20 km of New York.

    SELECT DISTINCT ?resource ?label ?location 
WHERE 
  { 
    <http://dbpedia.org/resource/New_York_City> geo:geometry ?sourcegeo . 
    ?resource geo:geometry ?location ; 
                                 rdfs:label ?label . 
    FILTER( bif:st_intersects( ?location, ?sourcegeo, 20 ) ) . 
    FILTER( lang( ?label ) = "en" ) 
  }

I would like to write a query that will list all the cultural and historical places based on distance I write in query, in this example 20km. How am I suppose to do this?

outbeyond
  • 35
  • 7
  • To change the distance, change the number 20 in the filter. To change the location, change the dbr:New_York_City URI to another location with geo:geometry or provide your own ?sourcegeo – Paul Brown May 09 '18 at 22:25
  • Thank you for the answer but that is not the question I have asked. – outbeyond May 10 '18 at 08:39
  • Then I do not understand the question. Can you elaborate? – Paul Brown May 10 '18 at 08:40
  • Add something like `?resource dct:subject/skos:broader{1,8} dbc:Tourist_attractions ` to your query. – Stanislav Kralin May 10 '18 at 09:35
  • 1
    Or try [this query](https://pastebin.com/K4d6bVBH) on [Wikidata](https://query.wikidata.org/). The main problem with your qestion that this is unclear what are historical and cultural places... – Stanislav Kralin May 10 '18 at 09:45

0 Answers0