Skip to content

What to do with value entries outside value objects? #535

Open
@timothee-haudebourg

Description

@timothee-haudebourg

In my current implementation of the expansion algorithm, when the expanded node only contains value entries (i.e. @language or @direction entries), then it is dropped. In my interpretation of the JSON-LD syntax, this is more or less what is intended as the map is neither a node object nor a value object. This is also quite natural to do it this way with a typed implementation since node objects cannot include @language or @direction by construction.

I discovered that this is not what is described by the JSON-LD API document, where this doesn't seem to be really covered. It only covers the case where the map only contains a @language entry, in which case it is ignored:

If result is a map that contains only the entry @language, return null.

More complex cases are not covered. In the playground, only the d map is dropped in the following example:

{
  "http://a": {
    "@id": "http://a",
    "@language": "fr"
  },
  "http://b": {
    "@id": "http://b",
    "@language": "en",
    "@direction": "ltr"
  },
  "http://c": {
    "@id": "http://c",
    "@direction": "ltr"
  },
  "http://d": {
    "@language": "fr"
  },
  "http://e": {
    "@language": "en",
    "@direction": "ltr"
  },
  "http://f": {
    "@direction": "ltr"
  }
}

In my case, I drop d, e and f while removing the problematic entries in a, b and c. Is that a wrong interpretation of the expansion algorithm?

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