compaction: 12.7.1 empty array to 7.3 IRI compaction candidate
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 106
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
During a refactor of my compaction implementation I ended up with an unfortunate interaction where instead of passing the empty array as the value through in 12.7.1, a null ended up going through. This then caused the wrong candidate to be selected in IRI compaction in 7.3, due to the value is null check.
The test suite lacks coverage for this, but a reproducer looks like this:
{
"@id": "http://example.org/id",
"http://example.org/prop": []
}
{
"ex": "http://example.org/",
"ex:prop": { "@id": "http://example.org/prop", "@container": "@list" }
}
{
"@context": {
"ex": "http://example.org/",
"ex:prop": { "@id": "http://example.org/prop", "@container": "@list" }
},
"@id": "ex:id",
"http://example.org/prop": []
}
If a nil/null is passed through instead of the empty array, you end up with ex:prop instead of http://example.org/prop.
This could potentially be folded into t0004?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied JSON-LD reproducer and the existing test suite, checking whether this case belongs in t0004. Trace the empty-array value through compaction steps 12.7.1 and 7.3, then add regression coverage showing that the full IRI candidate is selected instead of the compact term.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100