<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Dear ArchivesSpace community,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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
<a href="https://asoaistg.lib.byu.edu/oai?verb=ListRecords&metadataPrefix=oai_dc">
https://asoaistg.lib.byu.edu/oai?verb=ListRecords&metadataPrefix=oai_dc</a> (sorry, not a public link), the response returned is:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-indent:.5in"><span style="font-size:10.0pt;font-family:"Courier New";color:black">{"error":"undefined method `[]' for nil:NilClass"}<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Checking the log file, we found that it referenced a line in our configuration file dealing with element inheritance:
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">E, [2020-09-22T15:58:46.797712 #333] ERROR -- : Thread-2300: Unhandled exception!<br>
E, [2020-09-22T15:58:46.807963 #333] ERROR -- : <br>
undefined method `[]' for nil:NilClass<br>
/srv/asstg/config/config.rb:491:in `block in (root)'<br>
org/jruby/RubyArray.java:2566:in `select'<br>
/srv/asstg/config/config.rb:491:in `block in (root)'<br>
uri:classloader:/record_inheritance.rb:133:in `block in merge_record'<br>
org/jruby/RubyArray.java:1735:in `each'<br>
uri:classloader:/record_inheritance.rb:125:in `merge_record'<br>
uri:classloader:/record_inheritance.rb:104:in `block in merge'<br>
org/jruby/RubyArray.java:2487:in `map'<br>
uri:classloader:/record_inheritance.rb:103:in `merge'<br>
uri:classloader:/record_inheritance.rb:4:in `merge'<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">The portion of the configuration file referred to in the log file reads as follows:
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">{<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :property => "subjects",<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :inherit_if => proc {|json| json.select {|j| ! j['_resolved']['terms'].select { |t| t['term_type'] == 'genre_form'}.empty? } },<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :inherit_directly => true<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">},<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">{<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :property => 'subjects',<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :skip_if => proc {|json| ['file', 'item'].include?(json['level']) },<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :inherit_if => proc {|json| json.select {|j| ! j['_resolved']['terms'].select { |t| t['term_type'] == 'topical'}.empty? } },<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :inherit_directly => true<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">},<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">{<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :property => 'subjects',<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :skip_if => proc {|json| ['file', 'item'].include?(json['level']) },<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :inherit_if => proc {|json| json.select {|j| ! j['_resolved']['terms'].select { |t| t['term_type'] == 'geographic'}.empty? } },<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :inherit_directly => true<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">},<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">{<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :property => 'subjects',<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :skip_if => proc {|json| ['file', 'item'].include?(json['level']) },<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :inherit_if => proc {|json| json.select {|j| ! j['_resolved']['terms'].select { |t| t['term_type'] == 'uniform_title'}.empty? } },<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> :inherit_directly => true<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">},<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is this something that others have encountered? Reading the OAI-PMH documentation on GitHub, we had not expected this to be an issue.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cory Nimer<o:p></o:p></p>
<p class="MsoNormal">University Archivist<o:p></o:p></p>
<p class="MsoNormal">Brigham Young University<o:p></o:p></p>
<p class="MsoNormal">801-422-6091<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>