w3c / w3c/json-ld-api

Invalid IRIs in compaction test #tp004

Open
#517 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

test:needs implementation
Dominant language
HTML
Stars
106
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Hi,

In the step 14.2.3 of the Create Term Definition algorithm after expanding the value associated to the @id entry of a term definition, the algorithm continues as follows:

If the resulting IRI mapping is neither a keyword, nor an IRI, nor a blank node identifier, an invalid IRI mapping error has been detected and processing is aborted

However, here is the context given for compact#tp004:

{
  "@context": {
    "ex": "http://example.com/",
    "colon": "http://example.org/:",
    "question": "http://example.org/?",
    "hash": "http://example.org/#",
    "lbracket": "http://example.org/[",
    "rbracket": "http://example.org/]",
    "at": "http://example.org/@"
  }
}

In this context, http://example.org/[ and http://example.org/] are not valid IRIs (both characters [ and ] are reserved and can only appear in the host part to denote an IP literal). My implementation of IRIs is strict, and rejects such IRI. And since according to step 14.2.3 the parsed value must but either an IRI (which they are not), a blank node identifier (which they are not) or a keyword (which they are not), I end up returning an invalid IRI mapping error although the test is supposed to succeed.

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 compact#tp004 context in compact-manifest.html and compare it with step 14.2.3 of the Create Term Definition algorithm. Check how the implementation validates the bracketed IRIs and whether the test or algorithm defines the expected behavior. Done means the interpretation is resolved and compact#tp004 passes consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
api, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.