digitalutsc / islandora_lite_docs

Contains a Wiki with documentation for the UTSC Library's Islandora Lite System
GNU General Public License v3.0
2 stars 0 forks source link

Explore what it takes to make a custom metadata mapping module for https://www.drupal.org/project/rest_oai_pmh #43

Closed kstapelfeldt closed 7 months ago

kstapelfeldt commented 2 years ago

See also https://github.com/Islandora/documentation/issues/949 and also https://guidelines.openaire.eu/en/latest/ and also https://www.drupal.org/project/rest_oai_pmh/issues/3159441

We want to create a plugin to demonstrate this working on a hierarchical metadata format. First target: MODS

MODS resources (from Islandora interest Group)

https://docs.google.com/document/d/15qSO9YcALtYSqd6CUuGx0t8FwUJ5pPwVPz0PA5rU898/edit#heading=h.f9r6knw0rjvu

See also: https://github.com/islandora-interest-groups/Islandora-Metadata-Interest-Group/wiki/MIG-MODS-to-RDF-Working-Documents

OpenAire Resources

https://guidelines.openaire.eu/en/latest/data/application_profile.html http://schema.datacite.org/meta/kernel-3/index.html http://www.openarchives.org/OAI/openarchivesprotocol.html https://guidelines.openaire.eu/en/latest/data/use_of_oai_pmh.html

kstapelfeldt commented 2 years ago

Views-driven approach where the label needs to be consistent with the Twig template in order to render properly. Amy will build out MODS plugin in this way.

kstapelfeldt commented 2 years ago

Next steps

  1. Refine your approach to use a contextual filter in the view in order to get the Node ID. See example: https://core.digital.utsc.utoronto.ca/admin/structure/views/view/mods/edit/feed_1
  2. Run code-checks for Drupal.org as per https://www.jeffgeerling.com/blog/2020/install-drupal-coder-and-php-codesniffer-your-drupal-project-lint-php-code and https://medium.com/@saptashwa04/installing-and-using-drupal-php-code-sniffer-on-phpstorm-59228d55daa9
  3. Once step 2 passes, we will make a pull/merge request to the main Drupal module as per https://docs.gitlab.com/ee/user/project/merge_requests/ https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupal/creating-issue-forks-and-merge-requests Once this is ready we may email the developer jcorall@kent.edu
  4. Author two types of Documentation (Document your MODS Plugin in the readme for the module). Screenshots or small videos welcomed!

Document your MODS Plugin

Document how to build a Plugin (Put that documentation here in markdown and I'll find it a good home)

kstapelfeldt commented 2 years ago

issue made for Amy to make pull request https://www.drupal.org/project/rest_oai_pmh/issues/3248710

kstapelfeldt commented 2 years ago

Small tweak to the above request.

kstapelfeldt commented 2 years ago

Can we limit to a MODS expression for a single object by some mechanism?

yamyyao commented 2 years ago

I do not think it is currently possible to expose a single object with contextual filters and the set feature. The idea is that there would be a mechanism to, in just one view, expose multiple sets each containing just one object that could then be added as a verb in the request itself, which would result in just that one singular object being shown. However, the module currently only works in that way with contextual filters that filter for an entity reference field. When you have a contextual filter for an entity reference field, the module automatically creates multiple sets, each filtering for objects referenced by that field. This makes it easier on configuration as the user only needs to configure one view rather than having to manually configure individual views for each of the entity references. However, this does not work for fields that are not entity references.

Since the content ID is not an entity reference field, this feature doesn’t work for our purpose of just getting one object. It is technically possible to have sets of just individual objects if you were willing to manually configure a view for each individual object, but that’s not very practical at all.

yamyyao commented 2 years ago

After speaking with Nat, it seems it actually is possible to get the record of one object, just not with the sets. The "Getting a Single Record" section of this article gives instructions on that:

https://help.escholarship.org/support/solutions/articles/9000133474-using-the-oai-pmh-interface#singlerecord

Rather than using the "ListRecords" request and using sets (as I was previously looking into), getting a single object can be done by using the request "GetRecord" along with a metadata prefix and the identifier of the object wanted. For example, the request /oai/request?verb=GetRecord&metadataPrefix=mods&identifier=oai:localhost:node-15 would return the information of node 15 with the MODS format. This allows for getting the expression of just one object.

kylehuynh205 commented 7 months ago

This work is merged in to the module: https://www.drupal.org/project/rest_oai_pmh