Skip to content

Commit 03fb4e0

Browse files
committed
Only literal sameValue can be extended
1 parent 133f5cd commit 03fb4e0

File tree

1 file changed

+41
-35
lines changed

1 file changed

+41
-35
lines changed

spec/index.html

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5672,19 +5672,19 @@ <h5>NOT IN</h5>
56725672
<h4>Functions on RDF Terms</h4>
56735673

56745674
<section id="func-sameTerm">
5675-
<h5>SameTerm</h5>
5675+
<h5>sameTerm</h5>
56765676
<pre class="prototype nohighlight"> <span class="return">xsd:boolean</span> <span class="operator">sameTerm</span> (<span class="type"><span class="type RDFterm">RDF term</span></span> <span class="name">term1</span>, <span class="type"><span class="type RDFterm">RDF term</span></span> <span class="name">term2</span>)</pre>
56775677
<p>Returns TRUE if <code>term1</code> and <code>term2</code> are the same RDF term as
56785678
defined in [[[RDF12-CONCEPTS]]] [[RDF12-CONCEPTS]]; returns FALSE otherwise.</p>
56795679
<p>
5680-
|term1| and |term2| are
5681-
<a data-cite="RDF12-CONCEPTS#dfn-rdf-term-equality">equal RDF terms</a>
5680+
|term1| and |term2| are the
5681+
<a data-cite="RDF12-CONCEPTS#dfn-rdf-term-equality">same RDF terms</a>
56825682
if one of the following is true:
56835683
</p>
56845684
<ul>
56855685
<li><code>term1</code> and <code>term2</code> are
5686-
<a data-cite="RDF12-CONCEPTS#iri">IRIs</a> that are
5687-
<a data-cite="RDF12-CONCEPTS#dfn-iri-equality">equal as IRIs</a>.
5686+
<a data-cite="RDF12-CONCEPTS#iri">IRIs</a> that are the
5687+
<a data-cite="RDF12-CONCEPTS#dfn-iri-equality">same as IRIs</a>.
56885688
</li>
56895689
<li><code>term1</code> and <code>term2</code> are
56905690
<a data-cite="RDF12-CONCEPTS#dfn-literal">literals</a> that are
@@ -5729,7 +5729,7 @@ <h5>SameTerm</h5>
57295729
</tr>
57305730
<tr>
57315731
<td><code>sameTerm("abc"@en--rtl, "abc"@en)</code></td>
5732-
<td>true</td>
5732+
<td>false</td>
57335733
</tr>
57345734
<tr>
57355735
<td><code>sameTerm(2, 2.0)</code></td>
@@ -5749,7 +5749,7 @@ <h5>SameTerm</h5>
57495749
</section>
57505750
<section id="func-sameValue">
57515751
<span id="func-RDFterm-equal"><!-- obsolete id --></span>
5752-
<h5>SameValue</h5>
5752+
<h5>sameValue</h5>
57535753
<pre class="prototype nohighlight">
57545754
<span class="return">xsd:boolean</span> <span class="operator" style="text-transform: none;">sameValue</span> (<span class="type"><span class="type RDFterm">RDF term</span></span> <span class="name">term1</span>, <span class="type"><span class="type RDFterm">RDF term</span></span> <span class="name">term2</span>)
57555755
</pre>
@@ -5761,31 +5761,37 @@ <h5>SameValue</h5>
57615761
<a href="#OperatorMapping" class="sectionRef"></a>.
57625762
</p>
57635763

5764+
<p class="ednote" style="background-color: #EEE">
5765+
Revise for triple terms.
5766+
<br/>
5767+
Consider adding non-literal `=` to operator mapping table.
5768+
</p>
5769+
5770+
<p>The result of this function is determined by going through the following steps.</p>
57645771
<ol>
5765-
<li>If one or both arguments are known to be ill-typed,
5772+
<li>If <code>term1</code> and <code>term2</code> are
5773+
<a data-cite="RDF12-CONCEPTS#dfn-rdf-term-equality">equal RDF terms</a>,
5774+
the return TRUE.
5775+
</li>
5776+
<li>If both arguments are literals,
5777+
<a data-cite="RDF12-CONCEPTS#dfn-literal">literals</a>
5778+
and one or both arguments are known to be ill-typed,
57665779
then produce a type error.
57675780
</li>
5768-
<li>Returns TRUE if <code>term1</code> and <code>term2</code> are
5769-
<a data-cite="RDF12-CONCEPTS#dfn-rdf-term-equality">equal RDF terms</a>.
5781+
<li>If <code>term1</code> and <code>term2</code> both
5782+
<a data-cite="RDF12-CONCEPTS#dfn-literal">literals</a>
5783+
and the SPARQL processor can determine the values are equal,
5784+
then return TRUE.
57705785
</li>
5771-
<li>If the SPARQL processor can determine the values of both terms
5772-
and it can determine the values are equal, then return TRUE.
5786+
<li>If <code>term1</code> and <code>term2</code> both
5787+
<a data-cite="RDF12-CONCEPTS#dfn-literal">literals</a>
5788+
and the SPARQL processor can determine the values can not be equal,
5789+
then return FALSE.
57735790
</li>
5774-
<li>If the SPARQL processor can determine that the values of the terms
5775-
can not be equal, the return FALSE.
5791+
<li>Otherwise, return FALSE.
57765792
</li>
57775793
</ol>
5778-
5779-
<div class="ednote" style="background-color: #EEE" >
5780-
<p>If the function is to become callable as
5781-
<em>`sameValue(term1, term2)`</em>, add a rule
5782-
that if there is an
5783-
<a href="#OperatorMapping">operation mapping</a> for "="
5784-
for the arguments, an implementation MUST return the same boolean value
5785-
from <em>`sameValue(term1, term2)`</em>.
5786-
</p>
5787-
</div>
5788-
<div class="ednote" style="background-color: #EEE" >
5794+
<div class="ednote" style="background-color: #EEE">
57895795
<p>
57905796
The treatment of `NaN` can not be consistent with both "same term means same value"
57915797
and "`fn:numeric-equal(NaN, NaN)` is false". So it is an arbitrary choice with
@@ -5824,23 +5830,23 @@ <h5>SameValue</h5>
58245830
<div id="sameValue-ill-typed" class="note">
58255831
<p>A literal is
58265832
<a data-cite="RDF12-CONCEPTS#dfn-ill-typed">ill-typed</a>
5827-
if the datatype is one handled by the SPARQL processor and
5828-
the lexical form is not in
5829-
<a data-cite="RDF12-CONCEPTS#dfn-lexical-space">the lexical space</a>
5833+
if its datatype is handled by the SPARQL processor and
5834+
its lexical form is not in the
5835+
<a data-cite="RDF12-CONCEPTS#dfn-lexical-space">lexical space</a>
58305836
of the datatype.
58315837
</p>
58325838
<p>
5833-
The function `sameValue` returns true or false in cases where
5834-
the SPARQL processor can determine that the values of the
5835-
arguments are equal or are not equal. If the SPARQL processor
5836-
can not be sure, it returns `error`.
5839+
If the two arguments are literals, the function `sameValue`
5840+
returns `true` or `false` in cases where the SPARQL processor
5841+
can determine that the values of these literals are equal or are not equal.
5842+
If the SPARQL processor can not be sure, it returns `error`.
58375843
</p>
58385844
</div>
58395845
<div id="sameValue-NaN" class="note">
58405846
<p>
5841-
The <a href="#OperatorMapping">Operator Mapping</a> for "`=`""
5847+
The <a href="#OperatorMapping">Operator Mapping</a> for "`=`"
58425848
is the function
5843-
<a data-cite="XPATH-FUNCTIONS-31#func-numeric-equal">fn:numeric-equal`</a>
5849+
<a data-cite="XPATH-FUNCTIONS-31#func-numeric-equal">`fn:numeric-equal`</a>
58445850
which returns `false` when comparing arguments involving `NaN`.
58455851
However, `sameTerm("NaN"^^xsd:double, "NaN"^^xsd:double)` is true;
58465852
`sameValue` treats "NaN" as the "same value".
@@ -12257,7 +12263,7 @@ <h2>Changes between SPARQL 1.1 Query Language and SPARQL 1.2 Query Language</h2>
1225712263
<li>
1225812264
Editorial changes:
1225912265
<ul>
12260-
<li>Give a actual function signature to <a href="#func-sameValue" class="sectionRef"></a></li>
12266+
<li>Give an actual function signature to <a href="#func-sameValue" class="sectionRef"></a></li>
1226112267
<li>Improve wording of blank nodes in <a href="#templatesWithBNodes" class="sectionRef"></a></li>
1226212268
<li>Improve display on mobile</li>
1226312269
<li>Move `sameValue` (was `RDFterm-equal`) and `sameTerm` to <a href="#func-rdfTerms" class="sectionRef"></a></li>

0 commit comments

Comments
 (0)