From 70e63572e3a132a6ac74824e9d80ab91b0c0ef86 Mon Sep 17 00:00:00 2001 From: james anderson Date: Fri, 2 May 2025 12:34:03 +0200 Subject: [PATCH] simple exists changes --- input/SPARQL 1.1 Query Language.html | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/input/SPARQL 1.1 Query Language.html b/input/SPARQL 1.1 Query Language.html index d86cca5..680a81e 100644 --- a/input/SPARQL 1.1 Query Language.html +++ b/input/SPARQL 1.1 Query Language.html @@ -2264,14 +2264,20 @@
17.4.1.4 NOT EXISTS query evaluation. No additional binding of variables occurs. The NOT EXISTS form translates into fn:not(EXISTS{...}).

 xsd:boolean  NOT EXISTS { pattern }

Returns false if pattern matches. Returns true otherwise.

NOT EXISTS { pattern } is equivalent to fn:not(EXISTS { pattern }).

 xsd:boolean  EXISTS { pattern }

Returns true if pattern matches. - Returns false otherwise.

Variables in the pattern that are bound in the current + Returns false otherwise.

+

+ Variables in the pattern pattern that are not bound in the current + solution mapping take part in pattern matching. + Variables in the pattern that are bound in the current - solution mapping take the value that they have from the solution mapping. - Variables in the pattern pattern that are not bound in the current - solution mapping take part in pattern matching.

To facilitate this, we introduce a function Exists + solution mapping take the value that they have from the solution mapping. + This value, whether a literal, an iri, or a blank node, + can constrain both pattern matching and operands in select claus expressions. +

To facilitate this, we introduce a function Exists that evaluates a SPARQL Algebra expression and returns true or false, depending on whether there are any solutions to the pattern, given the solution mapping - being tested by the filter operation.

+ being tested by the filter operation.

+
17.4.1.5 logical-or
 xsd:boolean  xsd:boolean left || xsd:boolean right

Returns a logical OR of left and right. Note that logical-or operates on the effective boolean value of its arguments.

Note: see section 17.2, Filter Evaluation, for the || operator's treatment of errors.

17.4.1.6 logical-and
 xsd:boolean  xsd:boolean left && xsd:boolean right

Returns a logical AND of left and right. Note that logical-and operates on the effective boolean value of its arguments.

Note: see section 17.2, Filter Evaluation, for @@ -3598,7 +3604,8 @@

18.6 Evaluation Seman

substitute(pattern, μ) = the pattern formed by replacing every occurrence of a variable v in pattern by μ(v) for each v in dom(μ)

Definition: Evaluation of Exists

Let μ be the current solution mapping for a filter and P a graph pattern:

- The value exists(P), given D(G) is true if and only if eval(D(G), substitute(P, μ)) is a non-empty sequence. + The value exists(P), given D(G) is true if and only if eval(D(G), substitute(P, μ)) is a non-empty sequence. + In the evaluation, blank node do not contribute to RDF instance mapping of statement patterns, but instead act as contants to contrain the match.
Definition: Evaluation of Join
eval(D(G), Join(P1, P2)) = Join(eval(D(G), P1), eval(D(G), P2))
Definition: Evaluation of LeftJoin
eval(D(G), LeftJoin(P1, P2, F)) = LeftJoin(eval(D(G), P1), eval(D(G), P2), F)
Definition: Evaluation of Union
eval(D(G), Union(P1,P2)) = Union(eval(D(G), P1), eval(D(G), P2))
Definition: Evaluation of Graph
if IRI is a graph name in D
 eval(D(G), Graph(IRI,P)) = eval(D(D[IRI]), P)
if IRI is not a graph name in D
 eval(D(G), Graph(IRI,P)) = the empty multiset
eval(D(G), Graph(var,P)) =
@@ -4160,4 +4167,4 @@ 

A.2 Other R
  • An expanded set of functions and operators
  • - \ No newline at end of file +