Project:SPARQL/examples: Difference between revisions

No edit summary
Line 10: Line 10:
</syntaxhighlight>
</syntaxhighlight>


== Observations within 5 km from Antwerp ==
== Observations within 100 km from San Francisco ==
<syntaxhighlight>
<syntaxhighlight>


#defaultView:Map
#defaultView:Map
PREFIX wbt: <http://biodiversity.wiki.opencura.com/prop/direct/>
PREFIX wbt: <http://biodiversity.wiki.opencura.com/prop/direct/>
SELECT ?place ?placeLabel ?location
SELECT ?utrechtLocation
WHERE
WHERE
{
{
   # Berlin coordinates
   SERVICE <https://query.wikidata.org/sparql> {
  ?location wbt:P8 ?berlinLoc .
    wd:Q62 wdt:P625 ?utrechtLocation .
  }
  # Utrecht coordinates
 
   SERVICE wikibase:around {
   SERVICE wikibase:around {
    ?observation wbt:P8 ?location .
    ?observation wbt:P8 ?location .
     bd:serviceParam wikibase:center ?berlinLoc .
     bd:serviceParam wikibase:center ?utrechtLocation .
     bd:serviceParam wikibase:radius "10" .
     bd:serviceParam wikibase:radius "10" .
   } .
   } .
Bots, Bureaucrats, emailconfirmed, Administrators
603,740

edits