json-ld-api icon indicating copy to clipboard operation
json-ld-api copied to clipboard

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

Open pchampin opened this issue 3 years ago • 1 comments

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?

pchampin avatar Aug 22 '22 12:08 pchampin

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

gkellogg avatar Sep 01 '22 21:09 gkellogg