Bulk metadata updates¶
While individual objects' metadata can usually be corrected through the normal Web browser interface, in some cases you may have dozens or even hundreds of items that need the same correction. These corrections may be made in bulk, with the help of Islandora Datastreams I/O and text editing tools on your computer such as BBedit (Mac) or Notepad++ (Windows).
To make bulk updates:
- Export your MODS datastreams with Islandora Datastreams I/O
- Find and replace the metadata you need to change using a text editor on your computer
- Import your edited datastreams
For detailed instructions, you can follow our video walkthrough, or the documentation below.
Export MODS datastreams¶
Identify the objects that need changing¶
To bulk export MODS datastreams, you will first need either a list of PIDs, or a Solr query. The easiest way to find that information is to use Islandora Solr Facet Pages (see the Metadata Corrections documentation for details).
If you are using Islandora Solr Facet Pages:
- On the page for the metadata field in question, click into the value that needs to be changed. For example, on your list of genre terms, you find a term that needs to be changed: "brochure" should be "brochures".
- In the URL bar for the facet page, you'll find the Solr query at the end:
https://arcabc.ca/islandora/search/%2A%3A%2A?f%5B0%5D=mods_genre_ms%3A%22brochure%22
The snippet we're looking for ismods_genre_ms%3A%22brochure%22
. - Convert encoded characters to human-readable ones. The above example becomes
mods_genre_ms:"brochure"
.
If you've found your objects with a search, you can extract the Solr query from the URL in the same way.
Alternatively, you can record your PIDs manually or export a CSV.
To produce a search result CSV, you can configure Solr to provide one:
- Go to
/admin/islandora/search/islandora_solr/settings
- Under "Secondary display profiles", check "CSV"
- Under Display Fields, make sure
PID
is one of the fields present. - Your search results will now produce a downloadable CSV, which will include the objects' PIDs.
Export the Datastreams¶
- Open Islandora Datastreams I/O at
admin/islandora/datastreams_io/export
(Islandora -> Islandora Datastreams Input/Output Relationships -> Export). - Under "Datastream", select MODS.
- Under "Select Objects", choose either "Solr query" or "List of PID values" as required.
- In the text area, either paste the Solr query you identified (e.g.
mods_genre_ms:"brochure"
) or your list of PIDs (one per line). - Click "Export batch" and download the Zip file.
Bulk edit your MODS¶
Unzip the file you downloaded, and then open one of the MODS XML files in your text editor. The following instructions are specifically for BBedit, but a similar process will apply to any editor.
- Find the snippet of XML that needs to be changed. Be sure to select the entire XML snippet -- both opening and closing tags -- to ensure you don't replace other text in your file.
- In our example, you'll highlight and copy the snippet
<genre authority="aat">brochure</genre>
.
- In our example, you'll highlight and copy the snippet
- Under the Search menu, open "Multi-File Search".
- In the "Find" field, paste your metadata snippet:
<genre authority="aat">brochure</genre>
- In the "Replace" field, enter the complete replacement version (including opening and closing tags):
<genre authority="aat">brochures</genre>
- In the "Search In" field, select the folder containing all of the files that need to be changed.
- If you're confident in your changes, click "Replace All". Otherwise, start with "Find All" to make sure you've identified things correctly.
- If not all of the files get changed, your original metadata may be using a different authority. Try editing the "find" field and change the authority to
authority="marcgt"
or even no authority at all, to catch all the edge cases.
- If not all of the files get changed, your original metadata may be using a different authority. Try editing the "find" field and change the authority to
- Confirm your changes are producing valid XML, using a validator like xmlvalidation.com or xmllint.
Import the edited MODS datastreams¶
- Without changing the filenames, zip your edited MODS XML files
- In your repository, go to Islandora Datastreams I/O -> Import
- Upload your zipped file, submit, and click Finish