Search code examples
sparqldbpediageotagging

Geotagged dbpedia sparql query - want to include abstract in result set


I have the following query which works:

SELECT ?page ?lat ?long (bif:st_distance(?geo, bif:st_point(42.883, -72.8981)))
WHERE{
?m foaf:page ?page.
?m geo:geometry ?geo.
?m geo:lat ?lat.
?m geo:long ?long.
FILTER (bif:st_intersects (?geo, bif:st_point(42.883, -72.8981), 300))
}
ORDER BY ASC 4 LIMIT 5

However I would like to retrieve some info from the results set too, particularly the http://dbpedia.org/ontology/abstract ?abstract content from each of the 5 results above.

Also, is is possible to specify that the above result set is "attraction" or "tourism" tagged? In other words, could the result set only include "tourism" related results for the above area.

I have been playing with: ?txt bif:contains "Tourism" . with no luck.

Any help is appreciated, thanks in advance.


Solution

  • Adding the dbo:abstract property and filtering only for English values (so that you don't get multiple abstracts in different languages for the same entity):

    SELECT ?page ?lat ?long (bif:st_distance(?geo, bif:st_point(42.883, -72.8981))) ?abstract
    WHERE{
      ?m foaf:page ?page.
      ?m geo:geometry ?geo.
      ?m geo:lat ?lat.
      ?m geo:long ?long.
      ?m <http://dbpedia.org/ontology/abstract> ?abstract.
      FILTER (bif:st_intersects (?geo, bif:st_point(42.883, -72.8981), 300))
      FILTER (LANG(?abstract) = "en")
    }
    ORDER BY ASC 4 LIMIT 5
    

    Can't really help with the tagging I'm afraid.