Fix relative IRIs containing a forward slash before a colon#80
Closed
Fix relative IRIs containing a forward slash before a colon#80
Conversation
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix parsing of relative IRIs with forward slash and colon
Fix relative IRIs containing a forward slash before a colon
Mar 4, 2026
Pull Request Test Coverage Report for Build 22686555487Details
💛 - Coveralls |
4 tasks
Member
|
Replaced by rubensworks/relative-to-absolute-iri.js#28 |
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.
The
relative-to-absolute-irilibrary treats any value containing a colon as absolute, without validating that the pre-colon segment is a valid URI scheme. Per RFC 3986, a scheme isALPHA *( ALPHA / DIGIT / "+" / "-" / "." )— slashes are forbidden — sox/y:zis unambiguously a relative IRI and must be resolved against the base IRI.Changes
lib/RdfXmlParser.ts: InvalueToUri, detect when a slash precedes the first colon (ruling out a valid scheme). For such values, temporarily encode all colons as\u0000(null character, illegal in XML and therefore safe as a sentinel), resolve against the base IRI, then restore the colons.test/RdfXmlParser-test.ts: Added unit tests forvalueToUricovering slash-before-colon resolution (with/without trailing slash on base, multiple colons), and an integration test parsing a full RDF/XML document with such a relative IRI.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.