<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div>I found a way to get info on the EAD -> JSON_schema mappings, and I’ve managed to fix those notes/0/content errors as well as several others.</div><div><br></div><div>For debugging purposes, I make this temporary change to jsonmodel_wrap.rb  to  ignore all validation errors,</div><div>and I run my command line EAD import parser.  ( I haven’t tried running this code on the backend server — no idea what that might break. )</div><div><br></div><div><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(105, 40, 40); background-color: rgb(212, 192, 172); position: static; z-index: auto;"><b>--- a/backend/app/converters/lib/jsonmodel_wrap.rb</b></div><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(105, 40, 40); background-color: rgb(212, 192, 172); position: static; z-index: auto;"><b>+++ b/backend/app/converters/lib/jsonmodel_wrap.rb</b></div><div style="margin: 0px; font-size: 16px; font-family: Menlo; background-color: rgb(212, 192, 172); position: static; z-index: auto;"><span style="color: #0193a0">@@ -13,10 +13,10 @@</span> module ASpaceImport</div><div style="margin: 0px; font-size: 16px; font-family: Menlo; background-color: rgb(212, 192, 172); position: static; z-index: auto;">         # TODO - speed things up by avoiding this another way</div><div style="margin: 0px; font-size: 16px; font-family: Menlo; background-color: rgb(212, 192, 172); position: static; z-index: auto;">         rescue JSONModel::ValidationException => e</div><p style="margin: 0px; font-size: 16px; font-family: Menlo; background-color: rgb(212, 192, 172); min-height: 19px; position: static; z-index: auto;"> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(166, 23, 9); background-color: rgb(212, 192, 172); position: static; z-index: auto;">-          e.errors.reject! {|path, mssg|</div><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(166, 23, 9); background-color: rgb(212, 192, 172); position: static; z-index: auto;">-                            e.attribute_types &&</div><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(166, 23, 9); background-color: rgb(212, 192, 172); position: static; z-index: auto;">-                            e.attribute_types.has_key?(path) &&</div><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(166, 23, 9); background-color: rgb(212, 192, 172); position: static; z-index: auto;">-                            e.attribute_types[path] == 'ArchivesSpaceDynamicEnum'}</div><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(1, 149, 0); background-color: rgb(212, 192, 172); position: static; z-index: auto;">+          e.errors.reject! {|path, mssg| true }</div><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(1, 149, 0); background-color: rgb(212, 192, 172); position: static; z-index: auto;">+#                            e.attribute_types &&</div><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(1, 149, 0); background-color: rgb(212, 192, 172); position: static; z-index: auto;">+#                            e.attribute_types.has_key?(path) &&</div><div style="margin: 0px; font-size: 16px; font-family: Menlo; color: rgb(1, 149, 0); background-color: rgb(212, 192, 172); position: static; z-index: auto;">+#                            e.attribute_types[path] == 'ArchivesSpaceDynamicEnum'}</div></div><div><br></div><div><br></div><div>This generates json files for almost all of the EAD files. ( except for about 30, which I assume are the ones with errors other</div><div>than #<:ValidationException…> ).  The ones that would not have normally validated correctly will still generate validation</div><div>errors if POSTED to  /repositories/$ID/batch_imports.  However, I can pipe them thru json_pp and search for the schema </div><div>property in the error message.  So far, this has yielded enough context information to identify the source of the problem </div><div>in the EAD file. </div><div><br></div><div>Most of these problems seem to trace back to empty elements in the EAD file. </div><div><br></div><div>In a few cases, there is a missing required element ( unitid, for example ), but in most cases, removing the empty element</div><div>fixes the problem.  Is this something that could be fixed in the parser ? : if the element is empty, don’t create a JSON property</div><div>for it ?   </div><div>( For now, I’m adding templates for all of the glitches I’ve found to a AS fixup stylesheet run as a pre-process to AS import. ) </div><div><br></div><div><br></div><div>— Steve Majewski</div><div><br></div><br><div><div>On Feb 28, 2014, at 8:43 AM, Brad Westbrook <<a href="mailto:brad.westbrook@lyrasis.org">brad.westbrook@lyrasis.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Hi, Steve,<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">I won’t be able to address your mapping request until next week.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">We are working on a public release now which will address the LDAP security hole reported a couple of weeks ago and include a number of enhancements made since the 1.0.4 release on Jan. 20.  We are aiming to announce the release later today, but it might not be until Monday, depending on resolution of one item.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Brad<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Arial, sans-serif; color: rgb(31, 73, 125);">Bradley D. Westbrook<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Arial, sans-serif; color: rgb(31, 73, 125);">Program Manager<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Arial, sans-serif; color: rgb(31, 73, 125);"><a href="mailto:brad@archivesspace.org" style="color: purple; text-decoration: underline;"><span style="color: rgb(31, 73, 125);">brad.westbrook@lyrasis.org</span></a><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Arial, sans-serif; color: rgb(31, 73, 125);">800.999.8558 x2910<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Arial, sans-serif; color: rgb(31, 73, 125);">678.235.2910<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Arial, sans-serif; color: rgb(31, 73, 125);">bradley_d_westbrook (Skype) </span><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Arial, sans-serif;"><image001.png></span><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div><div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;"><span class="Apple-converted-space"> </span><a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org">archivesspace_users_group-bounces@lyralists.lyrasis.org</a> [<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org">mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org</a>]<b>On Behalf Of<span class="Apple-converted-space"> </span></b>Steven Majewski<br><b>Sent:</b><span class="Apple-converted-space"> </span>Friday, February 28, 2014 8:33 AM<br><b>To:</b><span class="Apple-converted-space"> </span>Archivesspace Users Group<br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [Archivesspace_Users_Group] EAD Import - cryptic error messages<o:p></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">Brad:<o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> Can  you express this requirement in terms of EAD elements  instead of  JSONModel schema types ? <o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> It’s that mapping that is giving me trouble:  trying to turn the schema references in those error messages<o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> into elements in the imported EAD that need to be addressed. <o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> Any ETA for that next release ? <o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">I’ve managed to fixup some of the import problems with a stylesheet: I’m up to 2749 files out of 4074 parsing successfully ( up from 0 and 300+ on my <o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">initial efforts ). That notes/0/content message is my greatest outstanding issue: <o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">1210  #<:ValidationException: {:errors=>{"notes/0/content"=>["At least 1 item(s) is required"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">  31  Unexpected Object Type in Queue: Expected archival_object got container<o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">  30  #<:ValidationException: {:errors=>{"dates"=>["one or more required (or enter a Title)"], "title"=>["must not be an empty string (or enter a Date)"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">  11  #<:ValidationException: {:errors=>{"instances/0/container/indicator_1"=>["Property is required but was missing"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">  11  #<:ValidationException: {:errors=>{"id_0"=>["Property is required but was missing"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   8  #<:ValidationException: {:errors=>{"extents"=>["At least 1 item(s) is required"], "notes/0/content"=>["At least 1 item(s) is required"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   6  #<:ValidationException: {:errors=>{"extents"=>["At least 1 item(s) is required"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   5  #<:ValidationException: {:errors=>{"notes/0/content"=>["At least 1 item(s) is required"], "id_0"=>["Property is required but was missing"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   5  #<:ValidationException: {:errors=>{"ead_id"=>["Must be 255 characters or fewer"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   2  #<:ValidationException: {:errors=>{"instances/0/container/type_1"=>["Property is required but was missing"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   1  Invalid schema given: string<o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   1  #<:ValidationException: {:errors=>{"record"=>["Can't unambiguously match {:reference_text=>\"(In non correspondence -legal)\"} against schema types: [\"JSONModel(:note_index_item) object\"]. Resolve this by adding a 'jsonmodel_type' property to {:reference_text=>\"(In non correspondence -legal)\"}"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   1  #<:ValidationException: {:errors=>{"notes/7/subnotes/0/content"=>["Must be 65000 characters or fewer"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   1  #<:ValidationException: {:errors=>{"notes/0/content"=>["At least 1 item(s) is required"], "notes/8/subnotes/0/content"=>["Must be 65000 characters or fewer"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   1  #<:ValidationException: {:errors=>{"instances/0/container/type_1"=>["Property is required but was missing"], "instances/0/container/indicator_1"=>["Property is required but was missing"]}}><o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(212, 192, 172);"><span style="font-family: Menlo, serif;">   1  #<:ValidationException: {:errors=>{"extents"=>["At least 1 item(s) is required"], "ead_id"=>["Must be 255 characters or fewer"]}}><o:p></o:p></span></div></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">— Steve M.<o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div></div></div></blockquote></div><br></body></html>