Re: indication of intended meaning for EXISTS from SPARQL specifications

[I'm extracting one part of the dicussion in this response.]


On 02/11/2018 11:00 AM, Andy Seaborne wrote:
> Peter,
> [...]
>
> The quotes below have additional context:
>
> On 09/02/18 14:11, Peter F. Patel-Schneider wrote:
> [...]
>> I checked the specification for both the SPARQL 1.0 Query Language [10] and
>> the SPARQL 1.1 Query Language [11].  From both of these documents,
>>
>> "One may test that a graph pattern is not expressed by specifying an OPTIONAL
>> graph pattern that introduces a variable and testing whether the variable is
>> not bound."
>>
>> This matches up directly with the stated intent of EXISTS from [11]
>>
>> "The NOT EXISTS filter expression tests whether a graph pattern does not match
>> the dataset"
>
> The rest of the sentence says:
>
> """
> given the values of variables in the group graph pattern in which the filter
> occurs.
> """
>
> which is where the replacement-substitution comes from (yes, it has some
> issues as identified by the CG).


You seem to think that the added "given the values of variables in the group
graph pattern in which the filter occurs" in Section 8.1.1 of [11] leads
towards the replacement-substitution interpretation of NOT EXISTS in SPARQL
1.1.  I view this addition as undercutting the replacement-substitution
interpretation.

Here is the full wording of the beginning of that section, which is the
introduction of NOT EXISTS in the specification:


8.1.1 Testing For the Absence of a Pattern

The NOT EXISTS filter expression tests whether a graph pattern does not
match the dataset, given the values of variables in the group graph pattern
in which the filter occurs. It does not generate any additional bindings.


So, given values for some variables (those in the enclosing group graph
pattern), the described meaning of NOT EXISTS is to test whether a graph
pattern (its argument) does not match the dataset.  That is, NOT EXISTS
determines whether "a graph pattern" matches the dataset.  Note that this is
not "some version of the graph pattern with variables replaced by bindings"
but just the "graph pattern" itself.  Note further, that "match" is used
extensively in the document to mean the usual SPARQL processing of graph
patterns.

The way that SPARQL utilizes contextual variable bindings when matching a
graph pattern is to determine the bindings that result from the graph
pattern and join these bindings to the contextual bindings.

The underlying problem with the formal definition of EXISTS in SPARQL 1.1 is
that it doesn't work this way, instead first performing a transformation
unlike the processing in any other part of SPARQL.  This transformation has
many problems, including creating constructs whose meaning is undefined and
other behaviour that is counter to the introductory description of NOT
EXISTS in the specification.




> [...]
>
>     Andy
>
>> peter
>>
>>
>> [1] SPARQL with Qualitative and Quantitative Preferences.  Marina Gueroussova,
>> Axel Polleres, and Sheila A. McIlraith.  Proceedings of the 2nd International
>> Work- shop on Ordering and Reasoning (OrdRing 2013), at ISWC 2013, Sydney,
>> Australia, 22 October 2013. CEUR Workshop Proceedings, vol. 1059 (2013).
>>
>> [10] SPARQL 1.0 Query Language
>> https://www.w3.org/TR/rdf-sparql-query/
>>
>> [11] SPARQL 1.1 Query Language specification
>> https://www.w3.org/TR/sparql11-query/
>>
>>
>

Received on Monday, 12 February 2018 15:19:51 UTC