[Archivesspace_Users_Group] searching for suppressed records?

Lora Woodford Lora.Woodford at lyrasis.org
Tue Jun 2 14:41:38 EDT 2020


Hi Donnelly,

Sorry for a belated reply, but I thought someone else might get to this one sooner.

As to the first part of the question – how to find suppressed records – I can think of three different ways to go about doing this that each have their pros/cons depending on your setup there, the number of repositories you have, the permissions of various users, and your access to and/or level of comfort with the underlying ArchivesSpace database and/or the API.

1) You can get the Staff interface to return a normal looking set of search results for resources with the status of suppressed by slightly altering the existing URL you get when you do the following:

  *   Browse > Resources
  *   Use the left sidebar to filter to Published
  *   Change the “published” in the URL to “suppressed”
So, in test.archivesspace.org, I can see all the suppressed records in the YNHSC repository by visiting: http://test.archivesspace.org/staff/resources?filter_term%5B%5D=%7B%22suppressed%22%3A%22true%22%7D

This has two drawbacks as far as I can see.  1) the results will be limited to the current repository to which you are logged in; and 2) actually doing something with the list of results could be somewhat manual and require a lot of clicking.  But, if you are most comfortable in the staff interface and/or only have access to the staff interface, this might be your best approach.

2) Second, you can go a step further and use the API search endpoints to return a full listing of all the resource records with a suppressed status of true.  Assuming the user that you log into the API with has full permissions to view suppressed records across all repositories, this has the added benefit of returning all hits across your entire installation of ArchivesSpace.  Similarly, you could build upon this API call to programmatically do the rest of your request – export the relevant records and/or delete them – by writing a script that iterates through the results that you get by this initial search request.  Obviously, the barrier to entry is higher here, but I suspect many of the API knowledgeable folks and/or folks working on the ArchivesSnake library, or, possibly, others who have done exactly this type of task could get you started on your way and/or share their prior work in this area.

A query returning the suppressed records on test.archivesspace.org would look something like this (line breaks added so that it’d be easier to read): http://test.archivesspace.org/staff/api/search?page=1&filter={"query": {"op":"AND", "subqueries":[{"jsonmodel_type":"field_query","field":"primary_type","value":"resource","literal":true},
{"jsonmodel_type":"field_query","field":"suppressed","value":"true","literal":true}],"jsonmodel_type":"boolean_query"},
"jsonmodel_type":"advanced_query"}

Note that search results are paged, so if you have a ton of suppressed records, you’ll have to iterate over many pages of results.  You can set the page_size (equal to or less what the max_page_size is set to in your config.rb) as an additional parameter to your request.

3) Finally, if you have access to your database (ideally a read-only copy of your database when initially testing) you can use something along the lines of the following sequel query to return all resources with a suppressed status of true (or, in the case of the DB, `1`).  This would work across repositories and then, as with option 1 above, you could choose how you wish to proceed with this list from there.

SELECT * FROM resource WHERE suppressed=1;

Hope others chime in with how they’ve tackled similar projects, and happy to follow up if you have other questions.

Best,

Lora

--
Lora J. Woodford
Junior Developer
lora.woodford at lyrasis.org<mailto:lora.woodford at lyrasis.org>
800.999.8558 x4808
Cell: 404.877.8158

[signature_658561908]


From: <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of "Walton, Donnelly" <dfwalton at ua.edu>
Reply-To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Date: Tuesday, May 26, 2020 at 1:02 PM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: [Archivesspace_Users_Group] searching for suppressed records?








 Hi!

Is there a way to search for suppressed resource records? We have suppressed hundreds for a project. I want to find them, export the data as XML or PDF (maybe both), and delete them.



Thanks,
Donnelly Walton

University of Alabama Libraries Special Collections
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20200602/95b862d9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 113751 bytes
Desc: image001.png
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20200602/95b862d9/attachment.png>


More information about the Archivesspace_Users_Group mailing list