[Archivesspace_Users_Group] Extent Total

Custer, Mark mark.custer at yale.edu
Tue Feb 26 10:29:29 EST 2019


I’ve had to do something similar recently, so I’ve pared down the query that I used to just grab a few bits of data in the Resource table and then combine that with any extent information associated with those Resource records.  The output is one row per Resource.  If the Resource has multiple extent statements, then those multiple extent statements will be separated in the same cell with a “; “ (that’s the “group_concat” part in the SQL query).  For readability, I’ll include a link to the query that I used here:


There are lots of other tables that you might want to join, though, so as Alex mentions the queries can become quite complex.

I hope that helps, but let us know either way!


From: archivesspace_users_group-bounces at lyralists.lyrasis.org [mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org] On Behalf Of Alexander Duryee
Sent: Tuesday, 26 February, 2019 10:11 AM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] Extent Total


It's probably possible to do this via SQL queries, but it would require a fairly complex query to effectively rebuild the Resource record.  It would likely be easier to do this via requests against the API, which can return a list of all Resources in a repository; from there, you can query those Resources and extract their Extents.

After logging in via the API, you can use this endpoint to get a list of all Resources in a given repository:
(removing the brackets when substituting in your API address and repo ID)

This will return a list of Resource IDs.  You can pass each one to the Resource endpoint:
(again, removing brackets)

This will return the full JSON representation of the Resource.  The extent metadata lives in the 'extents' field; from there, you can extract the information that you need (e.g. the extent number, container summary, extent type, etc.).

Hope this helps - if you haven't worked with the API before, I'll be happy to send along tutorials/resources.


On Mon, Feb 25, 2019 at 6:05 PM Danielle Butler <dbutler at cals.org<mailto:dbutler at cals.org>> wrote:
I am trying to query our MySQL database to get a list of resource identifiers with corresponding extent numbers. I have been fighting with it for a while and I can get a list of extent numbers with no associated resource information with included extents for accessions. With no apparent way to discern which is which (I don’t want both accessions and resource extent data because the data with be duplicative for processed collections). I can get a list of resources, but without extent info. Does anyone know of a way to get both out of the database?


Danielle Butler, CA | Archivist
Butler Center for Arkansas Studies | Central Arkansas Library System
100 Rock Street
Little Rock, AR 72201

Archivesspace_Users_Group mailing list
Archivesspace_Users_Group at lyralists.lyrasis.org<mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>

Alexander Duryee
Metadata Archivist
New York Public Library
alexanderduryee at nypl.org<mailto:alexanderduryee at nypl.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20190226/9ecc01d7/attachment.html>

More information about the Archivesspace_Users_Group mailing list