Running the SAFBuilder and Zipping the SAF Directory




Albin O. Kuhn Library & Gallery - Staff Wiki


Running the SAFBuilder and Zipping the SAF Directory

  1. Running the SAFBuilder and Zipping the SAF Directory Combine all parts of the load into 1 Excel file and 1 directory with all of the files.

  2. Search the dc.genre column for 17. If there are any with 17, the publisher and genres in them need to be completed before moving on.

  3. Search the date issued column for an / and then sort by date to check for any that aren’t in the correct format and fix.

  4. Find and replace all instance of || (blank space ||) with ||

  5. Find and replace all instance of || (|| blank space) with ||

  6. Find and fix any single |

  7. Find and fix any |||

  8. Search the filename column for 1 blank space to ensure there are no spaces in the file names.

  9. Search for n/a in the entire spreadsheet and delete it where it’s been filled in.

  10. Search for any empty cells in the relation.IsPartOf column and if there are any, complete them.

  11. Check that Faculty Collection and Student Collections are correct.cc

  12. Check for duplicate values by select the title column, then going to conditional formatting and selecting duplicate values, click ok, then go to filter, and filter by color.

  13. Run the program that checks the files directory against the file names given in the spreadsheet. It will produce a missing files report identifying files missing and files not used. Correct any problems identified by the report before moving on.

  14. Create a new sheet in the Excel file and copy and paste the columns to be loaded, everything from dc.identifier.citation thorugh filename, into it and save it.

  15. While on the Excel sheet with the files to be loaded, save as, and change the file type to comma delimited csv (not the UTF8 format--it will cause the load to fail). In the tools go to web options and ensure that the encoding is set to Unicode (UTF-8), then save.

  16. Close the .csv in Excel, and open it with Notepad++. Save it as UTF 8 file by selecting in the menus Encoding>UTF-8 >> save) and close the file in Notepad++.

  17. Be sure the csv is closed in all programs.

  18. Use the modernized version of the SAFBuilder, here, https://github.com/hernanhlagos/SAFBuilder/ , to transform the metadata and files into SAF format. After downloading, use the Windows installer to install it: https://github.com/hernanhlagos/SAFBuilder/releases/tag/v2.0.0 .

  19. When you run the program, you’ll see a window like this:

    image.png
  20. Add the path to the CSV in the first box and it will autofill into th next 3 boxes. Make sure “Crear Zip” is unchecked. Click "Generar Paquete SAF" to create the SAF directory.

  21. Check the SAF Directory. It should contain the files that are being loaded to the item (unless link only), a contents file, a dublin_core.xml file, and a metadata_dcterms.xml file as shown below (only if there are orcids being added). If the contents are different (no metadata_dcterms.xml is ok), something is wrong. Stop here and ask Michelle.

  22. image-20250530-184205.png

     

Run the Date Format Checker Script

The Script is here:

Instructions for running it is here:

Correct any incorrectly formatted dates, and rerun the SAFBuilder and this script until all dates are correctly formatted.

Run the Collection Mapping Program

Installation instructions are here: User Documentation for Mapping Script

The program is here:

The program will add collection files to each subdirectoy in the SAF directory with the handles of the collections the work will be mapped to.

  1. Run the Script:

    • Double-click the mapping_script.py file to execute the script.

    • Alternatively, run the script from the command line using the following command:

python Mapping_file_creation.py

  1. Browse and Select Files:

    • Click on the "Browse" button next to "Folder Path" to select the folder containing metadata files. (SimpleArchiveFormat folder)

    • Click on the "Browse" button next to "Excel File" to select the Collections Excel file.

  2. Execute Script:

    • After selecting the folder and Excel file, click on the "Run Script" button.

    • The script will process the metadata files, map the collections, and generate collections files for each item.

  3. View Logs:

    • Logs for the script execution are stored in a file named mapping.log which is in the same folder where script file is stored.

    • This log file provides information about any errors encountered during the process.

    • If the log shows XML errors, it failed to run on the items with the errors. Correct them using Notepad, and then rerun the mapping program.

    • If the 2nd log shows errors, they are collections that didn’t match the collection spreadsheet. If they are collection that should have been added, manually add their handle to the collection file being careful not to add any extra characters or returns to the file.

  4. Script Completion:

    • Once the script completes execution, a message box will appear indicating the successful creation of files or any errors encountered.

Run the Empty or Missing Collection File Script

The script is here:

Instructions for running it are here:

Add any missing collections or collections files before moving on

Zip the Final SimpleArchiveFormat directory and send it Tech Support

 

  1. Zip the final SimpleArchiveFormat directory by:

    1. navigating to the directory that the final SimpleArchiveFormat directory is in, using ls to view the contents of the directory you're in and cd to change directories.Use the command ls to list all the files in the directory, and cd to change the directory to navigate to the directory with the safbulider.sh file. Use the cd command alone to go up a level in the directory. Remember directory names, file names and commands are all case sensitive. You can use the up arrow to cycle through previous commands so that you don't have to retype. When you push enter to run the command, you'll be prompted to enter your password.

  2. Zip the SimpleArchiveFormat directory using the command zip -r myfilename.zip SimpleArchiveFormat/

  3. Send the zipped SAF directory to Joseph Andrew Koivisto <jkoivist@umd.edu> and Nima Asadi <nasadi1@umd.edu> requesting that they load it. You can attach it and it will automatically be added to Google Drive and you’ll be prompted to give mdsoar-help access when you click send. Give them edit access.

  4. Create a subtask on the load that says “waiting for tech support to load” and attach your final combined spreadsheet there.

 


Albin O. Kuhn Library & Gallery . University of Maryland, Baltimore County . 1000 Hilltop Circle . Baltimore MD 21250
(410) 455-2232. Questions and comments to: Web Services Librarian