Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pchampin opened this issue May 8, 2025 · 0 comments
Open

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

pchampin opened this issue May 8, 2025 · 0 comments
Labels
class-3 Class-3 change

Comments

@pchampin
Copy link
Contributor

pchampin commented May 8, 2025

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)

@pchampin pchampin added the class-3 Class-3 change label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
class-3 Class-3 change
Projects
Status: No status
Development

No branches or pull requests

1 participant