Skip to content

Fix compaction test t0112 and t0113#256

Open
mielvds wants to merge 3 commits intomasterfrom
fix-compact-t0112
Open

Fix compaction test t0112 and t0113#256
mielvds wants to merge 3 commits intomasterfrom
fix-compact-t0112

Conversation

@mielvds
Copy link
Copy Markdown
Collaborator

@mielvds mielvds commented May 7, 2026

Fixes tests

With @container: @index and @index a compact IRI, ensure round-tripping of compacted representation

With @container: @index and @index an absolute IRI, ensure round-tripping of compacted representation

_compact() immediately compacted the term or compact IRI index mapping, also when the index key was not @index. Therefore, it would sometimes pick the wrong term to compact and use as container key.

The fix expands the index mapping first, then compacts that expanded IRI, matching the JSON-LD API compaction correction for compact-IRI index mappings: https://www.w3.org/TR/json-ld11-api/#compaction-algorithm. After expanding the custom @index mapping, it compacts it with the first indexed value when available. That keeps ex:rank from tripping the prefix-confusion guard, while still selecting predicate instead of rdf:predicate for the reverse-term case.

@mielvds mielvds changed the title Fix compaction test t0112 Fix compaction test t0112 and t0113 May 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

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.

2 participants