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-boun...@lyralists.lyrasis.org
[mailto:archivesspace_users_group-boun...@lyralists.lyrasis.org] On Behalf Of
Blake Carver
Sent: Wednesday, 20 November, 2019 8:35 AM
To: Archivesspace Users Group
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-boun...@lyralists.lyrasis.org<mailto:archivesspace_users_group-boun...@lyralists.lyrasis.org>
mailto:archivesspace_users_group-boun...@lyralists.lyrasis.org>>
on behalf of Wetherill, Julie M.
mailto:julie_wether...@harvard.edu>>
Sent: Wednesday, November 20, 2019 8:02 AM
To:
archivesspace_users_group@lyralists.lyrasis.org<mailto:archivesspace_users_group@lyralists.lyrasis.org>
mailto:archivesspace_users_group@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-Apr