-
Notifications
You must be signed in to change notification settings - Fork 0
Refining RDFTerm-equals #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The note in https://www.w3.org/TR/sparql12-query/#func-RDFterm-equal starts with:
Based on my interpretation, this note indicates that implementations can choose to support the examples you listed above. Unless the point of this issue is that this note should be removed in favor of a more precise definition? |
Yes, a more precise definition (better coverage of possible cases) - extensions can added where there is Leave the note, even expand it. It is explaining what is going on in more accessible language. |
I am starting to look into this one now (apologies for the delay). @afs two questions to start with:
|
Maybe erratum is too definite. The vague text in query 1.1 does not give reasonable conditions for an extension (e.g. ill-typed literals can be an extension). The first revision for SPARQL 1.2 addressed the general issues of rdfTerm-equals but required the two literals to be of the same datatype for an extension else false is required. In ex4, a system can know that two different datatypes give the same value, or conversely are definitely not the same value. ex5 is similar but an illustration of partial knowledge. |
#194 deals with these together by having giving the contract for extensions. I don't see the advantage of trying to split apart the proposed 4 conditions for separate discussions then putting them back together again. I sketched the changes in the current #194 - I have started to remove the old text and editors notes for rdfTerm-equals (with the section reordering) and I'll push that ASAP. (PS Mostly done and pushed) |
+1 to this proposal. A problem with having clause "2. If the arguments are the sameTerm then return TRUE." at position 2 is that |
Good point. And also The operator dispatch table will have sent doubles/floats to See also : https://www.w3.org/TR/rdf12-concepts/#dfn-literal-term-equality |
(long) discussion point in an editors' note in #194 on "NaN"s. tl;dr: I don't think there is a consistent choice and there are arguments for/against any of true, false or error. I prefer the line of argument that "sameTerm implies sameValue" because of term pattern matching. The spec has a note that |
#185 shows that
RDFTerm-equals
needs some attention.(#25 is the issue for renaming this. Trying it out here.)
In the definition of RDFTerm-equals says:
Bullet 2 applies if the terms have the same dataype IRI. What if there are two diffrerent but related datatype IRIs?
"recognized" is about the data generally, and so could apply elsewhere such a comparision (if it matters), not just this function.
Currently, there is a proposal to remove it from RDF Concepts because it is also defined by RDF Semantics.
We would be better having a SPARQL-focused definition we can limit to this function (e.g. a system may be able to determine equality in some, but not all, cases).
Example 1
Returns false.
But they are the same value - and only
error
allows extension.(
xsd:precisionDecimal
is not derived fromxsd:decimal
nor the other way round)Example 2
Returns false.
my:romanNumeral
can't be made derived because the lexical space is not digits.Example 3
Returns False.
xsd:dateTimeStamp
is a derived datatype ofxsd:dateTime
but the spec only covers numeric derived types.Example 4
Systems involving units (different value space to numbers)
Not error so can't be an extensions. This is an erratum.
Example 5
All it takes is to know to return FALSE is that
my:romanNumeral
is a number or not a legal value, withoutNot error so can't be an extension. This is an erratum IMO.
Example 6
Probably, this should be FALSE because the operator mapping does apply to
=
and a SPARQL processor must understandxsd:integer
.It could be
error
because it can't be 123. c.f.which is an error before
sameValue
is invoked.Proposal
Instead of adding one or more cases, I propose defining RDFTerm-equals more in the style of "by contract"
(not exact wording for now): in order:
error
.sameTerm
then return TRUE.error
.The 4th case does not necessarily require values themselves because a processor may know they are different value spaces so can't be value-equal. Case 1 removes know-to-ill-typed.
Because of the order of cases 1 and 2, "sameTerm=true" does not imply "sameValue=true". They could be swapped so that is the case.
I don't think there can be a perfect solution in all cases - we are going from terms to values with incomplete knowledge in some situations.
The text was updated successfully, but these errors were encountered: