This PR provides support for selecting an appropriate collection for deposit based on hints supplied by the Submission, and a mapping of hints to collection URLs within Deposit Services. See the end of this PR description for an alternate approach that we could adopt in the future if we desire.
How it works
If Submission.metadata contains a hints object with a collection-tags array, Deposit Services will see if any of the supplied tags matches a configured tag in SWORD protocol binding configuration under the key collection-hints. If a hint supplied in the Submission matches a hint configured in Deposit Services, the configured URL will be used for the deposit. Otherwise the configured default-collection will be used for deposit.
Here is an exampleSubmission.metadata carrying a hints object (based on the metadata-schemas PR).
If the Submission contains multiple hints, Deposit Services will attempt to look up configured collections for each hint, but will stop on the first match. Any remaining hints are not tested. There will only be at most one deposit.
Here is an example transport configuration for SWORD which configures the covid hint using the new collection-hints object. In this example, the Deposit Services environment would need to define DSPACE_COVID_HANDLE that resolves to a valid JScholarship collection.
In summary, the UI populates the Submission.metadata.hints.collection-tags array. Deposit Services configures a mapping between tags and collection URLs in the transport-config.protocol-binding.collection-hints object. If there is a match between Submission hints and Deposit Services hints, the first match is used to direct the deposit to the configured collection. Otherwise the default collection is used.
How it could work
Now, in the future it probably makes more sense for the SWORD endpoint to advertise the hints used to select collections. For example, the SWORD service document for JScholarship would be updated to carry the tags rather than embed them in the Deposit Services configuration. This puts the control for selecting the collection in the hand of the JScholarship administrators, and removes Deposit Services from hard-coding mappings between hints and collection urls. This approach would require some discussion with LAG before pursuing, but may be worth doing depending on how we see PASS interacting with J10P in the future (or other potential endpoints such as Dataverse).
About
This PR provides support for selecting an appropriate collection for deposit based on hints supplied by the Submission, and a mapping of hints to collection URLs within Deposit Services. See the end of this PR description for an alternate approach that we could adopt in the future if we desire.
How it works
If
Submission.metadata
contains ahints
object with acollection-tags
array, Deposit Services will see if any of the supplied tags matches a configured tag in SWORD protocol binding configuration under the keycollection-hints
. If a hint supplied in the Submission matches a hint configured in Deposit Services, the configured URL will be used for the deposit. Otherwise the configureddefault-collection
will be used for deposit.Here is an example
Submission.metadata
carrying ahints
object (based on the metadata-schemas PR).If the Submission contains multiple hints, Deposit Services will attempt to look up configured collections for each hint, but will stop on the first match. Any remaining hints are not tested. There will only be at most one deposit.
Here is an example transport configuration for SWORD which configures the
covid
hint using the newcollection-hints
object. In this example, the Deposit Services environment would need to defineDSPACE_COVID_HANDLE
that resolves to a valid JScholarship collection.Configuration summary
In summary, the UI populates the
Submission.metadata.hints.collection-tags
array. Deposit Services configures a mapping between tags and collection URLs in thetransport-config.protocol-binding.collection-hints
object. If there is a match between Submission hints and Deposit Services hints, the first match is used to direct the deposit to the configured collection. Otherwise the default collection is used.How it could work
Now, in the future it probably makes more sense for the SWORD endpoint to advertise the hints used to select collections. For example, the SWORD service document for JScholarship would be updated to carry the tags rather than embed them in the Deposit Services configuration. This puts the control for selecting the collection in the hand of the JScholarship administrators, and removes Deposit Services from hard-coding mappings between hints and collection urls. This approach would require some discussion with LAG before pursuing, but may be worth doing depending on how we see PASS interacting with J10P in the future (or other potential endpoints such as Dataverse).