Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blank node prefixes are not handled correctly #498

Open
pchampin opened this issue Oct 11, 2022 · 3 comments
Open

blank node prefixes are not handled correctly #498

pchampin opened this issue Oct 11, 2022 · 3 comments

Comments

@pchampin
Copy link

(the same issue is present in PyLD: digitalbazaar/pyld#167)

Consider the following:

{
  "@context": {
    "t": "_:b"
  },
  "@type": "t:x"
}

It expands to

[
  {
    "@type": [
      "t:x"
    ]
  }
]

while it should expand to

[
  {
    "@type": [
      "_:bx"
    ]
  }
]

Indeed, step 14.2.5 of Create Term Definition clearly states:

If term contains neither a colon (:) nor a slash (/), simple term is true, and if the IRI mapping of definition is either an IRI ending with a gen-delim character, or a blank node identifier, set the prefix flag in definition to true.

(emphasis is mine)

Therefore, step 6.4 of IRI Expansion should apply.

@davidlehn
Copy link
Member

Appropriate tests should be added to the main JSON-LD test suite.

@pchampin
Copy link
Author

@davidlehn I replied on the json-ld-api repo: w3c/json-ld-api#550 (comment)

@davidlehn
Copy link
Member

This was not caught because 1.0 tests, such as expand 0038, are no longer run in jsonld.js. (comments in json-ld-api issue). The above "expected" result does occur with the older 1.0 processor playground:
https://json-ld.org/playground/1.0/

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

No branches or pull requests

2 participants