asulibraries / islandora-repo

ASU Digital Repository on Islandora
GNU General Public License v2.0
4 stars 4 forks source link

OAI-PMH endpoint #31

Closed elizoller closed 4 years ago

elizoller commented 4 years ago

likely most of the way there with drupal oai module and islandora_oai. how will oai handle complex objects (will it need to be filtered on objects which do not have any children?) also OAI implementation is limited to listRecords with oai_dc, no set implementation, no mods implementation, no listverbs, etc

wgilling commented 4 years ago

there is a taxonomy term for the OAI set --

  1. this value needs to be populated per item
  2. the OAI_PMH view (clone it) should be filtering on these set identifiers

ListRecords -- must take a parameter for which set identifier to use ListSets

elizoller commented 4 years ago

ListSets is here: http://localhost:8000/oai/request?verb=ListSets ListRecords is here: http://localhost:8000/oai/request?verb=ListRecords&metadataPrefix=oai_dc

elizoller commented 4 years ago

module: https://www.drupal.org/project/rest_oai_pmh

elizoller commented 4 years ago

two sets that i know of

elizoller commented 4 years ago

we think to make this simpler and play nicer with the module (which is built to handle a contextual filter for sets), we will add two fields

wgilling commented 4 years ago

would this field also be updated in the asu_default_fields_node_insert hook?

elizoller commented 4 years ago

already done: https://github.com/asulibraries/islandora-repo/blob/develop/web/modules/custom/asu_default_fields/asu_default_fields.module#L149

wgilling commented 4 years ago

The code that is setting each object's "field_oai_set" value should be moved to presave hook and apply on updates and inserts. This should also implement something to handle when a collection node field_oai_set value changes - so that it propagates to all of the collection children.

elizoller commented 4 years ago

i am concerned about automatically having a collection save iterate through its children and update them.it could be extremely costly.

wgilling commented 4 years ago

good point on how that could be problematic although it seems that this action NEEDS TO eventually happen if a collection's field_oai_set is changed -- would it be possible to prompt the user to update all nodes, or update during overnight CRON or something else?

elizoller commented 4 years ago

i think the best situation would be anything that runs in a batch so we could either loop something in that prompts the user to initiate a batch update on all of the children or do something that runs those updates on cron (like gets all collection nodes that were updated since last cron and if the oai_set changed then update all of the children)

wgilling commented 4 years ago

It seems that dc.identifier holds the value of the object's node->id() value as well as the full handle URL but I get errors when I try to query for the specific record.

<error code="idDoesNotExist">The value of the identifier argument is unknown or illegal in this repository.</error>

Yet, when I query for ListIdentifiers, the output of one of the identifiers is: <identifier>oai:localhost:node-4</identifier>, so ?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:localhost:node-4 yields that single record. Yay!

The verbs and additional arguments that may be supported. ?verb=Identify ?verb=ListMetadataFormats ?verb=ListIdentifiers&metadataPrefix=oai_dc ?verb=ListRecords&metadataPrefix=oai_dc *?verb=GetRecord&metadataPrefix=oai_dc&identifier={???}

elizoller commented 4 years ago

you've got the right pattern for getting a single record by identifier, example: https://keep.lib.asu.edu/oai/request?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:keep.lib.asu.edu:node-11 and yes dc:identifier is configured to hold the handle as well - that's the specific mapping to DC

elizoller commented 4 years ago

sorry was there a question in there that i'm missing?