yalelibrary / YUL-DC

Preliminary issue tracking for Yale University Libraries Digital Collections project
3 stars 0 forks source link

Add MODS format to Ruby-oai library #1160

Closed DraxIndustries79 closed 3 years ago

DraxIndustries79 commented 3 years ago

Story: The MODS format must be added to ruby-oai library. Blacklight-oai-provider formats are defined in http://github.com/code4lib/ruby-oai. See https://github.com/neubloc/ruby-oai/commit/7bd9ad0d75c983a96425ab5ae005d2701a17d705 as an example of this being done for Marc once upon a time.

This work should result in a MODS PR back to ruby-oai if possible.

Acceptance:

Bonus:

mikeapp commented 3 years ago

There may have been changes to the library that allow us to do this without a fork. For instance it looks like there is a method to register a new format: https://github.com/code4lib/ruby-oai/blob/3cdc12d86c7d1dde00b47105a7dab6def3f6801d/lib/oai/provider.rb#L276

[Edit: now I think we do need to define a format similar to https://github.com/code4lib/ruby-oai/blob/3cdc12d86c7d1dde00b47105a7dab6def3f6801d/lib/oai/provider/metadata_format.rb but I think we can declare it in our project?]

martinlovell commented 3 years ago

Simple spike to link it in through the SolrDocument.to_oai_mods....just getting a feel for how it works: https://github.com/yalelibrary/yul-dc-blacklight/compare/1160_spike_mods?expand=1

Going to: http://localhost:3000/catalog/oai?verb=ListRecords&metadataPrefix=oai_mods shows the response.

(Didn't implement any actual mods code. to_oai_mods just returns the solr document as XML)

martinlovell commented 3 years ago

Rather than fork and update ruby-oai, we are able to add mods format by adding to_oai_mods to SolrDocument and adding some configuration so that the oai_mods format was registered. (Moving to Team Review since this card may not need any work.)