Swirrl / datahost-prototypes

Eclipse Public License 1.0
0 stars 0 forks source link

issue #395 Allow GET application/json for commit with dh:changeKind property, Update UI to match changes #397

Closed xdrcft8000 closed 6 months ago

xdrcft8000 commented 6 months ago

With this PR: GET on a commit still defaults to text/csv if not specified in the accept header. GET on a commit with accept application/json will give this:

{
  "dh:updates": "09bafe350c94f417e9a881dd4d20e518cb9ade9b9c042ff7bbc3e48aaaa69832",
  "dh:revisionSnapshotCSV": "032b95eb3577d01e3dadca20336563ef2f1f4b1483747183e5130c2eadeabce4",
  "dcterms:description": "change for x-series-on-GCP",
  "dh:appliesToRevision": "https://example.org/data/x-series-on-GCP/release/release-1/revision/1",
  "dcterms:format": "text/csv",
  "@id": "x-series-on-GCP/release/release-1/revision/1/commit/1",
  "@type": "dh:Change",
  "dh:changeKind": "https://publishmydata.com/def/datahost/ChangeKindAppend",
  "@context": [
    "https://cdn.jsdelivr.net/gh/Swirrl/datahost-prototypes@1282114/datahost-ld-openapi/resources/jsonld-context.json",
    {
      "@base": "https://example.org/data/"
    }
  ]
}

Update the UI to match the changes: Screen Shot 2024-02-21 at 15 43 52 pm

RickMoynihan commented 6 months ago

For this point:

I'm not sure if that whole URI is needed for the change kind and don't know how to change it.

I think we can fix that by adding dh:changeKind to the jsonld context with "@type:" "@id" e.g. see here in the JSON ld playground.

However I think dh:changeKind property should really be made the RDF type for the change, so we might want to create a new issue to do that.

The json-ld context is here:

https://github.com/Swirrl/datahost-prototypes/blob/548f5f77791e817a7b4727757980cd82292c7ce8/datahost-ld-openapi/resources/jsonld-context.json