w3c / rdf-star

RDF-star specification
https://w3c.github.io/rdf-star/
Other
120 stars 23 forks source link

Confusing definition of sparql-compare for triples with IRI components #264

Closed kasei closed 2 years ago

kasei commented 2 years ago

The first step of sparql-compare is defined as:

If neither A nor B is an RDF-star triple term, compare by SPARQL 1.1 operators <, =, >) and return the comparison value (-1, 0, +1) or throw an error as defined by SPARQL 1.1.

I find this confusing in cases where the operator is = and the operands are IRIs. Looking at the sparql-star-op-3 test for the :x7 test record, we have:

<< :a :b 9 >> < << :a :b 123 >>

In this case, < is not defined over IRI operands, and so would result in an error if invoked. The test case seems to assume that sparql-compare is able to compare subject, predicate, and object values, and determine that the overall expression is true because the object value comparison 9 < 123 is true. I imagine this indicates that sparql-compare's first rule needs to first check for equality using = and only invoke < or > if the operands are not equal.

If this interpretation is correct, I think the wording of the sparql-compare definition needs to be explicit about avoiding < and > in comparison of IRI values which are equal.

afs commented 2 years ago

There will be a revised text to refer to the SPARQL 1.1 operator mappings. sparql-compare is declaring the outcome, and not defining how base SPARQL 1.1 operators are applied for two RDF terms which are not quoted triples.