Re: [Archivesspace_Users_Group] id=0 error on EAD XML import

2022-10-20 Thread Newhouse, Sarah
These are both incredibly helpful responses – thank you Andrew and Mark!


__

Sarah Newhouse   (she, her, hers)
Digital Preservation Archivist
Othmer Library of Chemical History
t. +1.215.873.8249

Science History Institute
Chemistry • Engineering • Life Sciences
315 Chestnut Street • Philadelphia, PA 19106 • U.S.A.
Learn about the scientific discoveries that changed our world at 
sciencehistory.org/learn<https://www.sciencehistory.org/learn>
From: archivesspace_users_group-boun...@lyralists.lyrasis.org 
 On Behalf Of Andrew 
Morrison
Sent: Thursday, October 20, 2022 4:35 AM
To: archivesspace_users_group@lyralists.lyrasis.org
Subject: Re: [Archivesspace_Users_Group] id=0 error on EAD XML import


Don't be surprised if the import fails again, with the same message but for a 
subrecord, or with a different message. That is because the ArchivesSpace EAD 
importer uses a SAX parser method 
(https://en.wikipedia.org/wiki/Simple_API_for_XML) to read the XML, not a DOM 
(Document Object Model) method. The former is faster and uses less memory, but 
cannot scan an entire XML file for issues and report back with a list of things 
to fix, as the latter would. That is why many people use a pre-import 
validation step to find most of the issues that might occur, without the 
laborious process of creating an import job, waiting for it to fail, then 
re-running.

Harvard have made theirs into a web service which you might find useful:

https://eadchecker.lib.harvard.edu/

I think it is fairly generic (unlike a similar validation script used here 
which imposes editorial restrictions as well.)

Andrew.


On 19/10/2022 22:19, Custer, Mark wrote:
Sarah,

I suspect that your EAD file is missing an archdesc/did/unitid field.  This is 
where ArchivesSpace pulls information to create its Identifier field for the 
new Resource (see the attached screenshot), which is a required element.

If you add something there, then I believe it should work.  Here’s an example 
from one of our EAD files, 
https://github.com/YaleArchivesSpace/Archives-at-Yale-EAD3/blob/master/brbl-ead/1000.xml#L80
  (this file is EAD3, but the archdesc/did/unitid construction looks the same 
in EAD2002).

As for why you don’t have one in your file, I expect that’s because the call 
number is stored in a related MARC holdings record, or somewhere else that’s 
not being migrated as part of the MARC XML to EAD conversion (e.g., an 099 
field).

Mark



From: 
archivesspace_users_group-boun...@lyralists.lyrasis.org<mailto:archivesspace_users_group-boun...@lyralists.lyrasis.org>
 
<mailto:archivesspace_users_group-boun...@lyralists.lyrasis.org>
 on behalf of Newhouse, Sarah 
<mailto:snewho...@sciencehistory.org>
Date: Wednesday, October 19, 2022 at 4:33 PM
To: Archivesspace Users Group 
<mailto:archivesspace_users_group@lyralists.lyrasis.org>
Subject: [Archivesspace_Users_Group] id=0 error on EAD XML import
Hi all,

I’m trying to import a test EAD file that I transformed from MARC XML as a 
trial run for doing this in batches. I knew it would be janky, but I can’t 
narrow in on the specific form of the jank here. When I import I get the error 
below (it’s long, apologies). My two best guesses are
a) ASpace is missing something in each XML element needed to create an ID in 
every one of the JSON fields below?  (which appears to be the entire resource 
record)
b) there’s something missing from the  element in the XML file? (which 
there shouldn’t be – I copied it in manually from an ASpace EAD export)

I know this id_0 error is vague and has confused other people before, but I 
couldn’t find enough information to help me narrow in on the specific issue is 
here.

Thanks!




The following errors were found:

id_0 : Property is required but was missing





 For JSONModel(:resource):

 #"resource", "external_ids"=>[], 
"subjects"=>[{"ref"=>"/subjects/import_e9b747a7-9d78-4dac-b424-51ff0dabc301"}, 
{"ref"=>"/subjects/import_b6e2afcf-be53-480e-981d-cc359ca31719"}, 
{"ref"=>"/subjects/import_24b83fea-3081-4770-a77b-a2b3e870d75a"}, 
{"ref"=>"/subjects/import_b5b565e8-4cf4-44ee-bef4-bb5d80ea6788"}, 
{"ref"=>"/subjects/import_30ccd3c2-8d46-4373-a803-9ff8f7ad3d7a"}, 
{"ref"=>"/subjects/import_68e70347-cfb7-4ccb-b1f9-2349ae2a3448"}, 
{"ref"=>"/subjects/import_c06a6464-07d2-4bb4-8305-c75da3453954"}, 
{"ref"=>"/subjects/import_7713afda-99d0-4382-b478-29c7c3a1167c"}, 
{"ref"=>"/subjects/import_0330ec33-8f81-46ed-b221-01bbf11d0cf2"}, 
{"ref"=>"/subjects/import_87b9ccf4-4873-4aa4-a951-a3eebb894f03"}, 
{"ref"=>"/subjects/import_eb959373-7080-4a29-9a16-6cf2f30ad375"},

Re: [Archivesspace_Users_Group] id=0 error on EAD XML import

2022-10-20 Thread Andrew Morrison
Don't be surprised if the import fails again, with the same message but 
for a subrecord, or with a different message. That is because the 
ArchivesSpace EAD importer uses a SAX parser method 
(https://en.wikipedia.org/wiki/Simple_API_for_XML) to read the XML, not 
a DOM (Document Object Model) method. The former is faster and uses less 
memory, but cannot scan an entire XML file for issues and report back 
with a list of things to fix, as the latter would. That is why many 
people use a pre-import validation step to find most of the issues that 
might occur, without the laborious process of creating an import job, 
waiting for it to fail, then re-running.


Harvard have made theirs into a web service which you might find useful:

https://eadchecker.lib.harvard.edu/

I think it is fairly generic (unlike a similar validation script used 
here which imposes editorial restrictions as well.)


Andrew.


On 19/10/2022 22:19, Custer, Mark wrote:


Sarah,

I suspect that your EAD file is missing an archdesc/did/unitid field. 
This is where ArchivesSpace pulls information to create its Identifier 
field for the new Resource (see the attached screenshot), which is a 
required element.


If you add something there, then I believe it should work.  Here’s an 
example from one of our EAD files, 
https://github.com/YaleArchivesSpace/Archives-at-Yale-EAD3/blob/master/brbl-ead/1000.xml#L80 
(this file is EAD3, but the archdesc/did/unitid construction looks the 
same in EAD2002).


As for why you don’t have one in your file, I expect that’s because 
the call number is stored in a related MARC holdings record, or 
somewhere else that’s not being migrated as part of the MARC XML to 
EAD conversion (e.g., an 099 field).


Mark

*From: *archivesspace_users_group-boun...@lyralists.lyrasis.org 
 on behalf of 
Newhouse, Sarah 

*Date: *Wednesday, October 19, 2022 at 4:33 PM
*To: *Archivesspace Users Group 


*Subject: *[Archivesspace_Users_Group] id=0 error on EAD XML import

Hi all,

I’m trying to import a test EAD file that I transformed from MARC XML 
as a trial run for doing this in batches. I knew it would be janky, 
but I can’t narrow in on the specific form of the jank here. When I 
import I get the error below (it’s long, apologies). My two best 
guesses are
a) ASpace is missing something in each XML element needed to create an 
ID in every one of the JSON fields below?  (which appears to be the 
entire resource record)
b) there’s something missing from the  element in the XML file? 
(which there shouldn’t be – I copied it in manually from an ASpace EAD 
export)


I know this id_0 error is vague and has confused other people before, 
but I couldn’t find enough information to help me narrow in on the 
specific issue is here.


Thanks!



The following errors were found:
     id_0 : Property is required but was missing
  
  
  For JSONModel(:resource):

  #"resource", "external_ids"=>[], "subjects"=>[{"ref"=>"/subjects/import_e9b747a7-9d78-4dac-b424-51ff0dabc301"}, {"ref"=>"/subjects/import_b6e2afcf-be53-480e-981d-cc359ca31719"}, {"ref"=>"/subjects/import_24b83fea-3081-4770-a77b-a2b3e870d75a"}, {"ref"=>"/subjects/import_b5b565e8-4cf4-44ee-bef4-bb5d80ea6788"}, {"ref"=>"/subjects/import_30ccd3c2-8d46-4373-a803-9ff8f7ad3d7a"}, {"ref"=>"/subjects/import_68e70347-cfb7-4ccb-b1f9-2349ae2a3448"}, {"ref"=>"/subjects/import_c06a6464-07d2-4bb4-8305-c75da3453954"}, {"ref"=>"/subjects/import_7713afda-99d0-4382-b478-29c7c3a1167c"}, {"ref"=>"/subjects/import_0330ec33-8f81-46ed-b221-01bbf11d0cf2"}, {"ref"=>"/subjects/import_87b9ccf4-4873-4aa4-a951-a3eebb894f03"}, {"ref"=>"/subjects/import_eb959373-7080-4a29-9a16-6cf2f30ad375"}, {"ref"=>"/subjects/import_5412219d-8ae6-4cf9-904f-f2ef463377b7"}, {"ref"=>"/subjects/import_2158afa2-e11b-4f15-a145-8d26f01eea6a"}, {"ref"=>"/subjects/import_1e46c0e2-5f32-4c0e-97f9-07ddf8eb9531"}, {"ref"=>"/subjects/import_310a1db4-7b94-4a72-82ca-120f408b82d7"}, {"ref"=>"/subjects/import_80cf34db-8f1e-4d19-8b01-a2f5332471a4"}, {"ref"=>"/subjects/import_a201450a-2a58-45fe-b85f-b499b45b4023"}, {"ref"=>"/subjects/import_1a9edf46-9143-42dd-a46c-ba3894c8d00d"}, {"ref"=>"/subjects/import_ab2fd197-ab6e-4c56-8c66-73832460557d"}], "linked_events"=>[], "extents"=>[{"jsonmodel_type"=>"extent", "import_context"=>" ... ", "number"=>"169", "extent_type"=>"Linear Feet", "portion"=>"whole"}], "lang_materials"=>[{"jsonmodel_type"=>"lang_material", "notes"=>[], "import_context"=>" ... ", "language_and_script"=>{"jsonmodel_type"=>"language_and_script", "language"=>"und"}}], "dates"=>[{"jsonmodel_type"=>"date", "import_context"=>" ... ", "date_type"=>"inclusive", "expression"=>"1921-1998.", "label"=>"creation"}], "external_documents"=>[], "rights_statements"=>[], "linked_agents"=>[{"ref"=>"/agents/people/import_b71f978e-703f-4bc5-8c8e-a3f9f4b5d47f", "role"=>"creator", "relator"=>"creator", "terms"=>[]}, 
{"ref"=>"/agents/families/import_1c6bec99-db8e-43c9-85b0-c2e36da5f606",