Skip to content

bugfix: use nested contexts

Matthieu Fesselier requested to merge bugfix/use-nested-contexts into master

related to applications/hubl#893 (closed)

Today, in the following resource, the context of nested resources was not used to expand properties:

{
  "@id": "user-6.jsonld",
  "profile": {
    "@id": "profile-6.jsonld",
    "@context": {
      "picture": "foaf:depiction"
    },
    "picture": "my-avatar.png"
  },
  "@context": "https://cdn.happy-dev.fr/owl/hdcontext.jsonld"
}

So the picture property was expanded as http://happy-dev.fr/owl/#picture and not as http://xmlns.com/foaf/0.1/depiction.

I added a small mechanism in the store to use the context of the resource if it's nested.

ping @jbpasquier

Merge request reports