pulibrary / aspace_helpers

methods and reports to support common SC activities in ArchivesSpace
1 stars 0 forks source link

C1491- remove access notes for lowest-level components in Writings series #345

Closed faithc closed 1 year ago

faithc commented 1 year ago

User story

Per a revision of the series-level access note for the Writings series (/repositories/5/archival_objects/1219229), access notes associated with components at the lowest level, which currently have the type "Restricted" selected, are no longer applicable. Please remove these access notes (those associated with the lowest-level components in the series). Per a query of the EAD, 883 components/archival objects have access notes.

Source of the data to be imported or updated

I'm not sure how to generate a list of URIs for only those archival objects/components with access notes, i.e., components at the lowest level; not all of the objects in the series have access notes. Attached is a list of URIs for all archival objects within the series. C1491_WritingsSeries_ArchivalObjects.xlsx

Implementation notes, if any

I don't think there are any factors that might affect the data update.

regineheberlein commented 1 year ago

@faithc Can you post the result of your query of the EAD here please? (The one with the access notes you want removed.)

regineheberlein commented 1 year ago

Preliminary analysis: ao aspace_C1491_c1 is

faithc commented 1 year ago

@faithc Can you post the result of your query of the EAD here please? (The one with the access notes you want removed.)

Query is probably too generous a word. Ha I basically just did a search for accessrestrict tags for the subseries within the first series (I deleted the remaining series in the EAD). And actually, it looks like there are 880 notes with type “restricted,” not 883. It looks like I can't attach xml files here. Should I email you the revised EAD file I used to do the search? Would that be helpful at all? I don't know how to write an xquery to extract certain elements to save as a spreadsheet.

regineheberlein commented 1 year ago

Hmmm. None of my queries (see above) get to 880. Let me ask you a few questions so I know what to query for:

Here is an XPath that will get you any leaf components within Series 1 that have an accessrestrict, which is what I'm understanding you're trying to get at--perhaps review that and let me know how it doesn't match your search criteria (since the number of results doesn't match yours)? I'm skeptical that it's really what you need, but it's a place to start.

//c[@id="aspace_C1491_c1"]//c[not(c)]/accessrestrict

faithc commented 1 year ago

Thanks, Regine! The results from the XPath you shared actually looks right. Not sure how I got 880.

In answer to your questions,

  1. Yes
  2. I'm looking to delete the entire restriction.
  3. I'm looking to delete restrictions with type "Restricted," which is what the XPath you shared seems to have located.
regineheberlein commented 1 year ago

No, the XPath above merely looks for the presence of an accessrestrict element. When controlling for the value of the rights-restriction attribute, I get to 867 components:

//c[@id="aspace_C1491_c1"]//c[not(c)]/accessrestrict[@rights-restriction="Restricted"]

Are these the ones you want to delete?

faithc commented 1 year ago

Gotcha. And yes, I believe those are the ones to delete. Would it be possible to delete these on the staging site first so that I can do a bit of QA before it's done in prod?

regineheberlein commented 1 year ago

Yes, that's part of our regular process. Though it's always good to get the parameters worked out as much as possible before the actual work commences to avoid significant duplication of effort!

faithc commented 1 year ago

Ok, great. I'm pretty certain those are the restrictions that need to go. Thanks!

regineheberlein commented 1 year ago

c[@id="aspace_C1491_c1"]//c[not(c)]/accessrestrict[@rights-restriction="Restricted"]/../did/unitid[@type="aspace_uri"]

C1491_restrictions_curis.csv

regineheberlein commented 1 year ago

Ok, can you QA on staging please?

faithc commented 1 year ago

Hi Regine-

This looks good to me overall. I see that there are 14 aggregate-level ao's in the first series with type "restricted," which I hadn't identified/accounted for before. It seems like any ao with type "restricted" could be included then in the update as opposed to just terminal components. I could also just delete these 14 restrictions manually once you update the record. Thanks.

regineheberlein commented 1 year ago

Ok, deleted 879 restriction notes based on this. ^ c[@id="aspace_C1491_c1"]//c/accessrestrict[@rights-restriction="Restricted"]/../did/unitid[@type="aspace_uri"]

log_delete_restrictions_C1491.txt

faithc commented 1 year ago

Great. Thanks, Regine!