From fe66c3d00d852a78b1400ad019062d3565cc0937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=BB=C3=B3=C5=82tak?= Date: Wed, 4 Dec 2024 11:59:11 +0100 Subject: [PATCH] Resource::castLiteral(): casting xsd:boolean fixed --- src/acdhOeaw/arche/doorkeeper/Resource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/acdhOeaw/arche/doorkeeper/Resource.php b/src/acdhOeaw/arche/doorkeeper/Resource.php index c82dcda..881867e 100644 --- a/src/acdhOeaw/arche/doorkeeper/Resource.php +++ b/src/acdhOeaw/arche/doorkeeper/Resource.php @@ -904,7 +904,7 @@ private function castLiteral(LiteralInterface $l, string $range): LiteralInterfa $value = DF::literal($numValue, null, $range); break; case RDF::XSD_BOOLEAN: - $value = DF::literal((string) ((bool) $l), null, $range); + $value = DF::literal(in_array((string) $l, ['', '0', 'false']) ? 'false' : 'true', null, $range); break; default: throw new RuntimeException('unknown range data type: ' . $range);