From b4c8621e4fda6106c1e5f663542a325c3d4e816d Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Champin Date: Wed, 1 Jun 2022 13:30:30 +0200 Subject: [PATCH] address #387 --- index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 53edd02..3bf5105 100644 --- a/index.html +++ b/index.html @@ -13192,7 +13192,7 @@

Conversion of native data types

In JSON-LD numbers and boolean values are native data types. While [[Turtle]] has a shorthand syntax to express such values, RDF's abstract syntax requires that numbers and boolean values are represented as typed literals. Thus, - to allow full round-tripping, the JSON-LD 1.1 Processing Algorithms and API specification [[JSON-LD11-API]] + to allow round-tripping, Section 8.6 of the the JSON-LD 1.1 Processing Algorithms and API specification [[JSON-LD11-API]] defines conversion rules between JSON-LD's native data types and RDF's counterparts. Numbers without fractions are converted to xsd:integer-typed literals, numbers with fractions @@ -13236,6 +13236,12 @@

Conversion of native data types

so `xsd:double` is the most appropriate datatype to render them back in RDF. +
Native JSON numbers are sometimes converted to `xsd:double` + (numbers with a fractional part, or very big integers) + and this conversion can be lossy. + Therefore, the use of native JSON numbers is discouraged when the exact value of the numbers must be preserved. It is advised to use instead value objects with the appropriate datatype. +
+