From 9851d5089c86f7fe7b7198b92816f9dca51a3bfc Mon Sep 17 00:00:00 2001 From: Anatoly Scherbakov Date: Sat, 14 Jun 2025 19:05:55 +0400 Subject: [PATCH 1/2] #656 Specify 0 and 1 as valid Boolean literals in RDF to Object conversion algorithm --- index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 07e66ace..1748742b 100644 --- a/index.html +++ b/index.html @@ -5503,8 +5503,11 @@

Algorithm

of value equals xsd:boolean, set converted value to true if the lexical form - of value matches true, or false - if it matches false. If it matches neither, + + of value matches "true" or "1", or false + if it matches "false" or "0". + + If it matches neither, set type to xsd:boolean.
  • Otherwise, if the datatype IRI From b3f492c6cb34330f43e1771bd5792ca0a9c966ed Mon Sep 17 00:00:00 2001 From: Anatoly Scherbakov Date: Sat, 14 Jun 2025 19:06:28 +0400 Subject: [PATCH 2/2] #656 Update fromRdf test 0027 to reflect 0 and 1 as valid Boolean values --- tests/fromRdf/0027-in.nq | 3 +++ tests/fromRdf/0027-out.jsonld | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/tests/fromRdf/0027-in.nq b/tests/fromRdf/0027-in.nq index 8336cb89..03ea5251 100644 --- a/tests/fromRdf/0027-in.nq +++ b/tests/fromRdf/0027-in.nq @@ -1,6 +1,9 @@ "true"^^ . "false"^^ . + "1"^^ . + "0"^^ . + "True"^^ . "False"^^ . diff --git a/tests/fromRdf/0027-out.jsonld b/tests/fromRdf/0027-out.jsonld index dde170cf..1744119d 100644 --- a/tests/fromRdf/0027-out.jsonld +++ b/tests/fromRdf/0027-out.jsonld @@ -6,6 +6,13 @@ {"@value": false} ] }, + { + "@id": "http://example.com/boolean-number", + "http://example.com/example": [ + {"@value": true}, + {"@value": false} + ] + }, { "@id": "http://example.com/boolean-object", "http://example.com/example": [