- From: Andy Seaborne <andy@apache.org>
- Date: Sun, 2 Sep 2018 10:42:19 +0100
- To: public-rdf-dawg-comments@w3.org
Hi,
Thanks for the report.
I've recorded this in the SPARQL errata document:
https://www.w3.org/2013/sparql-errata#editorial-query-5
On 28/08/18 23:51, Hans-Juergen Rennau wrote:
> The section specifies RDFterm-equal in an inconsistent way.
>
> Quote:
> ===========================================================
> term1 and term2 are the same if any of the following is true:
> ...
> term1 and term2 are equivalent literals as defined in 6.5.1 Literal
> Equality <http://www.w3.org/TR/rdf-concepts/#section-Literal-Equality>
> of [CONCEPTS <https://www.w3.org/TR/sparql11-query/#CONCEPTS>].
> ...
> ===========================================================
>
>
> Following the link to "6.5.1 Literal Equality" one finds:
>
> ===========================================================
>
>
> 6.5.1 Literal Equality
>
> Two literals are equal if and only if all of the following hold:
>
> * The strings of the two lexical forms compare equal, character by
> character.
> * Either both or neither have language tags.
> * The language tags, if any, compare equal.
> * Either both or neither have datatype URIs.
> * The two datatype URIs, if any, compare equal, character by character.
>
> ...
> ===========================================================
>
> Note that the text does not define "equivalent literals", but literal
> equality, and this equality is described as syntactic equality.
The SPARQL doc should explain that equivalent literals is referring to
literal equality.
It is a syntactic identity. RDFterm-equal, which is the last for of "="
in the operator table, adds the fact that is two literals are
"same-term" they much be "same-value" even for unknown datatypes. i.e.
same syntax implies same value.
>
> However, the section includes an example in which RDFterm-equal
> returns true in the case of value equality without literal equality:
> "2004-12-31T19:00:00-05:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>
> xsd:dateTime("2005-01-01T00:00:00Z")
> A footnote following the example confirms the use of value equality,
> opposed to syntactic equality:
> "Invoking RDFterm-equal on two typed literals tests for equivalent
> values."
>
> Conclusion: the specification of RDFterm-equal is inconsistent,
> describing it in one place to mean literal equality and in another
> place to mean value equality.
>
> Additional problem: the sentence from the beginning of the section:
> "produces a type error if the arguments are both literal but are not
> the same RDF term ^*
> <https://www.w3.org/TR/sparql11-query/#func-RDFterm-equal-foot1> ;"
>
> is quite confusing -
> (a) what is the meaning of the hyphen preceding the semicolon?
It is an underline on the footnote hyperlink from the browser:
<sup><a href="#func-RDFterm-equal-foot1" class="footnote">*</a></sup>
> (b) why should two literals which are not the same RDF term produce a
> type error, if a boolean assessment of equality is expected
Evaluation is three-state, true, false and unknown. For unknown
datatype, it is wrong to conclude that because they have different
lexical forms, they are different values. A result of false in
value-equality means "known to be different values" and true means
"known to be same value", leaving the 3rd case of "don't know".
> (c) the statement is contradicted by both examples where arguments
> which are literals without equality do not produce a type error.
I think the second example is not sufficiently highlighting that it is
same-value even though the terms are different. It says just above the
example "the RDF terms are not the same, but have equivalent values:"
but the fact should be clearer.
>
> Hans-Juergen Rennau
Thank you,
Andy
Received on Sunday, 2 September 2018 09:42:43 UTC