[Archivesspace_Users_Group] Repository record and corresponding agent representation

Custer, Mark mark.custer at yale.edu
Wed Nov 20 10:59:34 EST 2019


Julie,

Not sure if this is what you're asking about or not, but the following SQL query would return all of the repository IDs along with their corresponding corporate agent IDs:

SELECT
    r.id AS 'repository id',
    r.agent_representation_id as 'agent id',
    r.repo_code,
    r.name,
    CONCAT('/agents/corporate_entities/', r.agent_representation_id) as 'agent uri'
FROM
    repository r
;

As for the relationship, whenever a repository record is created in ArchivesSpace, a corresponding corporate entity agent is created at the same time.  Those records are linked in the repository record by means of the "agent_representation_id" attribute.  *The only repository in ArchivesSpace that should ever have a null value for the agent_representation_id would be the Global Repository* (see the "Conceptual trickery" paragraph at the bottom of this page, https://archivesspace.github.io/archivesspace/user/the-archivesspace-backend/).  That said, there is at least one major bug with how these records are linked, though:  If you edit a repository record after updating the linked corporate agent record (let's say you add an authority ID to the agent record and then update the link repository record), then that data will be removed from the agent record if it's not also in the repository record (and you cannot add an authority ID to a repository record, so boom, that value vanishes from the agent record).  I really think that needs to be addressed, otherwise there's not much purpose in having the records linked.

This is similar to what happens whenever a user record is created. In that case, a corresponding person agent is created at the exact same time (although that does mean that you cannot create a user record and have it linked to a software agent in ASpace, since you don't get to choose which type of agent record is created whenever you create a repository or user record).

As for what could be causing an issue in the PUI, it could either be an issue in the core code or an issue in a local plugin.  I'd start by looking for repository records that don't have that "agent_representation_id" value, though.  Do all of your repos have that?

Mark



From: archivesspace_users_group-bounces at lyralists.lyrasis.org [mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org] On Behalf Of Blake Carver
Sent: Wednesday, 20 November, 2019 8:35 AM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] Repository record and corresponding agent representation


>  "NoMethodError (undefined > method `[]=' for nil:NilClass)"

Usually when I see that error a restart will clear things up. It seems to be one of those very generic errors that pop up from time to time and I've never been able to find a consistent cause. I'm assuming that there's no other errors logged at the same time. Sometimes there's more useful stuff above and below the ol' "nil" error that could point to a more specific problem.

BUT

>  the PUI display of "collection inventory" is broken...

That leads me to believe there might be a problem with the index as well.  I'd try doing a full reindex.

If the restart/reindex doesn't get things back to where they should be, dial up the logelevel to debug and see if you can dig a new error out of the logs. There could be a problem in your data, but it's hard to tell until you try the restart/reindex.

________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org<mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org> <archivesspace_users_group-bounces at lyralists.lyrasis.org<mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org>> on behalf of Wetherill, Julie M. <julie_wetherill at harvard.edu<mailto:julie_wetherill at harvard.edu>>
Sent: Wednesday, November 20, 2019 8:02 AM
To: archivesspace_users_group at lyralists.lyrasis.org<mailto:archivesspace_users_group at lyralists.lyrasis.org> <archivesspace_users_group at lyralists.lyrasis.org<mailto:archivesspace_users_group at lyralists.lyrasis.org>>
Subject: [Archivesspace_Users_Group] Repository record and corresponding agent representation


Can anyone describe for me or point me to documentation about the relationship between a repository record and its corporate body agent representation? Twice recently, our ASpace PUI (v2.5.2) has been mysteriously disrupted by a bug that is associated with missing metadata in either a repository record or the parallel corporate-body agent record. In the first case, resources in a specific repository were not displaying and in the current case, the PUI display of "collection inventory" is broken. In both cases, this error was in the logs:



"NoMethodError (undefined > method `[]=' for nil:NilClass)"



This user list discussion thread: http://lyralists.lyrasis.org/mailman/htdig/archivesspace_users_group/2019-April/006715.html<https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Flyralists.lyrasis.org%2Fmailman%2Fhtdig%2Farchivesspace_users_group%2F2019-April%2F006715.html&data=02%7C01%7Cmark.custer%40yale.edu%7C75285117583344c3821d08d76dbe7adb%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C0%7C637098537193899396&sdata=wCjUfefO%2FKGc%2FaFiAHcLplL9e3zuQeFdsz%2B0V2Y%2FZXU%3D&reserved=0> refers to this error and says this about the issue and how to fix it: "The agent_representation_id value in the repository table was null. I 'fixed' it by making a small edit to the Repository and saving it." Unfortunately for us, this approach did not fix it although we have 30 repositories and haven't yet determined which repo record may be the issue (if it is the issue).



Any ideas? Thanks. -julie



Julie Wetherill

Library Technology Services

Harvard University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20191120/552c0490/attachment.html>


More information about the Archivesspace_Users_Group mailing list