Skip to content

Conversation

tgbugs
Copy link
Contributor

@tgbugs tgbugs commented Jan 5, 2025

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

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
@nicholascar
Copy link
Member

@tgbugs can you please just put in a test to show it working as opposed to failing previously?

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
@tgbugs
Copy link
Contributor Author

tgbugs commented Jan 26, 2025

@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 nicholascar changed the base branch from 8.x to main March 24, 2025 04:48
@nicholascar nicholascar changed the base branch from main to 8.x March 24, 2025 04:49
@edmondchuc
Copy link
Contributor

pre-commit.ci autofix

@coveralls
Copy link

coveralls commented Sep 12, 2025

Coverage Status

coverage: 90.298% (+0.001%) from 90.297%
when pulling 06bf1b1 on tgbugs:n3-no-norm-float
into 8da4e29 on RDFLib:main.

@edmondchuc edmondchuc mentioned this pull request Sep 13, 2025
3 tasks
@edmondchuc edmondchuc added the 7.x label Sep 16, 2025
@edmondchuc
Copy link
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.

@edmondchuc edmondchuc removed the 7.x label Sep 18, 2025
@edmondchuc edmondchuc merged commit e8243f7 into RDFLib:main Sep 18, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants