Project:SPARQL/examples: Difference between revisions

From biodiversity citizen science
Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:


#defaultView:Map
#defaultView:Map
PREFIX wbt: <http://biodiversity.wiki.opencura.com/prop/direct/>
SELECT ?place ?placeLabel ?location
SELECT ?place ?placeLabel ?location
WHERE
WHERE
{
{
   # Berlin coordinates
   # Berlin coordinates
   wd:Q64 wdt:P625 ?berlinLoc .
   ?location wbt:P8 ?berlinLoc .
   SERVICE wikibase:around {
   SERVICE wikibase:around {
     ?observation wbt:P8 ?location .
     ?observation wbt:P8 ?location .

Revision as of 13:17, 17 December 2019

Observations and their locations

#defaultView:Map
PREFIX wbt: <http://biodiversity.wiki.opencura.com/prop/direct/>
 
SELECT * WHERE {
   ?s wbt:P8 ?o .
}
}}

Observations within 5 km from Antwerp

#defaultView:Map
PREFIX wbt: <http://biodiversity.wiki.opencura.com/prop/direct/>
SELECT ?place ?placeLabel ?location
WHERE
{
  # Berlin coordinates
  ?location wbt:P8 ?berlinLoc .
  SERVICE wikibase:around {
    ?observation wbt:P8 ?location .
    bd:serviceParam wikibase:center ?berlinLoc .
    bd:serviceParam wikibase:radius "10" .
  } .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
  } 
}