w3c / json-ld-api

JSON-LD 1.1 Processing Algorithms and API Specification
https://w3c.github.io/json-ld-api/
Other
76 stars 29 forks source link

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

Open pchampin opened 2 years ago

pchampin commented 2 years ago

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?

gkellogg commented 2 years ago

Agreed, it might be treated as a set of lists, instead.