Skip to content

Compaction of IRIs with "@list" @container for sets of @list #547

Open
@progval

Description

@progval

Compacting this document:

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

with this context:

{
  "prop": {
    "@id": "http://schema.org/prop",
    "@container": "@list"
  }
}

produces this new document:

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

which is missing the first of the two lists.

(Tested with the JSON-LD playground , PyLD, and the ruby-ld gem)

As far as I can tell, this is caused by step 12.8.7.3 of the compaction algorithm, which sets 'item active property' first to ["foo", "bar"] then to ["baz", "qux"] causing the first value to be overwritten, and lost from the compacted document.

Is this an expected consequence of the algorithm specification?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Errata

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions