Skip to content

Compacting @graph as array. #512

@timothee-haudebourg

Description

@timothee-haudebourg

Hi,

The expected output of compact#t0080 is

{
  "@context": {
    "@vocab": "http://example.org/",
    "input": {
      "@container": "@graph"
    }
  },
  "input": {
    "@id": "http://example.org/gid",
    "@graph": {
      "value": "x"
    }
  }
}

wheras in my output, the @graph value is compacted into an array:

"@graph": [
    {
      "value": "x"
    }
]

I don't see why my output is incorrect here. Reading step 12.8.5 of the compaction algorithm I thought it was clear that members of a graph should be added with as array to true:

Initialize as array to true if container includes @set, or if item active property is @graph or @list, otherwise the negation of compactArrays.

I'm obviously doing something wrong here, but I can't find what.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions