omeka / omeka-s

Omeka S is a web publication system for universities, galleries, libraries, archives, and museums. It consists of a local network of independently curated exhibits sharing a collaboratively built pool of items, media, and their metadata.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use application/ld+json as Content-Type for the Omeka S API

coret opened this issue · comments

Currently the Content-Type of the of the API response is application/json; charset=utf-8 (like https://www.goudatijdmachine.nl/omeka/api/items/37476 and also the context https://www.goudatijdmachine.nl/omeka/api-context).

image

The Omeka S API outputs a more specific kind of JSON: JSON-LD. So the content-type of these responses from the Omeka S API should reflect this and use the Content-Type application/ld+json; charset=utf-8 (see also https://www.w3.org/TR/json-ld11/).

I stumbled on this issue while using the (standards adhering) tool https://sketch.zazuko.com/ - I pasted the output of the Omeka S API into this tool and it showed the (correct) error:

Error: 
Failed to load remote context https://www.goudatijdmachine.nl/omeka/api-context: 
Unsupported JSON-LD media type application/json

The API will return an application/ld+json content type in an upcoming release. In fact, consumers will be able to request other formats, such as RDF XML, N3, Turtle, and N-Triples, each with their corresponding content type.