Skip to content

Commit

Permalink
address #387
Browse files Browse the repository at this point in the history
  • Loading branch information
pchampin authored and gkellogg committed Mar 13, 2023
1 parent d254f3e commit b4c8621
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13192,7 +13192,7 @@ <h4>Conversion of native data types</h4>
<p>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, <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]]
defines conversion rules between JSON-LD's native data types and RDF's
counterparts. <a>Numbers</a> without fractions are
converted to <code>xsd:integer</code>-typed literals, numbers with fractions
Expand Down Expand Up @@ -13236,6 +13236,12 @@ <h4>Conversion of native data types</h4>
so `xsd:double` is the most appropriate datatype to render them back in RDF.
</div>

<div id="issue387" class="note changed">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 <a>value objects</a> with the appropriate datatype.
</div>

</section>

<section>
Expand Down

0 comments on commit b4c8621

Please sign in to comment.