Skip to content

Conversation

@RayPlante
Copy link
Collaborator

@RayPlante RayPlante commented Jan 22, 2026

A DAP Resource can be made part of one or more collections by adding the isPartOf property. This property is a list with each value being a reference (i.e. an object with an @id property) to a collection. This PR updates the nistoar.midas.dap.service.mds3 service to allow adding isPartOf elements.

Updating this property via the web API is done via the /midas/dap/mds3/id/data/isPartOf endpoint. This endpoint accepts methods GET (return current list of collection memberships), POST (add a single membership to the list), PUT (replace list of memberships), PATCH (add given list to current list), and DELETE (delete all memberships). With PUT and PATCH, the input message body is a JSON list of references; with POST, it is a single reference object. The minimum content of a reference object is either { "@id": "collid" } (where collid is the ark-identifier of the collection) or { "label": "colllab" } (where colllab is an alias name, like forensics; these labels are set by configuration). The backend will ensure that the isPartOf will always contain a unique list of elements.

Individual collection memberships can be accessed and updated via /midas/dap/mds3/id/data/isPartOf/collid, where collid is either the collection identifier or its label (as described above). Methods GET, PUT, PATCH, and DELETE apply just to the membership matching collid. PUT and PATCH take a single collection reference object as input.

Currently, the DAPTool only allows a record to be a member of one collection at a time. Thus, it is recommended to use PUT /midas/dap/mds3/id/data/isPartOf to add or switch a collection membership. Use DELETE /midas/dap/mds3/id/data/isPartOf if switching back to not being part of any collection.

The backend ensures that the collections referred to are legitimate collections available to authors. This set of legitimate collections is set by configuration.

To test under oar-docker, build and run oar-docker branch test/ispartof which includes both this branch of oar-pdr-py and the necessary updates to configuration. I have confirmed that the isPartOf property will be set when a collection is chosen in the wizard. However, more work is needed to integrate updates into the Editable Landing Page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants