Skip to content

Commit 8f80ed1

Browse files
committed
SPARQL logical-not
1 parent 5ed3156 commit 8f80ed1

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

sparql-ns.ttl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ sparql:less-than-or-equal rdf:type sparql:Function ;
7979
rdfs:isDefinedBy <http://www.w3.org/TR/sparql12-query/> ;
8080
.
8181

82-
sparql:logical-not rdf:type sparql:Functional ;
83-
rdfs:comment "This form computes the logical NOT of a boolean expression." ;
84-
rdfs:isDefinedBy <http://www.w3.org/TR/sparql12-query/#func-logical-and> ;
85-
.
86-
8782
# Section: Functional Forms
8883

8984
sparql:bound rdf:type sparql:FunctionalForm ;
@@ -121,6 +116,11 @@ sparql:logical-and rdf:type sparql:FunctionalForm ;
121116
rdfs:isDefinedBy <http://www.w3.org/TR/sparql12-query/#func-logical-and> ;
122117
.
123118

119+
sparql:logical-not rdf:type sparql:FunctionalForm ;
120+
rdfs:comment "This form computes the logical NOT of a boolean expression." ;
121+
rdfs:isDefinedBy <http://www.w3.org/TR/sparql12-query/#func-logical-not> ;
122+
.
123+
124124
sparql:in rdf:type sparql:FunctionalForm ;
125125
rdfs:comment "This form checks whether a given value matches any value from a list of expressions." ;
126126
rdfs:isDefinedBy <http://www.w3.org/TR/sparql12-query/#func-in> ;

spec/index.html

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4709,8 +4709,10 @@ <h3>Filter Evaluation</h3>
47094709
<a href="#func-bound">BOUND</a>, <a href="#func-coalesce">COALESCE</a>,
47104710
<a href="#func-if">IF</a>, <a href="#func-in">IN</a>, <a href="#func-not-in">NOT IN</a>,
47114711
<a href="#func-logical-or">logical-or</a> (<code>||</code>),
4712-
<a href="#func-logical-and">logical-and</a> (<code>&amp;&</code>),
4713-
<a href="#func-filter-not-exists">NOT EXISTS</a>, and <a href="#func-filter-exists">EXISTS</a>,
4712+
<a href="#func-logical-and">logical-and</a> (<code>&amp;&amp</code>),
4713+
<a href="#func-logical-not">logical-not</a> (<code>!</code>),
4714+
<a href="#func-filter-not-exists">NOT EXISTS</a>,
4715+
and <a href="#func-filter-exists">EXISTS</a>,
47144716
all functions operate on RDF Terms and will produce a type error if any
47154717
arguments are unbound.
47164718
</li>
@@ -4820,9 +4822,9 @@ <h4>Invocation</h4>
48204822
<section id="ebv">
48214823
<h4>Effective Boolean Value (EBV)</h4>
48224824
<p>Effective boolean value is used to calculate the arguments to the logical functions
4823-
<a href="#func-logical-and">logical-and</a>, <a href="#func-logical-or">logical-or</a>, and
4824-
<a data-cite="XPATH-FUNCTIONS-31#func-not">fn:not</a>, as well as evaluate the result of a
4825-
<code>FILTER</code> expression.</p>
4825+
<a href="#func-logical-and">logical-and</a>, <a href="#func-logical-or">logical-or</a>,
4826+
and <a href="#func-logical-not">logical-not</a>,
4827+
as well as evaluate the result of a <code>FILTER</code> expression.</p>
48264828
<p>The XQuery <a data-cite="XQUERY-31#id-ebv">Effective Boolean Value</a> rules rely on the
48274829
definition of XPath's <a data-cite="XPATH-FUNCTIONS-31#func-boolean">fn:boolean</a>. The following
48284830
rules reflect the rules for <code>fn:boolean</code> applied to the argument types present
@@ -4905,7 +4907,7 @@ <h3>Operator Mapping</h3>
49054907
xsd:boolean <a href="#ebv-arg">(EBV)</a>
49064908
</td>
49074909
<td class="xpathOp">
4908-
<a data-cite="XPATH-FUNCTIONS-31#func-not">fn:not</a>(A)
4910+
<a href="#func-logical-not" class="SPARQLoperator">logical-not</a>(A)
49094911
</td>
49104912
<td>xsd:boolean</td>
49114913
</tr>
@@ -5609,7 +5611,7 @@ <h5>logical-or</h5>
56095611
The purpose of this function is to define the semantics of the "<code>||</code>" operator.</p>
56105612
<p>The function returns a logical <code>OR</code> of <code>left</code> and <code>right</code>.
56115613
Note that <span class="SPARQLoperator">logical-or</span> operates on the
5612-
<a href="#ebv">effective boolean value</a> of its arguments.</p>
5614+
<a href="#ebv">effective boolean value</a> of each of its arguments.</p>
56135615
<p>Note: see section 17.2, <a href="#evaluation">Filter Evaluation</a>, for the
56145616
<code>||</code> operator's treatment of errors.</p>
56155617
</section>
@@ -5618,12 +5620,25 @@ <h5>logical-and</h5>
56185620
<pre class="prototype nohighlight">
56195621
<span class="return">xsd:boolean</span> <span class="operator" style="text-transform: none;">logical-and</span> (<span class="type">xsd:boolean</span> <span class="name">left</span>, <span class="type">xsd:boolean</span> <span class="name">right</span>)
56205622
</pre>
5621-
<p>This function cannot be used directly in expressions. The purpose of this function is to define the semantics of the "<code>&amp;&amp;</code>" operator.</p>
5623+
<p>This function cannot be used directly in expressions.
5624+
The purpose of this function is to define the semantics of the "<code>&amp;&amp;</code>" operator.</p>
56225625
<p>The function returns a logical <code>AND</code> of <code>left</code> and <code>right</code>.
56235626
Note that <span class="SPARQLoperator">logical-and</span> operates on the
5624-
<a href="#ebv">effective boolean value</a> of its arguments.</p>
5627+
<a href="#ebv">effective boolean value</a> of each of its arguments.</p>
56255628
<p>Note: see section 17.2, <a href="#evaluation">Filter Evaluation</a>, for the
5626-
<code>&amp;&</code> operator's treatment of errors.</p>
5629+
<code>&amp;&amp;</code> operator's treatment of errors.</p>
5630+
</section>
5631+
<section id="func-logical-not">
5632+
<h5>logical-not</h5>
5633+
<pre class="prototype nohighlight">
5634+
<span class="return">xsd:boolean</span> <span class="operator" style="text-transform: none;">logical-not</span> (<span class="type">xsd:boolean</span> <span class="name">arg</span>)
5635+
</pre>
5636+
<p>This function cannot be used directly in expressions. The purpose of this
5637+
function is to define the semantics of the "<code>!</code>" operator.</p>
5638+
<p>The function returns a logical <code>NOT</code> of <code>arg</code>.
5639+
Note that <span class="SPARQLoperator">logical-not</span> operates on the
5640+
<a href="#ebv">effective boolean value</a> of its argument.
5641+
</p>
56275642
</section>
56285643
<section id="func-in">
56295644
<h5>IN</h5>
@@ -10835,7 +10850,7 @@ <h3>White Space</h3>
1083510850
<p><code>?a&lt;?b&amp;&amp;?c&gt;?d</code></p>
1083610851
</blockquote>
1083710852
<p>is the token sequence variable '<code>?a</code>', an IRI
10838-
'<code>&lt;?b&amp;&amp;?c&gt;</code>', and variable '<code>?d</code>', not a expression
10853+
'<code>&lt;?b&amp;&amp;?c&gt;</code>', and variable '<code>?d</code>', not an expression
1083910854
involving the operator '<code>&amp;&</code>' connecting two expression using
1084010855
'<code>&lt;</code>' (less than) and '<code>&gt;</code>' (greater than).</p>
1084110856
</section>

0 commit comments

Comments
 (0)