[Archivesspace_Users_Group] Conflict between inheritance rules and oai_dc response

Cory Nimer cory_nimer at byu.edu
Fri Sep 25 16:43:17 EDT 2020


Dear ArchivesSpace community,

In working toward a migration from AS 2.5.1 to 2.8, we have encountered an error in the OAI ListRecords response for metadata formats other than EAD (i.e., oai_dc, oai_dcterms, oai_marc, and oai_mods). When trying requests such as https://asoaistg.lib.byu.edu/oai?verb=ListRecords&metadataPrefix=oai_dc (sorry, not a public link), the response returned is:

{"error":"undefined method `[]' for nil:NilClass"}

Checking the log file, we found that it referenced a line in our configuration file dealing with element inheritance:

E, [2020-09-22T15:58:46.797712 #333] ERROR -- : Thread-2300: Unhandled exception!
E, [2020-09-22T15:58:46.807963 #333] ERROR -- :
undefined method `[]' for nil:NilClass
/srv/asstg/config/config.rb:491:in `block in (root)'
org/jruby/RubyArray.java:2566:in `select'
/srv/asstg/config/config.rb:491:in `block in (root)'
uri:classloader:/record_inheritance.rb:133:in `block in merge_record'
org/jruby/RubyArray.java:1735:in `each'
uri:classloader:/record_inheritance.rb:125:in `merge_record'
uri:classloader:/record_inheritance.rb:104:in `block in merge'
org/jruby/RubyArray.java:2487:in `map'
uri:classloader:/record_inheritance.rb:103:in `merge'
uri:classloader:/record_inheritance.rb:4:in `merge'

The portion of the configuration file referred to in the log file reads as follows:

{
    :property => "subjects",
    :inherit_if => proc {|json| json.select {|j| ! j['_resolved']['terms'].select { |t| t['term_type'] == 'genre_form'}.empty? } },
    :inherit_directly => true
},
{
    :property => 'subjects',
    :skip_if => proc {|json| ['file', 'item'].include?(json['level']) },
    :inherit_if => proc {|json| json.select {|j| ! j['_resolved']['terms'].select { |t| t['term_type'] == 'topical'}.empty? } },
    :inherit_directly => true
},
{
    :property => 'subjects',
    :skip_if => proc {|json| ['file', 'item'].include?(json['level']) },
    :inherit_if => proc {|json| json.select {|j| ! j['_resolved']['terms'].select { |t| t['term_type'] == 'geographic'}.empty? } },
    :inherit_directly => true
},
{
    :property => 'subjects',
    :skip_if => proc {|json| ['file', 'item'].include?(json['level']) },
    :inherit_if => proc {|json| json.select {|j| ! j['_resolved']['terms'].select { |t| t['term_type'] == 'uniform_title'}.empty? } },
    :inherit_directly => true
},

These inheritance configuration statements work well in our PUI display, but it appears to upset our ListRecords request. It does not cause issues with OAI GetRecord requests, which will produce the record in Dublin Core or MARC for Resource records without issues, but generates the same error for Archival Object records that would include inherited information.

Is this something that others have encountered? Reading the OAI-PMH documentation on GitHub, we had not expected this to be an issue.

Best,

Cory Nimer
University Archivist
Brigham Young University
801-422-6091

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20200925/dafff4b5/attachment.html>


More information about the Archivesspace_Users_Group mailing list