DAP collections: support update of isPartOf #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A DAP Resource can be made part of one or more collections by adding the
isPartOfproperty. This property is a list with each value being a reference (i.e. an object with an@idproperty) to a collection. This PR updates thenistoar.midas.dap.service.mds3service to allow addingisPartOfelements.Updating this property via the web API is done via the
/midas/dap/mds3/id/data/isPartOfendpoint. 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, likeforensics; these labels are set by configuration). The backend will ensure that theisPartOfwill 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/isPartOfto add or switch a collection membership. UseDELETE /midas/dap/mds3/id/data/isPartOfif 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/ispartofwhich includes both this branch of oar-pdr-py and the necessary updates to configuration. I have confirmed that theisPartOfproperty will be set when a collection is chosen in the wizard. However, more work is needed to integrate updates into the Editable Landing Page.