notation3.py: don't normalize float representation#3020
Merged
edmondchuc merged 9 commits intoRDFLib:mainfrom Sep 18, 2025
Merged
notation3.py: don't normalize float representation#3020edmondchuc merged 9 commits intoRDFLib:mainfrom
edmondchuc merged 9 commits intoRDFLib:mainfrom
Conversation
tgbugs
added a commit
to tgbugs/interlex
that referenced
this pull request
Jan 6, 2025
also add test case for no metadata to ensure we handle that correctly, which includes being able to retrieve a graph by ser ident directly, still need gclc e.g. to test sync which has no ser ident had to merge dangling and conn cases together when appending to sord so that they match the order in the source file ingest test_nasty needs RDFLib/rdflib#3020 in order to succeed due to current rdflib normalizing float string representation before it gets passed to Literal where normalization control usually resides
Member
|
@tgbugs can you please just put in a test to show it working as opposed to failing previously? |
6dc9a4e to
3cbfcf2
Compare
made as a separate commit to illustrate the old broken behavior priro to the fix in the next commit
fix behavior of the n3 parser family to avoid normalizing raw float string representation which makes it impossible to roundtrip the exact original string representation of e.g. 1e10
3cbfcf2 to
66f626c
Compare
Contributor
Author
|
@nicholascar I added a test to illustrate the issue. If there is going to be another 7.x release it should probably be backported as well. |
nicholascar
approved these changes
May 31, 2025
Contributor
|
pre-commit.ci autofix |
Contributor
|
Thanks for this @tgbugs. I've refactored your test to use pytest parametrization for better maintainability and clarity on what the test is doing. I'll merge this soon after I cherry-pick the relevant commits to a new PR for 7.x. |
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.
fix behavior of the n3 parser family to avoid normalizing raw float string representation which makes it impossible to roundtrip the exact original string representation of e.g.
1e10