This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
Plain literal behaviour #2
Labels
difficulty:challenging
Implementing or fixing this will present a doable challenge
priority:medium
spec
Milestone
Context
In the SPARQL spec, more spefically operand data types and [operator mapping] there exist the concepts of:
xsd:string type
Problem
The distinction is important, as the string operators only apply to apply to typed literals, and not the plain ones. For example, following expressions are NOT equivalent:
"foo"^^xsd:string != "bar"^^xsd:string
and"foo" != "bar"
.The first one will evaluate true, the second one should error, since the operator is not defined. A solution to this is to allow simple literals in problematic operators.
A bigger problem however is that the return type the some functions (mainly functions on strings) is dependent on the original type, e.g. a simple literal should be returned when the (first) argument was a simple literal. This is however impossible.
However: the RDF.js spec hides the difference between simple and typed literals, as it automatically adds the
xsd:string
data type.Proposal
Concluded from the discussion on the RDF.js repo, we want to consider simple literals as being typed with
xsd:string
. By extension, the same goes for language tagged literals andrdf:langString
.Any untyped literals we get as input we could type ourselves.
This will give issues with spec tests.
The text was updated successfully, but these errors were encountered: