json-ld-framing icon indicating copy to clipboard operation
json-ld-framing copied to clipboard

Language map with global context

Open Murloc6 opened this issue 3 years ago • 1 comments

We are trying to round trip json-ld with framing.

Our input json-ld document is:

{
  "@context": [
    {
      "@language": "en"
    },
    {
      "title": {
        "@id": "dct:title"
      },
      "titles": {
        "@id": "dct:title",
        "@container": "@language"
      }
    }
  ],
  "title": "myTitle"
}

We obtain the following triple:

_:b0 <dct:title> "myTitle"@en .

When we try to frame the data back, with round tripping, we get this result :

{
  "@context": [
    {
      "@language": "en"
    },
    {
      "title": {
        "@id": "dct:title"
      },
      "titles": {
        "@id": "dct:title",
        "@container": "@language"
      }
    }
  ],
  "titles": {
    "en": "myTitle"
  }
}

You can observe that title is transformed into titles since the input triple contain a language tag. Even though the context contains a global @language. We would expect the output to be the same as the input. It means that if there is a global @language defined in the context, the value should be defined with title and not a language map.

jsonld playground

Murloc6 avatar Nov 25 '21 09:11 Murloc6