json-ld / json-ld.org

JSON for Linked Data's documentation and playground site
https://json-ld.org/
Other
853 stars 152 forks source link

From an array of property-scoped @contexts, only the first one is applied in JSON-LD Playground #741

Open jakubklimek opened 3 years ago

jakubklimek commented 3 years ago

I have the following JSON-LD:

{
    "@context": {
        "@version": 1.1,
        "@import": "https://ofn.gov.cz/věc/2020-07-01/kontexty/věc.jsonld",
        "@propagate": true,
        "nedefinováno": "https://slovník.gov.cz/nedefinováno/",
        "Téma dizertační práce": {
            "@id": "nedefinováno:téma-dizertační-práce",
            "@context": {
                "konzultant": {
                    "@id": "nedefinováno:konzultant",
                    "@context": [
                        "https://ofn.gov.cz/lidé-a-osoby/2020-07-01/kontexty/člověk-či-osoba.jsonld",
                      "https://pod-test.mvcr.gov.cz/otevřené-formální-normy/věda-a-výzkum/draft/kontexty/věda-a-výzkum.jsonld"
                    ]
                }
            }
        }
    },
    "typ": "Téma dizertační práce",
    "název": {
        "cs": "2D nanomateriály pro detekci polutantů v životním prostředí"
    },
    "konzultant": {
        "typ": "Člověk",
        "jméno": {
            "cs": "Martin"
        }
    }
}

Note that konzultant has two external contexts in an array. The first one defines the type Člověk - a person. The second one defines type Výzkumník - researcher, which has everything a person has, plus some additional properties.

In the example above when

  1. I switch the order of the contexts in the array, OR
  2. I change typ (alias of @type) from Člověk (defined in the first context) to Výzkumník (defined in the second context), the konzultant property stops being interpreted.