Skip to content

Warning for breaking change EBV #286

@jitsedesmet

Description

@jitsedesmet

Hi all,

I was implementing the support for !! not-not, and noticed that the spec tests for it did not work on Comunica. I noticed that the definition of EBV had a breaking change between SPARQL 1.1 and SPARQL 1.2, introduced #265 .

Namely, SPARQL 1.1 says:

The EBV of any literal whose type is xsd:boolean or numeric is false if the lexical form is not valid for that datatype (e.g. "abc"^^xsd:integer).

While in 1.2 that rule no longer exists and instead a boolean or numeric evaluates to and error if the lexical form is not valid.

I assume this is intentional and have no issue with it, but maybe some stronger wording could be used in the list of changes between 1.1 and 1.2? (since this change does cause some queries (likely quite exotic onces, but still) to return less results.
(I know from talking to @rubensworks that he did not notice this side effect)


Example in the spec tests we have:

SELECT ?v ?ebv {
  VALUES ?v { true 1 "a" false 0 "" "a"@en "z"^^xsd:boolean "2020-01-01T00:00:00Z"^^xsd:dateTime :a }
  BIND(!!?v AS ?ebv)
}

The binding for ?v = "z"^^xsd:boolean in 1.1:
?v = "z"^^xsd:boolean and ?v = "false"^^xsd:boolean
While in sparql 1.2 you only get:
?v = "z"^^xsd:boolean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions