Skip to content

Compaction of language maps with @value aliased not as expected #143

Open
@letmaik

Description

@letmaik

(from json-ld/json-ld.org#420)

{
  "@context": {
    "id": "@id",
    "type": "@type",
    "value": "@value",
    "skos": "http://www.w3.org/2004/02/skos/core#",
    "label": { "@id": "skos:prefLabel", "@container": "@language" },
    "qudt": "http://qudt.org/schema/qudt#",
    "symbol": "qudt:symbol",
    "UCUM": "http://www.opengis.net/def/uom/UCUM/"
  },
  "id": "qudt:DegreeCelsius",
  "label": {"en": "Degrees Celsius"},
  "symbol": {
    "type": "UCUM",
    "value": "Cel"
  }
}

When I compact that with the same context I get:

{
  "@context": {
    "id": "@id",
    "type": "@type",
    "value": "@value",
    "skos": "http://www.w3.org/2004/02/skos/core#",
    "label": {
      "@id": "skos:prefLabel",
      "@container": "@language"
    },
    "qudt": "http://qudt.org/schema/qudt#",
    "symbol": "qudt:symbol",
    "UCUM": "http://www.opengis.net/def/uom/UCUM/"
  },
  "id": "qudt:DegreeCelsius",
  "symbol": {
    "type": "UCUM",
    "value": "Cel"
  },
  "label": {
    "en": {
      "@language": "en",
      "value": "Degrees Celsius"
    }
  }
}

Why does the compaction algorithm care about how I aliased @value when trying to compact the language maps? Shouldn't it still go back to the original simple language map?

The playground at http://www.markus-lanthaler.com/jsonld/playground/ seems to handle it correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions