<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Carlos,<div class=""><br class=""></div><div class="">I think you can solve this by inserting above line 24:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>return false unless AgentManager.known_agent_type?(record.class.record_type) || record.class.record_type == ‘subject'</div><div class=""><br class=""></div><div class="">Brian</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 27, 2015, at 9:31 PM, Carlos Lemus <<a href="mailto:carlos.lemus@unlv.edu" class="">carlos.lemus@unlv.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello Brian,<div class=""><br class=""></div><div class="">I just noticed something actually, that lines 47-50 are preventing a proper return value</div><div class=""><br class=""></div><div class=""><span class="" style="white-space:pre"> </span> <a href="https://github.com/l3mus/ArchivesSpace-authority-project/blob/master/unlv_importer/backend/model/unlv_marcxml_converter.rb#L47-L50" class="">https://github.com/l3mus/ArchivesSpace-authority-project/blob/master/unlv_importer/backend/model/unlv_marcxml_converter.rb#L47-L50</a></div><div class=""><br class=""></div><div class="">After removing those log values I get something like this. It's so close, I think the right agent is there, but now it's trying to export a resource, instead of an agent.</div><div class=""><br class=""></div><div class=""><span style="color:rgb(51,238,51);font-family:monospace;font-size:13px;line-height:12.381px;white-space:pre;background-color:rgb(51,51,51)" class="">extents : At least 1 item(s) is required
dates : At least 1 item(s) is required
title : Property is required but was missing
For JSONModel(:resource):
#<JSONModel(:resource) {"jsonmodel_type"=>"resource", "external_ids"=>[], "subjects"=>[], "linked_events"=>[], "extents"=>[], "dates"=>[], "external_documents"=>[], "rights_statements"=>[], "linked_agents"=>[{"role"=>"subject", "terms"=>[], "ref"=>"/agents/people/import_fda55473-b8f5-43c1-85a3-955b37a57c28"}], "restrictions"=>false, "revision_statements"=>[], "instances"=>[], "deaccessions"=>[], "related_accessions"=>[], "classifications"=>[], "notes"=>[], "uri"=>"/repositories/import/resources/import_4b9b1731-28ba-4e9b-afd6-ed2d933ce882", "finding_aid_description_rules"=>"rda", "id_0"=>"imported-e5c9504d-33ea-4538-91ef-54fdc2cd67d5", "level"=>"collection"}>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span><br class=""></div><div class=""><span style="color:rgb(51,238,51);font-family:monospace;font-size:13px;line-height:12.381px;white-space:pre;background-color:rgb(51,51,51)" class=""><br class=""></span></div><div class="">Thank you,</div><div class=""><br class=""></div><div class="">Carlos Lemus</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Oct 27, 2015 at 3:17 PM, Carlos Lemus <span dir="ltr" class=""><<a href="mailto:carlos.lemus@unlv.edu" target="_blank" class="">carlos.lemus@unlv.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hello Brian,<div class=""><br class=""></div><div class="">Sorry to keep bothering you with this, I was wondering if you got a chance to take a look at this.</div><div class=""><a href="https://github.com/l3mus/ArchivesSpace-authority-project/tree/master/unlv_importer" target="_blank" class="">https://github.com/l3mus/ArchivesSpace-authority-project/tree/master/unlv_importer</a><br class=""></div><div class=""><br class=""></div><div class="">Thank you,</div><div class=""><br class=""></div><div class="">Carlos Lemus</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Oct 6, 2015 at 3:01 PM, Carlos Lemus <span dir="ltr" class=""><<a href="mailto:carlos.lemus@unlv.edu" target="_blank" class="">carlos.lemus@unlv.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hey Brian,<div class=""><br class=""></div><div class="">Thank you for the reply, I have been able to piggy back of your code quite a bit which I'll update on github, but there is still some small issues. I've had to change the code a little bit to get it to work. For example it won't add the authority_id unless I first declare it because it's trying to add the authority_id to a nil object and then the source is duplicating multiple times. Also, the to_hash function wasn't seeming to return anything but to_hash(:raw) did. I have attached an example marcxml just in case. </div><div class=""><br class=""></div><div class="">Looking at the record, it doesn't seem like I'm even working with the right one. They all have different uri, especially the last one that is giving me the error. I think that last one that is giving me the error might be the one that actually needs to be changed, but I can't find where it's coming from. I'll keep looking into it.</div><div class=""><br class=""></div><div class="">I've got the other object to come out right </div><div class="">#<JSONModel(:agent_person) {"jsonmodel_type"=>"agent_person", "agent_contacts"=>[], "linked_agent_roles"=>[], "external_documents"=>[], "rights_statements"=>[], "notes"=>[], "dates_of_existence"=>[], "places"=>[], "names"=>[#<JSONModel(:name_person) {"jsonmodel_type"=>"name_person", "use_dates"=>[], "authorized"=>false, "is_display_name"=>false, "sort_name_auto_generate"=>true, "uri"=>nil, "primary_name"=>"Goodman", "rest_of_name"=>"Oscar Baylin,", "dates"=>"1939-", "name_order"=>"inverted", "source"=>"ingest ingest ingest", "authority_id"=>" n 2003051366"}>], "related_agents"=>[], "uri"=>"/agents/people/import_8a20f2f4-3560-41de-92b1-2aa888253143", "dates"=>"1939-"}><br class=""></div><div class=""><br class=""></div><div class="">and the record is still the same, maybe I should be updating this one instead I'm not sure.</div><div class="">#<JSONModel(:agent_person) {"jsonmodel_type"=>"agent_person", "agent_contacts"=>[], "linked_agent_roles"=>[], "external_documents"=>[], "rights_statements"=>[], "notes"=>[], "dates_of_existence"=>[], "places"=>[], "names"=>[#<JSONModel(:name_person) {"jsonmodel_type"=>"name_person", "use_dates"=>[], "authorized"=>false, "is_display_name"=>false, "sort_name_auto_generate"=>true, "uri"=>nil, "authority_id"=>"n 2003051366", "name_order"=>"direct", "source"=>"ingest"}>], "related_agents"=>[], "uri"=>"/agents/people/import_308b3936-d294-4e4e-96cb-e9d35447f8cb"}><br class=""></div><div class=""><br class=""></div><div class="">but I'm getting an error for a completely different one</div><div class=""><span style="background-color:rgb(255,255,255)" class=""><font class=""><span style="font-family:monospace;font-size:13px;line-height:14.8571px;white-space:pre-wrap" class=""> names/0/primary_name : Property is required but was missing
For JSONModel(:agent_person):
#<JSONModel(:agent_person) {"jsonmodel_type"=>"agent_person", "agent_contacts"=>[], "linked_agent_roles"=>[], "external_documents"=>[], "rights_statements"=>[], "notes"=>[], "dates_of_existence"=>[], "places"=>[], "names"=>[{"jsonmodel_type"=>"name_person", "use_dates"=>[], "authorized"=>false, "is_display_name"=>false, "sort_name_auto_generate"=>true, "uri"=>nil, "authority_id"=>"n 2003051366", "name_order"=>"direct", "source"=>"ingest"}], "related_agents"=>[], "uri"=>"/agents/people/import_40843311-b96a-4e59-9ebb-2d685e3e63ea"}></span><br class=""></font></span></div><div class=""><span style="font-family:monospace;font-size:13px;line-height:14.8571px;white-space:pre-wrap;background-color:rgb(255,255,255)" class=""><font class=""><br class=""></font></span></div><div class=""><span style="font-family:monospace;font-size:13px;line-height:14.8571px;white-space:pre-wrap;background-color:rgb(255,255,255)" class=""><font class="">Thank you</font></span></div><span class=""><font color="#888888" class=""><div class=""><span style="font-family:monospace;font-size:13px;line-height:14.8571px;white-space:pre-wrap;background-color:rgb(255,255,255)" class=""><font class="">
Carlos Lemus</font></span></div></font></span><div class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Oct 6, 2015 at 10:05 AM, Brian Hoffman <span dir="ltr" class=""><<a href="mailto:brianjhoffman@gmail.com" target="_blank" class="">brianjhoffman@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi Carlos,<div class=""><br class=""></div><div class="">I sent a pull request with an example of how you could merge names together. I hope this helps.</div><div class=""><br class=""></div><div class=""><a href="https://github.com/UNLV-Libraries/ArchivesSpace-authority-project/pull/2" target="_blank" class="">https://github.com/UNLV-Libraries/ArchivesSpace-authority-project/pull/2</a></div><span class=""><font color="#888888" class=""><div class=""><br class=""></div><div class="">Brian</div></font></span><div class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Sep 28, 2015, at 3:33 PM, Carlos Lemus <<a href="mailto:carlos.lemus@unlv.edu" target="_blank" class="">carlos.lemus@unlv.edu</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Hello Brian,<div class=""><br class=""></div><div class="">I was just checking if you got a chance to look at this issue. I am still having some trouble merging the two names together and was wondering if there was something else I needed to do.<br class=""><br class=""></div><div class="">Thank you,</div><div class=""><br class=""></div><div class="">Carlos Lemus</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Sep 21, 2015 at 3:34 PM, Carlos Lemus <span dir="ltr" class=""><<a href="mailto:carlos.lemus@unlv.edu" target="_blank" class="">carlos.lemus@unlv.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><font face="arial, helvetica, sans-serif" class="">Sorry Brian, the message got cut off. <span style="font-size:12.8px" class="">It's concatenating the names to the agent accordingly, however the names are still separated and I believe it is still looking for a primary name in that name </span></font><span class=""><div style="font-size:12.8px" class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Here is an example of the JSON</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div></span><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714px;white-space:pre-wrap;background-color:rgb(255,255,255)" class=""><font class="">For JSONModel(:agent_person):
#<JSONModel(:agent_person) {"jsonmodel_type"=>"agent_person", "agent_contacts"=>[], "linked_agent_roles"=>[], "external_documents"=>[], "rights_statements"=>[], "notes"=>[], "dates_of_existence"=>[], "names"=>[{"jsonmodel_type"=>"name_person", "use_dates"=>[], "authorized"=>false, "is_display_name"=>false, "sort_name_auto_generate"=>true, "uri"=>nil, "primary_name"=>"Goodman", "rest_of_name"=>"Oscar Baylin,", "dates"=>"1939-", "name_order"=>"inverted", "source"=>"ingest"}, {"jsonmodel_type"=>"name_person", "use_dates"=>[], "authorized"=>false, "is_display_name"=>false, "sort_name_auto_generate"=>true, "uri"=>nil, "authority_id"=>"n 2003051366", "name_order"=>"direct", "source"=>"ingest"}], "related_agents"=>[], "uri"=>"/agents/people/import_4cd10c10-330e-4d71-916d-1f354f4e1f89"}></font></span><br class=""></font></div><div class=""><span style="line-height:18.5714px;white-space:pre-wrap;background-color:rgb(255,255,255)" class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></span></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714px;white-space:pre-wrap;background-color:rgb(255,255,255)" class=""><font class="">and here is the code for the plugin </font></span><font class=""><span style="line-height:18.5714px;white-space:pre-wrap" class=""><a href="https://github.com/UNLV-Libraries/ArchivesSpace-authority-project/tree/master/unlv_importer" target="_blank" class="">https://github.com/UNLV-Libraries/ArchivesSpace-authority-project/tree/master/unlv_importer</a></span></font></font></div><div class=""><br class=""></div><div class="">I am still having trouble making it only one name_person instead of two under the agent person. I appreciate your help, sorry again for the delay and the double message.</div><div class=""><br class=""></div><div class="">Thank you,</div><div class="">Carlos Lemus</div><div class=""><div class=""><div class="gmail_extra"><font face="arial, helvetica, sans-serif" class=""><br class=""></font><div class="gmail_quote"><font face="arial, helvetica, sans-serif" class="">On Mon, Sep 21, 2015 at 3:30 PM, Carlos Lemus <span dir="ltr" class=""><<a href="mailto:carlos.lemus@unlv.edu" target="_blank" class="">carlos.lemus@unlv.edu</a>></span> wrote:<br class=""></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><font face="arial, helvetica, sans-serif" class="">Hello Brian,</font><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Sorry for getting back to you so late, I have been attempting to implement your code. It's concatenating the names to the agent accordingly, however the names are still separated and I believe it is still looking for a primary name in that name </font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Here is an example of the JSON</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div></div><div class=""><div class=""><div class="gmail_extra"><font face="arial, helvetica, sans-serif" class=""><br class=""></font><div class="gmail_quote"><font face="arial, helvetica, sans-serif" class="">On Fri, Sep 11, 2015 at 6:55 AM, Brian Hoffman <span dir="ltr" class=""><<a href="mailto:brianjhoffman@gmail.com" target="_blank" class="">brianjhoffman@gmail.com</a>></span> wrote:<br class=""></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><font face="arial, helvetica, sans-serif" class="">Hi Carlos,</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Yes, that’s actually something I overlooked. The way the importers are constructed, you can’t actually access the queue of records to import from the configuration code. So, I posted an example of a workaround (and some workarounds for a few other issues with the way importers are sub-classed):</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><a href="https://github.com/quoideneuf/aspace_single_agent_marcxml/blob/master/backend/model/marcxml_accession_converter.rb" target="_blank" class=""><font face="arial, helvetica, sans-serif" class="">https://github.com/quoideneuf/aspace_single_agent_marcxml/blob/master/backend/model/marcxml_accession_converter.rb</font></a></div><span class=""><font color="#888888" face="arial, helvetica, sans-serif" class=""><div class=""><br class=""></div><div class="">Brian</div></font></span><div class=""><div class=""><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><font face="arial, helvetica, sans-serif" class=""><br class=""></font><div class=""><blockquote type="cite" class=""><div class=""><font face="arial, helvetica, sans-serif" class="">On Sep 10, 2015, at 12:44 AM, Carlos Lemus <<a href="mailto:carlos.lemus@unlv.edu" target="_blank" class="">carlos.lemus@unlv.edu</a>> wrote:</font></div><font face="arial, helvetica, sans-serif" class=""><br class=""></font><div class=""><div dir="ltr" class=""><font face="arial, helvetica, sans-serif" class="">Hello Brian,</font><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Sorry if I'm not replying to our current thread correctly. I have yet to set up git for the plugin, but as soon as I do I will let you know. It is mostly some of the yale marcxml plugin setup and a lot of commented trial and error code at this point anyways. </font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">I tried the code you gave me and I think you understand perfectly what my issue is and I understand what you're trying to do by matching the agent to the current resource, exactly what I need. </font></div><div class=""><font face="arial, helvetica, sans-serif" class="">However, it's not working because the batch object seems to be Null. Not sure if maybe I'm required to import something.</font></div><div class=""><span style="color:rgb(51,238,51);font-size:13px;line-height:18.5714282989502px;white-space:pre-wrap;background-color:rgb(51,51,51)" class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></span></div><div class=""><span style="color:rgb(51,238,51);font-size:13px;line-height:18.5714282989502px;white-space:pre-wrap;background-color:rgb(51,51,51)" class=""><font face="arial, helvetica, sans-serif" class="">Error: #<NoMethodError: undefined method `working_area' for nil:NilClass></font></span></div><div class=""><span style="color:rgb(51,238,51);font-size:13px;line-height:18.5714282989502px;white-space:pre-wrap;background-color:rgb(51,51,51)" class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></span></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px;white-space:pre-wrap" class="">Here is the current state of my code </span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px;white-space:pre-wrap" class=""><div class=""><br class=""></div><div class="">UNLVMarcXMLAgentsConverter.configure do |config|</div></span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px;white-space:pre-wrap" class="">config["/record"][:map]["controlfield[@tag='001']"] = -> resource, node {</span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span>existing_agent_uri = resource.linked_agents.find {|link| link[:ref] =~ /people/ }</span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span>existing_agent = @batch.working_area.find {|obj| obj.uri == existing_agent_uri }</span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span>make(:name_person) do |name|</span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span>name.primary = node.xpath("subfield[@code='a']").inner_text</span></font></div><div class=""><span style="white-space:pre-wrap;line-height:18.5714282989502px" class=""><font face="arial, helvetica, sans-serif" class=""> </font></span></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span># add more name fields as necessary</span></font></div><div class=""><span style="white-space:pre-wrap;line-height:18.5714282989502px" class=""><font face="arial, helvetica, sans-serif" class=""> </font></span></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span>val = node.inner_text</span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span>name['authority_id'] = val </span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span>existing_agent.names << name</span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span> end</span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class=""><span style="white-space:pre-wrap" class=""> </span>}</span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px" class="">end</span><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px;white-space:pre-wrap" class="">Thanks for the quick reply by the way. I would have gotten to you sooner, but I didn't get an email </span><span style="line-height:18.5714px;white-space:pre-wrap" class="">that you had replied. I'll keep an eye on the listserv from now on. </span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px;white-space:pre-wrap" class=""><br class=""></span></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="line-height:18.5714282989502px;white-space:pre-wrap" class="">Carlos Lemus</span></font></div></div>
</div></blockquote></div><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div></div></div></blockquote></div><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div>
</div></div></blockquote></div><br class=""></div></div></div></div>
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></div></div>
</blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>