Re: [Archivesspace_Users_Group] [External] Collection item count?

2022-09-27 Thread Corey Schmidt
Hi Karen and Paul,

2 ways come to mind for me: 1) Using the database, if you have access to it. 2) 
Using the API.

For using the database, it would be the quickest and easiest provided you have 
access to it via your hosting provider. If you do and are familiar with SQL, 
something like the following would work:

SELECT * FROM archival_object WHERE root_record_id = 704 AND (level_id = 892 OR 
level_id = 890)

root_record_id is the ASpace ID for the resource you are trying to isolate. 
level_id is whether the archival object is a “item” or a “file” – in the 
example, it searches for objects with either “item” or “file” level. I use 
MySQL Workbench and it gets me the # of objects returned for a quick and easy 
count.

For using the API, you don’t need special permissions from your hosting 
provider, so you can access the API just as easily as you would any data from 
the staff interface. This would be more involved, as you would need to write a  
script to execute, but if you’re familiar with Python or something of the like, 
it can be done. There are 2 endpoints that would seem useful for this: Get the 
list of URIs of this published resource and all published archival objects 
contained 
within<https://archivesspace.github.io/archivesspace/api/#get-the-list-of-uris-of-this-published-resource-and-all-published-archival-objects-contained-within-ordered-by-tree-order-i-e-if-you-fully-expanded-the-record-tree-and-read-from-top-to-bottom>,
 or Fetch tree information for the top-level resource 
record<https://archivesspace.github.io/archivesspace/api/#fetch-tree-information-for-the-top-level-resource-record>.
 The first endpoint would be good for getting all items that are published in a 
collection, but may include archival objects that are Series, sub-Series, etc. 
(aka not real items) and it excludes unpublished items. The second gets top 
level items, but if you have series, sub-series with children, then you would 
have to iterate through each of those to get an accurate count of every item 
(published or unpublished). Thankfully that endpoint gives you the data to 
point to those series/parents of children as precomputed waypoints, I believe, 
but it’s the more involved of the 2 endpoints to get right. Here’s an 
example<https://github.com/uga-libraries/aspace_scripts/blob/master/check_child_counts.py>
 when I used that endpoint to get all item counts that were greater or equal to 
1000.

Paul’s way of doing it is straightforward and easy, so if that works, then 
that’s what I would recommend.

Hope this helps,

Corey

From: archivesspace_users_group-boun...@lyralists.lyrasis.org 
 On Behalf Of Paul 
Sutherland
Sent: Friday, September 23, 2022 10:50 AM
To: Archivesspace Users Group 
Subject: Re: [Archivesspace_Users_Group] [External] Collection item count?

[EXTERNAL SENDER - PROCEED CAUTIOUSLY]
Hi Karen,
I would also like to know how to generate a report like this, but a quick 
approach in the meantime I've used before: export the collection as EAD, and 
search level="item" (or file, or whichever else) within the resulting EAD.
Best,
Paul

On Fri, Sep 23, 2022 at 10:35 AM Karen Urbec 
mailto:karen.ur...@whoi.edu>> wrote:
Hi Everyone,
I have what I thought would be a simple question, but it turns out is not so 
easy. I’m trying to get a complete item count from a collection, and I can’t 
see where that is listed or how to generate that report. I see where I can 
calculate the extent of each series, though those numbers don’t match what is 
in the series, so it’s unclear how that number is being calculated. This feels 
like such a simple question—I just want to know how many individual items are 
in a full collection, but we can’t seem to figure it out. Any help would be 
much appreciated!
Thanks,
Karen

Karen Urbec (she/her)
Institution Archivist, MBLWHOI Library
Data Library and 
Archives<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dla.whoi.edu_=DwMFAg=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM=70gVc8PkZ8LRd0WR_N4Lh2vwCTUp-4jc9IXouEpQ4Go=Rnof0V_8dF2SSnx87z3t24T9RgaGs6I68nqfaHsda3I=5C-WWCkA-lM0yH2SlCEexe6H3zyzooInWRAyfuCJ0L8=>
Woods Hole Oceanographic Institution
266 Woods Hole Road, MS#8, Woods Hole, MA 02543
508-289-2269
ORCID<https://urldefense.proofpoint.com/v2/url?u=https-3A__orcid.org_-2D0001-2D6673-2D4478=DwMFAg=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM=70gVc8PkZ8LRd0WR_N4Lh2vwCTUp-4jc9IXouEpQ4Go=Rnof0V_8dF2SSnx87z3t24T9RgaGs6I68nqfaHsda3I=qSbp388TjCHNqGzmVj-Aap5G-XcnCwyR3zDUBmLGBh4=>


___
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group@lyralists.lyrasis.org<mailto:Archivesspace_Users_Group@lyralists.lyrasis.org>
https://urldefense.proofpoint.com/v2/url?u=http-3A__lyralists.lyrasis.org_mailman_listinfo_archivesspace-5Fusers-5Fgroup=DwICAg=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM=70gVc8PkZ8LRd0WR_N4Lh2vwCTUp-4jc9IXouEpQ4Go=Rnof0V_8dF2SSnx87z3t24T9RgaGs6I68nq

Re: [Archivesspace_Users_Group] [External] Collection item count?

2022-09-23 Thread Paul Sutherland
Hi Karen,
I would also like to know how to generate a report like this, but a quick
approach in the meantime I've used before: export the collection as EAD,
and search *level="item" *(or file, or whichever else) within the resulting
EAD.
Best,
Paul

On Fri, Sep 23, 2022 at 10:35 AM Karen Urbec  wrote:

> Hi Everyone,
>
> I have what I thought would be a simple question, but it turns out is not
> so easy. I’m trying to get a complete item count from a collection, and I
> can’t see where that is listed or how to generate that report. I see where
> I can calculate the extent of each series, though those numbers don’t match
> what is in the series, so it’s unclear how that number is being calculated.
> This feels like such a simple question—I just want to know how many
> individual items are in a full collection, but we can’t seem to figure it
> out. Any help would be much appreciated!
>
> Thanks,
>
> Karen
>
>
>
> Karen Urbec (she/her)
>
> Institution Archivist, MBLWHOI Library
>
> Data Library and Archives
> 
>
> Woods Hole Oceanographic Institution
> 266 Woods Hole Road, MS#8, Woods Hole, MA 02543
>
> 508-289-2269
> ORCID
> 
>
>
>
>
> ___
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group@lyralists.lyrasis.org
>
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lyralists.lyrasis.org_mailman_listinfo_archivesspace-5Fusers-5Fgroup=DwICAg=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM=70gVc8PkZ8LRd0WR_N4Lh2vwCTUp-4jc9IXouEpQ4Go=Rnof0V_8dF2SSnx87z3t24T9RgaGs6I68nqfaHsda3I=YQX-6xZ7X0lHYQrkShkQIq_EHXiC1f3BmAAyzvWBcKc=
>


-- 
*Paul Sutherland* (he/his)
Archivist of Indigenous Materials
Center for Native American and Indigenous Research
Library & Museum
American Philosophical Society
105 S. 5th Street, 2nd Floor
Philadelphia, PA 19406
Lenapehoking
215-440-3408
amphilsoc.org/library/CNAIR
Browse our Indigenous Subject Guide 
and read our latest blog posts

Twitter: @paulssutherland 

*Becoming Weatherwise *showing at the APS Museum
, 4/8-12/30

*The APS has updated its COVID responses
. APS
buildings are open to staff and visitors, and it has expanded access to its
Reading Room services. Please read our updated Reading Room policies on our
website .*

*I respectfully acknowledge that I work and reside in Lenapehoking, the
homeland of the Lenape people in past, present, and future generations. I
​am grateful for the past and ongoing generosity of numerous Indigenous
communities and individuals who have offered guidance, expertise, and
opportunities for collaboration that make my work possible. *
___
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group@lyralists.lyrasis.org
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group