wschella / Sparqlee

Simple SPARQL expression evaluator library
0 stars 0 forks source link

Handle bad lexical forms consistenly #7

Closed wschella closed 6 years ago

wschella commented 6 years ago

We should define (and document) a consistent way of handling bad lexical forms (such as "not an integer"^^xsd:integer). We want consistent error messages, and we want them to occur in the same place.

wschella commented 6 years ago

An important thing to keep in mind is that a bad lexical form is still a syntactically valid RDF Term, and altough it contains semantic inconsistencies, we must handle it as a valid Term (according to the spec at least).

Relevant section:

Otherwise, the literal is ill-typed and no literal value can be associated with the literal. Such a case produces a semantic inconsistency but is not syntactically ill-formed. Implementations MUST accept ill-typed literals and produce RDF graphs from them. Implementations MAY produce warnings when encountering ill-typed literals.

wschella commented 6 years ago

I believe we do this consistently now, although it needs testing (which will get it's own issue).