I'm no expert on Jena's GeoSPARQL support, but our docs:

https://jena.apache.org/documentation/query/spatial-query.html

don't mention any such namespaces as http://www.opengis.net/rdf/functions#. 
Where did you see it documented that Jena supports such functions?

I only see a small and specific set of functions:

https://jena.apache.org/documentation/query/spatial-query.html#property-function-library

but you could certainly use Jena's extension mechanisms to do this kind of 
calculation:

https://jena.apache.org/documentation/query/writing_propfuncs.html

although it's not trivial to do that. Perhaps a committer with more knowledge 
about jena-spatial can help here.

ajs6f

> On Aug 24, 2018, at 5:47 AM, Markus Neumann <mneum...@meteomatics.com> wrote:
> 
> Hi,
> 
> I'm quite new to both Fuseki and mailinglists, so please be patient with me.
> 
> I've managed to set up a Fuseki 2 server together with a Lucene spatial index.
> E.g the following query works as expected:
> 
> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
> PREFIX geosparql: <http://www.opengis.net/ont/geosparql#>
> PREFIX mm: <http://rdf.meteomatics.com/mm/>
> PREFIX spatial: <http://jena.apache.org/spatial#>
> SELECT *
> WHERE {
>  ?loc spatial:nearby (47.5 8.5 5 'km') .
>  ?loc a mm:Location;
>       geo:lat ?lat;
>       geo:long ?long;
>       geosparql:asWKT ?wkt;
>       mm:station_name ?name.
> }
> 
> Now I would like to run the following:
> 
> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
> PREFIX geosparql: <http://www.opengis.net/ont/geosparql#>
> PREFIX mm: <http://rdf.meteomatics.com/mm/>
> PREFIX spatial: <http://jena.apache.org/spatial#>
> PREFIX ogcf: <http://www.opengis.net/rdf/functions#>
> SELECT ?distance WHERE {
>  BIND(mm-locations:8515451 as ?wil)
>  ?wil spatial:nearby(?lat ?lon 8 'km') .
>  ?wil geosparql:asWKT ?wil_wkt .
>  ?loc a mm:Location;
>       geo:lat ?lat;
>       geo:long ?lon;
>       geosparql:asWKT ?wkt.
>  BIND( ogcf:distance(?wil_wkt, ?wkt, 'km') as ?distance)
> } 
> 
> The query completes and gets the correct amount of results, but all wihout 
> value.
> In the log pops up this message:
> 
> [2018-08-24 09:45:33] exec       WARN  URI 
> <http://www.opengis.net/rdf/functions#distance> has no registered function 
> factory
> 
> Is there a way to get this to work? Or is there another way to compute 
> spatial distances?
> 
> Many thanks for your time.
> 
> Best regards
> Markus
> 

Reply via email to