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
Related to BorderCloud/TFT-tests#15, it would be useful to canonize xsd:duration, xsd:yearMonthDuration, xsd:dayTimeDuration.
I tried with jsonld-cli and a duration like "PT1M0.000S"^^<http://www.w3.org/2001/XMLSchema#duration>
is not normalized to "PT1M"^^<http://www.w3.org/2001/XMLSchema#duration> (removing the empty seconds).
If jsonld-cli doesn't use this library, please accept my apologies and point me to the right repo.
The text was updated successfully, but these errors were encountered:
The jsonld.js and rdf-canonize code are just processing the input given. They don't do datatype specific processing other than for primitive JSON types. I'm unsure if we want to start adding such specific features to these libraries. It could lead to lots of custom special case code that could have a performance impact in cases where it's not needed. For time times it might requiring pulling in new libraries too. Are canonical forms specified for duration types? Seems the easiest solution is to just let applications do their own normalization and validation. This could be done with a library that handles these common datatypes. A related possibility is to add one or more optional hooks to do per-quad processing and hook that into some external library. I'm not sure if that would be in rdf-canonize or toRdf in jsonld.js. Thoughts?
Your lib normalizes things like blank nodes, xsds:tring vs "plain literal", even 1e6 vs 1.0E6.
However, I'm not sure "primitive JSON types" is by the book. It converted 1e6 (xsd:decimal) to 1000000 (xsd:integer), and I'm not sure canonization is supposed to change the datatype.
Bringing in libs to handle extra XSD types sounds like the right approach. The performance impact will be minimal, because these are simple conversions.
Related to BorderCloud/TFT-tests#15, it would be useful to canonize xsd:duration, xsd:yearMonthDuration, xsd:dayTimeDuration.
I tried with
jsonld-cli
and a duration like"PT1M0.000S"^^<http://www.w3.org/2001/XMLSchema#duration>
is not normalized to "
PT1M"^^<http://www.w3.org/2001/XMLSchema#duration>
(removing the empty seconds).If
jsonld-cli
doesn't use this library, please accept my apologies and point me to the right repo.The text was updated successfully, but these errors were encountered: