You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13192,7 +13192,7 @@ <h4>Conversion of native data types</h4>
13192
13192
<p>In JSON-LD numbers and boolean values are native data types. While [[Turtle]]
13193
13193
has a shorthand syntax to express such values, RDF's abstract syntax requires
13194
13194
that numbers and boolean values are represented as typed literals. Thus,
13195
-
to allow full round-tripping, the JSON-LD 1.1 Processing Algorithms and API specification [[JSON-LD11-API]]
13195
+
to allow round-tripping, <a data-cite="JSON-LD11-API#data-round-tripping">Section 8.6</a> of the the JSON-LD 1.1 Processing Algorithms and API specification [[JSON-LD11-API]]
13196
13196
defines conversion rules between JSON-LD's native data types and RDF's
13197
13197
counterparts. <a>Numbers</a> without fractions are
13198
13198
converted to <code>xsd:integer</code>-typed literals, numbers with fractions
@@ -13236,6 +13236,12 @@ <h4>Conversion of native data types</h4>
13236
13236
so `xsd:double` is the most appropriate datatype to render them back in RDF.
13237
13237
</div>
13238
13238
13239
+
<div id="issue387" class="note changed">Native JSON numbers are sometimes converted to `xsd:double`
13240
+
(numbers with a fractional part, or very big integers)
13241
+
and this conversion can be lossy.
13242
+
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 <a>value objects</a> with the appropriate datatype.
0 commit comments