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.

Activity

added this to the JSON-LD 1.1 milestone on May 26, 2020
tarjelavik

tarjelavik commented on Nov 24, 2022

@tarjelavik

I found this issue now as well. Using latest release. Really confused by how the playgrounds handles this fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @davidlehn@letmaik@tarjelavik

        Issue actions

          Compaction of language maps with @value aliased not as expected · Issue #143 · digitalbazaar/jsonld.js