Export number and date attributes with valid XSD lexical forms - #1086
Open
Floating-Y wants to merge 1 commit into
Open
Floating-Y wants to merge 1 commit into
Floating-Y wants to merge 1 commit into
Conversation
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Valid normalized attributes can produce ill-typed RDF literals: JSON numbers may use exponent notation that
xsd:decimaldoes not accept, while year, month and timestamp values are all labeledxsd:date.This is a follow-up to #865 and the export audit discussed in #831. It preserves the summary/class and missing-object behavior already fixed by #865.
What changes
xsd:decimalwithout another floating-point conversion or fixed-scale rounding. Bound expansion to the exponent range produced by normalized finite numbers.gYear,gYearMonth,dateordateTimefrom the date value. Format calendar fields without truncating negative or extended years.Examples:
"1e-7"^^xsd:decimal"0.0000001"^^xsd:decimal"1e+20"^^xsd:decimal"100000000000000000000"^^xsd:decimal"2024"^^xsd:date"2024"^^xsd:gYear"2024-07"^^xsd:date"2024-07"^^xsd:gYearMonth"2024-07-15T14Z"^^xsd:date"2024-07-15T14:00:00Z"^^xsd:dateTimeChanges are confined to
rdf.rsand its tests. There are no dependency, storage, input-validation, ontology-datatype or unrelated export-structure changes.parse_timeis used only for calendar-only values, so its timestamp truncation cannot discard an attribute's clock or fractional seconds.XSD dateTime alone cannot encode source hour/minute precision; this patch adds no precision predicates. Unrecognized text continues through the existing fallback, including malformed clock text that today's permissive input validation may accept.
How it was checked
cargo fmt --all --checkcargo clippy --locked --offline --workspace --all-targets -- -D warningscargo test --locked --offline --workspace --no-fail-fastgit diff --checkThe final Windows workspace run passed with CLI temporary-directory writes permitted and
NO_PROXY=localhost,127.0.0.1,::1for the test process. Database-backed tests skipped becauseUTOPIA_DATABASE_URLwas unset; six existing ignored tests were not run. Frontend checks were not run because no frontend files changed.Before review
git commit -s).