NationalMuseumAustralia / Collection-API

The public web API of the National Museum of Australia
10 stars 0 forks source link

Linked art 'representations' structure #13

Open f27wood opened 6 years ago

f27wood commented 6 years ago

In the linked-art schema the attached ‘representations’ are not consistent in structure. For example when trying to retrieve all ‘toy train’ objects ( http://nma.conaltuohy.com/xproc-z/object?type=toy+train&media=*&format=json-ld ) you can see three different types of representation structures:

This is likely a bug, as I would expect a single standard structure for this data. Otherwise a developer needs to account for 3x different methods to retrieve images using linked art schema.

Conal-Tuohy commented 6 years ago

I think part of this may be an issue for the JSON-LD "Compaction" algorithm. By default, in JSON-LD, if a property has a single value then it should be expressed as a JSON object, or if it has multiple values it should be an array of JSON-objects, and this means that the result can be irregular.

However, it's possible to specify an alternative to that default behaviour, and I think the Linked Art context is supposed to control this by specifying that certain properties are always expressed as arrays, even when they have only one value (so that the hierarchy is consistent). This would mean we'd always produce an array of "visual items", containing another of "visual items".

I will check this.

f27wood commented 6 years ago

To discuss

Conal-Tuohy commented 4 years ago

This issue is still present:

The JSON-LD compaction stylesheet needs revision