w3c / w3c/json-ld-api

If processing mode is json-ld-1.0, IRI-like terms should still be allowed to differ from their expanded forms

Open
#581 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ErratumRaised spec:bug substantive:class 3
Dominant language
HTML
Stars
106
Forks
40
PR merge metrics
No merged PRs in 30d

Description

In JSON-LD 1.1, IRI Expansion within a Context defines a rule with a Warning:

If a compact IRI is used as a term, it must expand to the value that compact IRI would have on its own when expanded. This represents a change to the original 1.0 algorithm to prevent terms from expanding to a different IRI, which could lead to undesired results.

This is reflected in the JSON-LD 1.1 Create Term Definition algorithm, which, in step 14.2.4 first says:

If the term contains a colon (:) anywhere but as the first or last character of term, or if it contains a slash (/) anywhere

But then step 14.2.4.2 unconditionally says:

If the result of IRI expanding term using local context, and defined, is not the same as the IRI mapping of definition, an invalid IRI mapping error has been detected and processing is aborted.

This of course works as expected if the processing mode is json-ld-1.1.

But if the processing mode is json-ld-1.0, step 14.2.4.2 should not throw an error. This is even specified in the test suite. The expansion tests 0026 and 0071, both of type jld:PositiveEvaluationTest, jld:ExpandTest, are explicitly for :specVersion "json-ld-1.0". It appears a verbatim implementation would fail on this.

If that is correct, this step of the algorithm needs an "Unless the processing mode is json-ld-1.0" condition.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the JSON-LD 1.1 Create Term Definition algorithm, especially step 14.2.4.2, and compare it with the json-ld-1.0 processing mode. Run or inspect expansion tests 0026 and 0071, then confirm the specification handles those tests without an error while retaining the json-ld-1.1 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.