Skip to content

oxrdfxml: accept single-quoted <!ENTITY> values - #2023

Merged
Tpt merged 1 commit into
oxigraph:mainfrom
thelastbackspace:fix/1998-single-quoted-entities
Nov 5, 2026
Merged

Tpt merged 1 commit into
oxigraph:mainfrom
thelastbackspace:fix/1998-single-quoted-entities

Conversation

@thelastbackspace

Copy link
Copy Markdown
Contributor

The DOCTYPE entity extraction only accepted "..." values, but XML 1.0 EntityValue allows '...' too. So files like the W3C OWL 2 test export (<!ENTITY rdf 'http://...'>) failed with "<!ENTITY values should be enclosed in double quotes".

Now the parser takes whichever quote opens the value and reads up to the matching one, so 'say "hi"' and "it's" both work. I added a parser testsuite case covering single quotes plus each quote char inside the other kind.

Tested with cargo test -p oxigraph-testsuite --test oxigraph (the new case fails without the change) and cargo test -p oxrdfxml --all-features.

Fixes #1998

XML 1.0 EntityValue allows both quote characters, but the DOCTYPE
entity extraction only accepted double quotes, so documents like the
W3C OWL 2 test export failed to parse.

Fixes oxigraph#1998
@codspeed

codspeed Bot commented Nov 5, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 9.86%

1 warning

⚠️ 7 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

❌ 2 regressed benchmarks
✅ 150 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ Sparqloscope BSBM 1000 in memory - Transitive path with a large join and plus 13.5 ms 15 ms -9.86%
❌ Sparqloscope BSBM 1000 in memory - Transitive path with a small join and plus 13.5 ms 15 ms -9.86%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing thelastbackspace:fix/1998-single-quoted-entities (5e0fdab) with main (dc72671)

Open in CodSpeed

@Tpt Tpt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Tpt
Tpt merged commit 6fd4584 into oxigraph:main Nov 5, 2026
42 of 45 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.

oxrdfxml rejects <!ENTITY> declarations whose value is in single quotes

2 participants