Repository navigation
fix: literal escapes decoded twice (N-Triples) and xml:lang leaking from empty elements (RDF/XML) - #224
Merged
Conversation
The empty-element branch emitted the literal without clearing the property element's language, unlike the non-empty path. The next sibling literal, or every literal of the next nested node, inherited it. Two cases in TestParseXMLLangInheritance and conformance case 0109 (F28). nave.golden.nt had the leak baked in: dcterms:created followed an empty dc:title xml:lang="nl" and came out "1947-1958"@nl.
gon3 decoded an escaped backslash twice, so it formed a new escape with the character after it: "C:\\temp" was indexed as C:<TAB>emp and "a\\n" as a real newline. Bump gon3 to 9cf4a2d, which decodes UCHARs and ECHARs in a single pass. Conformance case 0008 (F29) covers escaped backslashes before n and t, a double escaped backslash, an escaped quote and \u005C.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #224 +/- ##
=======================================
Coverage 36.95% 36.95%
=======================================
Files 414 414
Lines 38326 38327 +1
=======================================
+ Hits 14164 14165 +1
Misses 24160 24160
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
Two parser bugs that change indexed literals. Each one has a conformance case and a FINDINGS row.
N-Triples: escapes decoded twice (F29, case 0008). gon3 ran its UCHAR pass, which already turns
\\into\, and then replaced ECHARs with sequentialReplaceAllcalls. An escaped backslash therefore formed a new escape with the next character:"C:\\temp"was indexed asC:<TAB>emp, and"a\\n"as a real newline. Fixed in gon3 (9cf4a2d, one-pass unescape); this PR bumpsgo.modto it.RDF/XML:
xml:langleaking from an empty property element (F28, case 0109). The empty-element branch emitted the literal without clearing the property element's language, unlike the non-empty path. So<schema:description xml:lang="nl"></schema:description>gave the next sibling literal, or every literal of the next nested node, the languagenl. On one museum dataset that was 139 literals. The fix is one line.nave.golden.nthad the leak baked in (dcterms:created "1947-1958"@nlafter an emptydc:title xml:lang="nl") and is corrected.Testing
TestParseXMLLangInheritance: two new cases (sibling property, next nested node). Both failed before the fix.TestConformance/0109andTestConformance/0008fail without their fix and pass with it.go test ./ikuzo/rdf/... ./ikuzo/service/x/bulk/: pass. The suites that need a Docker socket (elasticsearchtests,service/x/index,hub3/fragments) were not run locally.