Skip to content

Fix compaction test t0112 and t0113#256

Merged
mielvds merged 3 commits into
masterfrom
fix-compact-t0112
May 11, 2026
Merged

Fix compaction test t0112 and t0113#256
mielvds merged 3 commits into
masterfrom
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

@mielvds mielvds merged commit d8d1eb6 into master May 11, 2026
16 checks passed
@mielvds mielvds deleted the fix-compact-t0112 branch May 11, 2026 08:57
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