Skip to content

convert "1"^^xsd:boolean and "0"^^xsd:boolean to native values #656

Open
@pchampin

Description

@pchampin

In the RDF to Object conversion algorithm, when the flag useNativeTypes is true, literals of type xsd:boolean, xsd:integer and xsd:double are converted (when possible) to the corresponding JSON value.

Since 1 and 0 are both part of the lexical space of xsd:boolean, it would make sense to recognize them in step 2.4.2 of the RDF to Object conversion algorithm, rewording it as follows:

  • Otherwise, if the datatype IRI of value equals xsd:boolean, set converted value to true if the lexical form of value matches "true" or "1", or to false if it matches "false" or "0". If it matches neither, set type to xsd:boolean.

(NB: I also added quotes around the lexical values for clarity)

Metadata

Metadata

Assignees

No one assigned

    Labels

    class-3Class-3 change

    Type

    No type

    Projects

    Status

    Future Work

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions