Project:SPARQL/examples: Difference between revisions

From biodiversity citizen science
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
}
}
}}
}}
</syntaxhighlight>
== Observations within 5 km from Antwerp ==
<syntaxhighlight>
#defaultView:Map
SELECT ?place ?placeLabel ?location
WHERE
{
  # Berlin coordinates
  wd:Q64 wdt:P625 ?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" .
  }
}
</syntaxhighlight>
</syntaxhighlight>

Revision as of 13:15, 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
SELECT ?place ?placeLabel ?location
WHERE
{
  # Berlin coordinates
  wd:Q64 wdt:P625 ?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" .
  } 
}