Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

JSON-LD export: maintain a global @context once CE development stabilises #31

Open
musicog opened this issue Oct 2, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@musicog
Copy link
Member

musicog commented Oct 2, 2019

Currently (once JSON-LD support is merged in), src/routes/helpers/transformers.js defines the JSON-LD @context for the node-to-be-exported, and then translates each property URI into a scoped URI (where a corresponding context entry is available). Rather than sending the full @context along with every response, it would be nice to publish a "global" context at a specified URI (e.g. https://trompamusic.eu/trompa.jsonld) and then refer to that in each response like so:

{ 
  "@context": "https://trompamusic.eu/trompa.jsonld",
  "@id": "https://trompamusic.eu/XXXYYYUUID",
  "@type": [
        "Person",
        "prov:Agent"
    ],
    "dc:date": "2018-11-20",
    "dc:subject": "Gustav Mahler",
    "name": "Gustav Mahler"
    .....
}

That slightly cuts down the size of each response (the external context only needs to be requested once per session), but more importantly serves to advertise the name-spaces used within the TROMPA data, and makes it easier for others to publish data conforming to our model (promoting FAIR principles).

Note that we should hold off on implementing this until development of the CE has stabilised to a point where changes to the data model are unlikely, since having to maintain different versions of a global @context would be a headache.

@ChristiaanScheermeijer ChristiaanScheermeijer added enhancement New feature or request help wanted Extra attention is needed labels Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants