GeoSPARQL is implemented in slightly different ways by different triple stores. The example below uses Virtuoso. (If you want to try this out yourself you can send me your RDF and I will upload it into a Virtuoso triple store for you.)
The following query filters based on whether two geometries
intersect or not. The
100.0 number denotes the
proximity in number of kilometers. Geometries that lie within
this proximity from each other are considered to intersect as
The query also calculates the exact distance between two points.
Notice that the query gives two results: (pointA,pointB) and
(pointB,pointA). We do not get back the less useful results
(pointA,pointA) and (pointB,pointB) becaus of the
!= filter. If you do not want
symmetric results, you can use
When you encounter a SPARQL endpoint, it is often not clear what you can query for within that endpoint. Use the follow queries to figure this out. These queries run over the Biocaddie dataset.
This document is a Data Story: a simple HTML file + SPARQL queries. If you also want to create such a Data Story, you can take a look at the Data Stories repository.