HELLO FRIENDS!
We've migrated to Maplib 0.20.26, and we see different forms of the same xsd:decimal value depending on the output format, eg:
N-Triples:
"12.34"^^http://www.w3.org/2001/XMLSchema#decimal
"798"^^http://www.w3.org/2001/XMLSchema#decimalTurtle:
"12.340000000000"^^xsd:decimal
"798.000000000000"^^xsd:decimal
Turtle serialisation is preserving the Decimal(38, 12) whilst n-triples is trimming. Whilst the values are identical, lexically they are different, impacting idempotent additions, deletes etc. We want a nice clean set of triples :(
Replcate here -
from decimal import Decimal
import polars as pl
from maplib import Model
template = """
@prefix ex: <http://example.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
ex:DecimalTemplate [xsd:decimal ?value] :: {
ottr:Triple(ex:subject, ex:amount, ?value)
} .
"""
data = pl.DataFrame(
{"value": [Decimal("12.3400"), Decimal("798.0")]},
schema={"value": pl.Decimal(38, 12)},
)
model = Model()
model.add_template(template)
model.map("http://example.org/DecimalTemplate", data)
print(model.writes(format="ntriples"))
print(model.writes(format="turtle"))
HELLO FRIENDS!
We've migrated to Maplib 0.20.26, and we see different forms of the same xsd:decimal value depending on the output format, eg:
N-Triples:
"12.34"^^http://www.w3.org/2001/XMLSchema#decimal
"798"^^http://www.w3.org/2001/XMLSchema#decimalTurtle:
"12.340000000000"^^xsd:decimal
"798.000000000000"^^xsd:decimal
Turtle serialisation is preserving the Decimal(38, 12) whilst n-triples is trimming. Whilst the values are identical, lexically they are different, impacting idempotent additions, deletes etc. We want a nice clean set of triples :(
Replcate here -