NationalMuseumAustralia / Collection-API

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

Handle parent-child object records #43

Closed staplegun closed 6 years ago

staplegun commented 6 years ago

A collection item that consists of multiple parts is often described using multiple object records, for example a teapot:

  1. Parent (virtual concept) - teapot
  2. Child (physical item) - pot
  3. Child (physical item) - lid

Most searchers are interested in the teapot, so the children parts should be excluded from typical queries. However the teapot record should include links to its children records.

When only a child part is in an exhibition (e.g. just the teapot lid), the parent object should be flagged as being 'on display'.

staplegun commented 6 years ago

Recognising hierarchy levels:

f27wood commented 6 years ago

Karen, Simon and I are meeting about this on Tuesday, so will get back to you after that date. This may not be resolved until v2.0 which is OK if it is a known issue.

f27wood commented 6 years ago

So the consensus here is that we would like the parent and child to both be returned in a search result. The reason being, that there are two kinds of instances where there is a parent/child:

A set - made up of multiple objects, such as a tea set (ie. teapot, saucer, cup), or s suit that is made up of pants and a jacket

A Parts - where on object has many parts that make it up. For example, the teapot with the pot and lid. Or a clock that may have multiple parts to form the one object, or an object that is broken so has two parts, but the object needs to be represented as a whole

With a Set, it makes sense that somebody may wish to retrieve one of the objects in that Set on its own. With a part, it does not make sense to always need to retrieve a part of an object. However we will not be releasing parts unless it makes sense to do so.

So basically, only children that make sense to be searched on their own, will be released to the API.

Hence we think it best that search results include the parent and children, with a way to determine if they have a parent/child.

If that isn't too much extra work? Or we have missed something?

staplegun commented 6 years ago

I have removed suppression of child records in Solr. I am ignoring the TitObjectType field and just processing the AssParentObjectRef field - if it exists I create a parent/child link both ways:

staplegun commented 6 years ago

Need to filter out any records containing <TitObjectType>Pending Object</TitObjectType> (not strictly part of parent-child work, but closely related)

staplegun commented 6 years ago

Pending objects are already filtered out - https://github.com/Conal-Tuohy/NMA-API-ETL/blob/2c3d722d46a49dacf89eba35f29f90fd83b05cc3/filter.xsl#L29

staplegun commented 6 years ago

Parent has been added to JSON-LD, but not simple - https://csapi-test.nma.gov.au/object/108547?format=json-ld - part_of /object/76002

But the reverse child link is not appearing - https://csapi-test.nma.gov.au/object/76002?format=json-ld

staplegun commented 6 years ago

Status:

Link from parent to child

Link from child to parent

staplegun commented 6 years ago

Fixed in https://github.com/NationalMuseumAustralia/Collection-API-ETL/commit/1ae7da475398c26ae8af512b28d7fef279fb509c

staplegun commented 6 years ago

Fixed (again) in https://github.com/NationalMuseumAustralia/Collection-API-ETL/commit/dcfd370eedb1332dcea5471145aa284a6211296b