-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I recently noticed unintuitive behavior when using reverse properties in NegatedPropertySets.
The translation to the SPARQL algebra means that a single NegatedPropertySet that mixes non-reverse and reverse IRI's essentially issues two separate queries.
This query example:
PREFIX : <http://example.org/>
:x0 :p1 :x1 .
:x0 :p2 :x1 .
:x2 :p :x3 .
PREFIX : <http://example.org/>
SELECT * { ?x0 !( :p1 | :p2 ) ?x1 . }
Results in pairs of terms that are not connected through either :p1 or :p2, namely:
:x2, :x3
For this query example:
PREFIX : <http://example.org/>
:x3 :p1 :x2 .
:x2 :p :x3 .
PREFIX : <http://example.org/>
SELECT * { ?x0 !( :p1 | ^:p1 ) ?x1 . }
As a result, I would similarly expect pairs of terms that are not connected either through :p1 or inversely through :p1.
I.e., I wouldn't expect any results here.
Instead, it returns :x2, :x3 and :x3, :x2, which do not meet the above description: :x2, :x3 are inversely connected through :p1, and :x3, :x2 are connected through :p1.
It is clear why: due to its algebra translation, this type of expression essentially issues two queries:
- return all x0's and x1's that are not connected through
:p1(here,:x2, :x3), and - return all x0's and x1's that are not inversely connected through
:p1(here,:x3, :x2).
I am not necessarily advocating to change this behaviour (which may have widespread implications for SPARQL implementations).
But, I am wondering whether others also find this behaviour unintuitive; if so, whether they believe it should be fixed, or a note should be added to the specification.