@@ -5672,19 +5672,19 @@ <h5>NOT IN</h5>
5672
5672
<h4>Functions on RDF Terms</h4>
5673
5673
5674
5674
<section id="func-sameTerm">
5675
- <h5>SameTerm </h5>
5675
+ <h5>sameTerm </h5>
5676
5676
<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>
5677
5677
<p>Returns TRUE if <code>term1</code> and <code>term2</code> are the same RDF term as
5678
5678
defined in [[[RDF12-CONCEPTS]]] [[RDF12-CONCEPTS]]; returns FALSE otherwise.</p>
5679
5679
<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>
5682
5682
if one of the following is true:
5683
5683
</p>
5684
5684
<ul>
5685
5685
<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>.
5688
5688
</li>
5689
5689
<li><code>term1</code> and <code>term2</code> are
5690
5690
<a data-cite="RDF12-CONCEPTS#dfn-literal">literals</a> that are
@@ -5729,7 +5729,7 @@ <h5>SameTerm</h5>
5729
5729
</tr>
5730
5730
<tr>
5731
5731
<td><code>sameTerm("abc"@en--rtl, "abc"@en)</code></td>
5732
- <td>true </td>
5732
+ <td>false </td>
5733
5733
</tr>
5734
5734
<tr>
5735
5735
<td><code>sameTerm(2, 2.0)</code></td>
@@ -5749,7 +5749,7 @@ <h5>SameTerm</h5>
5749
5749
</section>
5750
5750
<section id="func-sameValue">
5751
5751
<span id="func-RDFterm-equal"><!-- obsolete id --></span>
5752
- <h5>SameValue </h5>
5752
+ <h5>sameValue </h5>
5753
5753
<pre class="prototype nohighlight">
5754
5754
<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>)
5755
5755
</pre>
@@ -5761,31 +5761,37 @@ <h5>SameValue</h5>
5761
5761
<a href="#OperatorMapping" class="sectionRef"></a>.
5762
5762
</p>
5763
5763
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>
5764
5771
<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,
5766
5779
then produce a type error.
5767
5780
</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.
5770
5785
</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.
5773
5790
</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.
5776
5792
</li>
5777
5793
</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">
5789
5795
<p>
5790
5796
The treatment of `NaN` can not be consistent with both "same term means same value"
5791
5797
and "`fn:numeric-equal(NaN, NaN)` is false". So it is an arbitrary choice with
@@ -5824,23 +5830,23 @@ <h5>SameValue</h5>
5824
5830
<div id="sameValue-ill-typed" class="note">
5825
5831
<p>A literal is
5826
5832
<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>
5830
5836
of the datatype.
5831
5837
</p>
5832
5838
<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`.
5837
5843
</p>
5838
5844
</div>
5839
5845
<div id="sameValue-NaN" class="note">
5840
5846
<p>
5841
- The <a href="#OperatorMapping">Operator Mapping</a> for "`=`""
5847
+ The <a href="#OperatorMapping">Operator Mapping</a> for "`=`"
5842
5848
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>
5844
5850
which returns `false` when comparing arguments involving `NaN`.
5845
5851
However, `sameTerm("NaN"^^xsd:double, "NaN"^^xsd:double)` is true;
5846
5852
`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>
12257
12263
<li>
12258
12264
Editorial changes:
12259
12265
<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>
12261
12267
<li>Improve wording of blank nodes in <a href="#templatesWithBNodes" class="sectionRef"></a></li>
12262
12268
<li>Improve display on mobile</li>
12263
12269
<li>Move `sameValue` (was `RDFterm-equal`) and `sameTerm` to <a href="#func-rdfTerms" class="sectionRef"></a></li>
0 commit comments