m-ld-js icon indicating copy to clipboard operation
m-ld-js copied to clipboard

Term definitions in context should be able to declare a list

Open Peeja opened this issue 2 years ago • 0 comments

Consider the following JSON-LD document:

{
  "@context": {
    "appliances": {
      "@id": "ex:appliances",
      "@container": "@list"
    }
  },
  "appliances": [
    "toaster",
    "microwave"
  ]
}

According to the JSON-LD playground, this compacts (with an empty context) to:

{
  "ex:appliances": {
    "@list": [
      "toaster",
      "microwave"
    ]
  }
}

However, m-ld doesn't notice that ex:appliances should be a @list:

[
  {
    "@id": ".well-known/genid/clfgzkmo700033b6mrbk33fxz",
    "ex:appliances": [
      "microwave",
      "toaster"
    ]
  }
]

Peeja avatar Mar 20 '23 15:03 Peeja