semagrow / semagrow

A SPARQL query federator of heterogeneous data sources

Home Page:https://semagrow.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filter Not Exists Queries

antru6 opened this issue · comments

The planner does not handle queries that make use of the FILTER NOT EXISTS construct.
An example of such a query is the following:

PREFIX lucas: <http://deg.iit.demokritos.gr/lucas/>
PREFIX lucas_r: <http://deg.iit.demokritos.gr/lucas/resource/>
PREFIX invekos: <http://deg.iit.demokritos.gr/invekos/>
PREFIX lictm: <http://deg.iit.demokritos.gr/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX opengis: <http://www.opengis.net/def/uom/OGC/1.0/>

SELECT * WHERE {
  lucas_r:1 lucas:hasLC1 ?lc1 .
  FILTER NOT EXISTS {
    lucas_r:1 geo:hasGeometry ?l_geom_id .
    ?l_geom_id geo:asWKT ?l_geom .
    ?inv invekos:hasCropTypeNumber ?i_ctype .
    ?inv geo:hasGeometry ?i_geom_id .
    ?i_geom_id geo:asWKT ?i_geom .
    FILTER (geof:distance(?l_geom,?i_geom,opengis:metre) < 10) .
  }
}