Dear jena users,
I tried to replicate the negation examples from https://www.w3.org/TR/sparql11-query/#idp899488 (section 8.3.3 Examples: Inner FILTERs). I got [(a, 1), (b, 3.0)] for both versions of the query whereas I expected to get only [(b, 3.0)] with the FILTER NOT EXISTS.

Same result with jena-3.17
Rdflib returns the same results as the W3C page.

Am I missing something?
Thank you
olivier


DATA:
-----
@prefix : <http://example.com/> .

:a :p :v1 .
:a :q :v1 .
:a :q :v2 .

:b :p :v3 .
:b :q :v4 .
:b :q :v5 .



QUERY 1 (expected: [(b, 3.0)] ; returned: [(a, 1), (b, 3.0)]):
--------------------------------------------------------------
PREFIX : <http://example.com/>

SELECT *
WHERE {
  ?x :p ?n .
  FILTER NOT EXISTS {
    ?x :q ?m .
    FILTER(?n = ?m)
  }
}


QUERY 2 (correctly returned [(a, 1), (b, 3.0)]):
------------------------------------------------
PREFIX : <http://example.com/>

SELECT *
WHERE {
  ?x :p ?n .
  MINUS {
    ?x :q ?m .
    FILTER(?n = ?m)
  }
}

Reply via email to