w3c / w3c/json-ld-api

`@set` in the data does not override `@list` in the context

Open
#548 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I ran into this issue while trying to find an acceptable output for the code in #547. It would, IMO, look like this:

{
  "@context": {
    "prop": {
      "@id": "http://schema.org/prop",
      "@container": "@list"
    }
  },
  "prop": {"@set": [
    ["foo", "bar"],
    ["baz", "qux"]
  ]}
}

I would expect the @set on line 8 to override the @container: @list in the context, so that this expands back to the original code in #547. But instead, this expands into a @list of @lists in the JSON-LD playground, PyLD, and the Ruby distiller. The @set keyword is simply ignored.

Do others share my expectation that @set in this example should override the @list from the context?

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 example and the linked #547 issue, then compare the observed expansion in the JSON-LD playground, PyLD, and the Ruby distiller. Determine whether @set should override @container @list and document the agreed behavior; no repository file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.