1

I am testing RDF4J on spatial queries. I have deployed the RDF4J Server and Workbench apps on Appache Tomcat 9.0.12. My current dataset has 853 LineStrings and 88 Polygons represented asWKT fields. But the performance of query varied from type of repository i am working with. Following is the SPARQL query.

PREFIX cpmeta1: <http://meta.icos-cp.eu/ontologies/cpmeta/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX sf: <http://www.opengis.net/ont/sf#> 
PREFIX uom: <http://www.opengis.net/def/uom/OGC/1.0/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>

SELECT (count(distinct ?obj1) as ?C) 
WHERE {
       ?obj1 a geo:Feature;
             geo:hasGeometry ?geom1.
       ?geom1 a sf:LineString;
              geo:asWKT ?coord1. 
       ?obj2 a geo:Feature; 
              geo:hasGeometry ?geom2. 
       ?geom2 a sf:Polygon; 
              geo:asWKT ?coord2. 
       FILTER(geof:sfWithin(?coord1,?coord2)) 
       }

The query runs fine and the result returns 567 as the count of linestring objects that are within any polygon.

The problem is with the time it takes to return the result. If the repository is of type simple Memory or Native then this query execution time is between 10 to 40 seconds in different iterations. However if the repository was created with Lucene, then the execution time of this query exceeds 30 minutes.

From the documentation of RD4J i gather that with lucene there is supposed to be a spatial index for asWKT fields, therefore i was expecting the spatial join to run in less time with Lucene. But on the contrary it seems that with lucene, the same query performance is deteriorated exponentially.

I tested the same scenario from both: the workbench aap as well as from API in an eclipse project. In both cases the query performance degrades too much when Lucene is involved.

Can anyone advise me what i am missing here ??

Best Regards

AMIR RAZA
  • 11
  • 1
  • Can you file a report at https://github.com/eclipse/rdf4j/issues ? Please include details of your configuration, as well as (if possible) a sample dataset and the above query so we can try and reproduce the problem. – Jeen Broekstra Oct 31 '18 at 22:25
  • Issue reported as https://github.com/eclipse/rdf4j/issues/1160 – Jeen Broekstra Nov 19 '18 at 23:22

0 Answers0