@@ -8781,16 +8781,27 @@ <h4>Variable Scope</h4>
8781
8781
<td><code>VALUES varlist { values }</code></td>
8782
8782
<td><code>v</code> is in-scope if <code>v</code> is in <code>varlist</code></td>
8783
8783
</tr>
8784
+ <tr>
8785
+ <td>`EXISTS` and `NOT EXISTS` filters</td>
8786
+ <td>
8787
+ <code>v</code> is in-scope if it is in-scope for the
8788
+ <a href="#defn_sparqlSolutionMapping">solution mapping</a>
8789
+ where the `FILTER` containing `EXISTS` or `NOT EXISTS` is applied.
8790
+ </td>
8791
+ </tr>
8784
8792
</tbody>
8785
8793
</table>
8786
- <p>The variable <code>v</code> must not be in-scope at the point of the <code>(expr AS
8787
- v)</code> form. The scoping for <code>(expr AS v)</code> applies immediately in
8788
- <code>SELECT</code> expressions.</p>
8794
+ <p>The variable <code>v</code> must not be in-scope at the point of the
8795
+ <code>(expr AS v)</code> form. The scoping for <code>(expr AS v)</code>
8796
+ applies immediately in <code>SELECT</code> expressions.
8797
+ </p>
8789
8798
<p>In <code>BIND (expr AS v)</code> requires that the variable <code>v</code> is not
8790
- in-scope from the preceeding elements in the group graph pattern in which it is used.</p>
8799
+ in-scope from the preceeding elements in the group graph pattern in which it is used.
8800
+ </p>
8791
8801
<p>In <code>SELECT</code>, the variable <code>v</code> must not be in-scope in the graph
8792
8802
pattern of the <code>SELECT</code> clause, nor used in another select expression earlier in
8793
- the clause.</p>
8803
+ the clause.
8804
+ </p>
8794
8805
</section>
8795
8806
<section id="convertGraphPattern">
8796
8807
<h4>Converting Graph Patterns</h4>
@@ -9078,7 +9089,6 @@ <h5>Translate Graph Patterns</h5>
9078
9089
<p>If the form is <code><a href="#rGroupGraphPattern">GroupGraphPattern</a></code>:</p>
9079
9090
</blockquote>
9080
9091
<pre class="code nohighlight">
9081
- Let FS := the empty set
9082
9092
Let <var>G</var> := the empty pattern, a basic graph pattern which is the empty set.
9083
9093
9084
9094
For each element <var>E</var> in the sequence of elements in the GroupGraphPattern
@@ -11150,52 +11160,95 @@ <h3>Grammar</h3>
11150
11160
section 6 <a data-cite="xml11#sec-notation">Notation</a>.</p>
11151
11161
<p>Notes:</p>
11152
11162
<ol>
11153
- <li>Keywords are matched in a case-insensitive manner with the exception of
11163
+ <li>
11164
+ Keywords are matched in a case-insensitive manner with the exception of
11154
11165
the keyword '<code>a</code>' which, in line with Turtle and N3, is used
11155
11166
in place of the IRI <code>rdf:type</code>
11156
- (in full, <code><a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">http://www.w3.org/1999/02/22-rdf-syntax-ns#type</a></code>).</li>
11157
- <li>Escape sequences are case sensitive.</li>
11158
- <li>When tokenizing the input and choosing grammar rules, the longest match is chosen.</li>
11159
- <li>The SPARQL grammar is LL(1) when the rules with uppercased names are used as terminals.</li>
11160
- <li>There are two entry points into the grammar: <code>QueryUnit</code> for the SPARQL query language
11161
- and <code>UpdateUnit</code> for the SPARQL update language.</li>
11162
- <li>In signed numbers, no white space is allowed between the sign and the number.
11167
+ (in full, <code><a
11168
+ href="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">http://www.w3.org/1999/02/22-rdf-syntax-ns#type</a></code>).
11169
+ </li>
11170
+ <li>
11171
+ Escape sequences are case sensitive.
11172
+ </li>
11173
+ <li>
11174
+ When tokenizing the input and choosing grammar rules, the longest match is chosen.
11175
+ </li>
11176
+ <li>
11177
+ The SPARQL grammar is LL(1) when the rules with uppercased names are used as terminals.
11178
+ </li>
11179
+ <li>
11180
+ There are two entry points into the grammar: <code>QueryUnit</code> for the SPARQL query language
11181
+ and <code>UpdateUnit</code> for the SPARQL update language.
11182
+ </li>
11183
+ <li>
11184
+ In signed numbers, no white space is allowed between the sign and the number.
11163
11185
The <code><a href="#rAdditiveExpression">AdditiveExpression</a></code> grammar rule allows for this by
11164
11186
covering the two cases of an expression followed by a signed number. These
11165
- produce an addition or subtraction of the unsigned number as appropriate.</li>
11166
- <li>The tokens <code><a href="#rInsertData">INSERT DATA</a></code>,
11187
+ produce an addition or subtraction of the unsigned number as appropriate.
11188
+ </li>
11189
+ <li>
11190
+ The tokens <code><a href="#rInsertData">INSERT DATA</a></code>,
11167
11191
<code><a href="#rDeleteData">DELETE DATA</a></code> and
11168
11192
<code><a href="#rDeleteWhere">DELETE WHERE</a></code> allow any amount of white space between the words.
11169
- The single space version is used in the grammar for clarity.</li>
11170
- <li>The <code><a href="#rQuadData">QuadData</a></code> and
11193
+ The single space version is used in the grammar for clarity.
11194
+ </li>
11195
+ <li>
11196
+ The <code><a href="#rQuadData">QuadData</a></code> and
11171
11197
<code><a href="#rQuadPattern">QuadPattern</a></code>
11172
11198
rules both use rule <code><a href="#rQuads">Quads</a></code>. The rule
11173
11199
<code><a href="#rQuadData">QuadData</a></code>, used in
11174
11200
<a href="#rInsertData"><code>INSERTDATA</code></a> and
11175
11201
<a href="#rDeleteData"><code>DELETE DATA</code></a>,
11176
- must not allow variables in the quad patterns.</li>
11177
- <li>Blank node syntax is not allowed in <code><a href="#rDeleteWhere">DELETE WHERE</a></code>,
11202
+ must not allow variables in the quad patterns.
11203
+ </li>
11204
+ <li>
11205
+ Blank node syntax is not allowed in <code><a href="#rDeleteWhere">DELETE WHERE</a></code>,
11178
11206
the <code><a href="#rDeleteClause">DeleteClause</a></code> for
11179
11207
<code>DELETE</code>,
11180
- nor in <code><a href="#rDeleteData">DELETE DATA</a></code>.</li>
11181
- <li>Rules for limiting the use of blank node identifiers are given in <a href="#grammarBNodes">section 19.6</a>.</li>
11182
- <li>The number of variables in the variable list of <code>VALUES</code> block
11183
- must be the same as the number of each list of associated values in the <code>DataBlock</code>.</li>
11184
- <li>Variables introduced by <code>AS</code> in a <code>SELECT</code> clause
11185
- must not already be <a href="#variableScope">in-scope</a>.</li>
11186
- <li>The variable assigned in a <code>BIND</code> clause must not be already
11208
+ nor in <code><a href="#rDeleteData">DELETE DATA</a></code>.
11209
+ </li>
11210
+ <li>
11211
+ Rules for limiting the use of blank node identifiers are given in
11212
+ <a href="#grammarBNodes">section 19.6</a>.
11213
+ </li>
11214
+ <li>
11215
+ The number of variables in the variable list of <code>VALUES</code> block
11216
+ must be the same as the number of each list of associated values in
11217
+ the <code>DataBlock</code>.
11218
+ </li>
11219
+ <li>
11220
+ Variables introduced by <code>AS</code> in a <code>SELECT</code> clause
11221
+ must not already be <a href="#variableScope">in-scope</a>.
11222
+ </li>
11223
+ <li>
11224
+ The variable assigned in a <code>BIND</code> clause must not be already
11187
11225
in-use within the immediately preceding <code><a href="#rTriplesBlock">TriplesBlock</a></code> within a
11188
- <code><a href="#rGroupGraphPattern">GroupGraphPattern</a></code>.</li>
11189
- <li>Aggregate functions can be one of the
11226
+ <code><a href="#rGroupGraphPattern">GroupGraphPattern</a></code>.
11227
+ </li>
11228
+ <li>
11229
+ Any variable that is assigned to in the graph pattern of `EXISTS` or `NOT EXISTS`
11230
+ must not be <a href="#variableScope">in-scope</a>. This applies to `BIND`,
11231
+ variables introduced by `AS` in a `SELECT` clause,
11232
+ variables introduced by `AS` in `GROUP BY`,
11233
+ and variables in a `VALUES` clause.
11234
+ </li>
11235
+ <li>
11236
+ Aggregate functions can be one of the
11190
11237
<a href="#rAggregate">built-in keywords for aggregates</a>
11191
11238
or a custom aggregate, which is syntactically a <a href="#rFunctionCall">function
11192
11239
call</a>. Aggregate functions may only be used in
11193
11240
<a href="#rSelectClause">SELECT</a>, <a href="#rHavingClause">HAVING</a>
11194
- and <a href="#rOrderClause">ORDER BY</a> clauses.</li>
11195
- <li>The expression argument of an aggregate function can not contain an aggregate function.</li>
11196
- <li>Only custom aggregate functions use the <code>DISTINCT</code> keyword
11197
- in a <a href="#rFunctionCall">function call</a>.</li>
11198
- <li>A <a href="#rReifier">reifier</a> or
11241
+ and <a href="#rOrderClause">ORDER BY</a> clauses.
11242
+ </li>
11243
+ <li>
11244
+ The expression argument of an aggregate function can not contain an aggregate function.
11245
+ </li>
11246
+ <li>
11247
+ Only custom aggregate functions use the <code>DISTINCT</code> keyword
11248
+ in a <a href="#rFunctionCall">function call</a>.
11249
+ </li>
11250
+ <li>
11251
+ A <a href="#rReifier">reifier</a> or
11199
11252
<a href="#rAnnotationBlockPath">annotation syntax</a>
11200
11253
is only permitted after a triple when the property position is
11201
11254
a simple path (an IRI, the keyword <code>a</code>, or a variable),
0 commit comments