<div dir="ltr"><div dir="ltr"><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Alicia and Dave,</div><div><br></div><div>Thank you so much for your help! I was thrown by telephone having it's own URI, but I guess I'll just have to accept the new creation dates. We're using a hosted instance, so I unfortunately don't have MySQL access.</div><div><br></div><div>Dave-- the JSON payload already contains the original created_by information, so I don't think maually setting it by API is going to work. Like I said, not make or break, just nice-to-have. The information for subrecords doesn't even show in the staff interface, so I'm likely the only one who would ever notice that it's happening.</div><div><br></div><div>Best,</div><div>Rachel</div><div><br></div>--<div><br></div><div>Please note that I currently <b>do not have access to ARS email</b>. If you need to contact me, use my LAC address: <a href="mailto:rachel.donahue@lac-group.com" target="_blank">rachel.donahue@lac-group.com</a></div><div><br></div><div><span style="font-size:x-small">The information contained in this e-mail message is confidential. If you are not the intended recipient, any dissemination or copying is strictly prohibited. If you think that you have received this e-mail message in error, please contact the sender.</span><br></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
Message: 16<br>
Date: Fri, 11 Oct 2019 16:17:07 +0000<br>
From: "Detelich, Alicia" <<a href="mailto:alicia.detelich@yale.edu" target="_blank">alicia.detelich@yale.edu</a>><br>
To: Archivesspace Users Group<br>
<<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" target="_blank">archivesspace_users_group@lyralists.lyrasis.org</a>><br>
Subject: Re: [Archivesspace_Users_Group] Oddities when updating Agents<br>
via the API<br>
Message-ID: <<a href="mailto:5604120B-A726-4ED2-8537-0B94A6B49194@yale.edu" target="_blank">5604120B-A726-4ED2-8537-0B94A6B49194@yale.edu</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi Rachel,<br>
<br>
Basically, what you are seeing is that whenever a record is posted, all of its subrecords are deleted and recreated, even if no changes are made to the subrecords themselves. When this happens a new database identifier, create time, lock version etc. are assigned to each subrecord. I don?t think it?s a bug, per se, but it is an odd behavior that has come up numerous times in my work as well.<br>
<br>
I am not sure why the decision to design subrecords that way was made by the original developers of the application (if anyone has thoughts please let me know!), nor do I have a sense of the amount of work/consequences involved in updating the application so that subrecords are persistent.<br>
<br>
There isn?t a way to only post the changing fields via the API, since only top-level records (resources, archival objects, etc.) have their own URIs. An alternative solution would be to do a (very careful!) database update to the relevant field(s) in the relevant name table(s).<br>
<br>
Hope this helps,<br>
<br>
Alicia<br>
<br>
Alicia Detelich<br>
Archivist<br>
Manuscripts and Archives<br>
Yale University Libraries<br>
<br>
From: <<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" target="_blank">archivesspace_users_group-bounces@lyralists.lyrasis.org</a>> on behalf of Rachel Donahue <<a href="mailto:rachel.donahue@lac-group.com" target="_blank">rachel.donahue@lac-group.com</a>><br>
Reply-To: Archivesspace Users Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" target="_blank">archivesspace_users_group@lyralists.lyrasis.org</a>><br>
Date: Friday, October 11, 2019 at 11:52 AM<br>
To: "<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" target="_blank">archivesspace_users_group@lyralists.lyrasis.org</a>" <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" target="_blank">archivesspace_users_group@lyralists.lyrasis.org</a>><br>
Subject: [Archivesspace_Users_Group] Oddities when updating Agents via the API<br>
<br>
Hi all,<br>
<br>
I'm running some bulk updates to Agents (in this case people) via the API and noticed some rather odd changes to sub-records when I check the JSON after successfully running the update.<br>
<br>
1. Every sub-record (e.g. names, telephones) has replaced "created_by" with the user authenticated by the API and create_time with the time of the API call. The Agent itself retains its created_by and time, thankfully, but all the bits and pieces lose it.<br>
2. Possibly related to this, a new telephone number is created even though nothing about the phone number has changed. (e.g. what was /telephone/99 is now /telephone/204)<br>
3. The lock_version for the sub-records isn't changing from 0.<br>
<br>
The only thing changing in these updates is the name source and we're using ArchivesSpace 2.6.0. I have been reposting the entire object in the update--is it possible to post *only* the changing fields and perhaps avoid the problem?<br>
<br>
While this isn't a make-or-break problem, I'd really like to retain the created_by information for names, as it is often *not* the same as the person who created the initial record. I'm also not sure if this is a bug or something I'm doing wrong. Any insights would be much appreciated!<br>
<br>
Best,<br>
Rachel<br>
<br><br>
Message: 18<br>
Date: Sun, 13 Oct 2019 20:52:04 +0000<br>
From: "Mayo, Dave" <<a href="mailto:dave_mayo@harvard.edu" target="_blank">dave_mayo@harvard.edu</a>><br>
To: Archivesspace Users Group<br>
<<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" target="_blank">archivesspace_users_group@lyralists.lyrasis.org</a>><br>
Subject: Re: [Archivesspace_Users_Group] Oddities when updating Agents<br>
via the API<br>
Message-ID: <<a href="mailto:50E41CB5-5A5C-4359-B742-BDF5C9787A2E@harvard.edu" target="_blank">50E41CB5-5A5C-4359-B742-BDF5C9787A2E@harvard.edu</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
There are a lot of sub-records in ASpace that are essentially treated as ephemeral but which have full concrete tables backing them; they?re not addressable in the system, their representations in the JSONModel are as primitive values (strings, array of strings, etc) rather than objects, etc. Instances are kind of this way ? you can?t grab an instance, only the things attached to it, but it has a database ID, etc.<br>
<br>
You _might_ be able to insert refs to the subrecords that aren?t changing, rather than the values/records themselves? That _might_ keep the values the same, but I?m not sure it?ll be legal everywhere. You could also try explicitly setting created_by and created_at; I am at a conf but could poke at this later (maybe tonight or tomorrow) if you?ll remind me.<br>
<br>
--<br>
Dave Mayo (he/him)<br>
Senior Digital Library Software Engineer<br>
Harvard University > HUIT > LTS<br>
<br><br>
</blockquote></div></div>