UP | HOME

BagIT

The following is with reference to the The BagIt File Packaging Format (V1.0).

Note:

"A bag can specify payload content indirectly via a "fetch.txt" file that lists URLs for content that can be fetched over the network to complete the bag …" BagIt (Wikipedia)

In the words of the RFC:

"For reasons of efficiency, a bag MAY be sent with a list of files to be fetched and added to the payload before it can meaningfully be checked for completeness." https://datatracker.ietf.org/doc/html/rfc8493#section-2.2.3

Note also:

Starting with BagIt 1.0, bag creation and validation tools MUST support the SHA-256 and SHA-512 algorithms [RFC6234] and SHOULD enable SHA-512 by default when creating new bags. For backwards compatibility, implementers SHOULD support MD5 [RFC1321] and SHA-1 [RFC3174]. Implementers are encouraged to simplify the process of adding additional manifests using new algorithms to streamline the process of in-place upgrades.

https://datatracker.ietf.org/doc/html/rfc8493#section-2.4

This suggests the following workflow. Bags for the Digital Library Development Center (DLDC) and the OCHRE Data Service (ODS) will point to digital masterfiles and derivative images (in the case of image-based collections) in the Digitization Unit's staging area, as well as descriptive, technical, and rights metadata, and OCR files where applicable, from which the DLDC and ODS can take what they need; in the case of the DLDC this will be everything, since everything needs to be deposited in the Library Digital Repository (LDR).

Our bags might look like this.

b2n88mp9vs7k/
|── manifest-sha512.txt
|    49afbd86a1ca9f34b677a3f09655eae9 data/pres2025-0001/preservation/pres2025-0001_0001.pf.tif
|    49afbd86a1ca9f34b677a3f09655123a data/pres2025-0001/preservation/pres2025-0001_0002.pf.tif
|    ...
|  
|── fetch.txt
|    https://s8.lib.uchicago.edu/pres-xfer/pres2025-0001/preservation/pres2025-0001_0001.pf.tif
|         216951362 data/pres2025-0001/preservation/pres2025-0001_0001.pf.tif                           
|    https://s8.lib.uchicago.edu/pres-xfer/pres2025-0001/preservation/pres2025-0001_0002.pf.tif
|         219868123 data/pres2025-0001/preservation/pres2025-0001_0002.pf.tif
|    ...
|
|── media-type.txt
|    image/tiff data/pres2025-0001/preservation/pres2025-0001_0001.pf.tif
|    image/tiff data/pres2025-0001/preservation/pres2025-0001_0002.pf.tif
|    ...
|
data/
└── pres2025-0001/
    ├── preservation/                   # Preservation files (TIFF)
    │   ├── pres2025-0001_0001.pf.tif
    │   ├── pres2025-0001_0002.pf.tif
    │   └── ...
    ├── viewer/                         # Viewer Access Files (Tiled Pyramidal TIFF)
    │   ├── pres2025-0001_0001.vaf.tif
    │   ├── pres2025-0001_0002.vaf.tif
    │   └── ...
    ├── alto/                           # ALTO XML (Analyzed Layout and Text Object)
    │   ├── pres2025-0001_0001.xml
    │   ├── pres2025-0001_0002.xml
    │   └── ...
    ├── text/                           # Plaintext OCR (per-page)
    │   ├── pres2025-0001_0001.txt
    │   ├── pres2025-0001_0002.txt
    │   └── ...
    ├── pres2025-0001.mets.xml          # METS file (preservation and structural metadata)
    ├── pres2025-0001.txt               # Full-book OCR
    ├── pres2025-0001.pdf               # Access PDF
    └── pres2025-0001.manifest.json     # IIIF Presentation 3.0 manifest
|
|── bag-info.txt
|    Bag-Software-Agent: bagit.py v1.9.0 <https://github.com/LibraryOfCongress/bagit-python>
|    Bagging-Date: 2026-01-22
|    Collection-Name: social-scientists-map-chicago
|    External-Identifier: info:b2gg00s0zd8p
|    Internal-Sender-Identifier: G4104-C6-1933-U5-a                                 [this name/value pair must be included]
|    Resource-Title: Map of Chicago, showing original subdivisions, 1830 to 1843    [omit this name/value pair if the value is unavailable]
|    Resource-Date: 1932?                                                           [omit this name/value pair if the value is unavailable]
|    Resource-Description:                                                          [omit this name/value pair if the value is unavailable]
|    Resource-Constraints: http://creativecommons.org/licenses/by-nc/4.0/
|    Payload-Oxum: 112556347.5
|    Source-Organization: University of Chicago Library, Digitization Unit
|
|── bagit.txt                                                                             
|    BagIt-Version: 1.0
|    Tag-File-Character-Encoding: UTF-8

The preceding is for objects which are multipart. For objects which are not multipart, we would simplify the filename, for example:

└── pres2025-0001/
    ├── preservation/                   # Preservation files (TIFF)
    │   ├── pres2025-0001.pf.tif   
    ├── viewer/                         # Viewer Access Files (Tiled Pyramidal TIFF)
    │   ├── pres2025-0001.vaf.tif  
    ├── alto/                           # ALTO XML (Analyzed Layout and Text Object)
    │   ├── pres2025-0001.xml      
    ├── text/                           # Plaintext OCR (per-page)
    │   ├── pres2025-0001.txt      

In these examples, the first "0001" after "pres2025" is part of the DU identifier. The second "0001", "0002", etc. is to indicate the structure of the object (part 1, part 2, etc.)

Here is a previously produced bag for a deposit for one of our digital collections which has not yet been moved into the OCFL file hierarchy in the LDR:

s8:/data/digital_collections_bags/guerrilla_television/MB_123-146/MB_Backup_123
bag-info.txt            bagit.txt               data                    manifest-sha512.txt     tagmanifest-sha512.txt

See http://libraryofcongress.github.io/bagit-python/.

For OCFL:

[object root]
...
├─ inventory.json
├─ inventory.json.sha512
├─ v1/
│   └─ content/
│        ├─ file.pf.tif
│        └─ file.info.txt
│        └─ ...

In the above, file.info.txt, which is a copy of bag-info.txt, is used instead of file.dc.xml or in addition to it, where it exists. Below is an example where both exist.

|── bag-info.txt
|    Bag-Software-Agent: bagit.py v1.9.0 <https://github.com/LibraryOfCongress/bagit-python>
|    Bagging-Date: YYYY-MM-DD
|    Collection-Name: university-of-chicago-convocation-programs
|    External-Identifier: info:b2gg00s0zd8p
|    Internal-Sender-Identifier: mvol-0447-2024-0601                                
|    Resource-Title: University of Chicago Convocation Programs      
|    Resource-Date: 2024-06-01                                                           
|    Resource-Description: Programs for the University of Chicago's quarterly convocations. List names, honors, and degrees of graduates.                                                      
|    Resource-Constraints: For programs from 1893-1988: https://rightsstatements.org/page/NoC-US/1.0/. For programs from 1989-present: https://rightsstatements.org/page/InC-NC/1.0/.
|    Payload-Oxum: 123456789.0
|    Source-Organization: University of Chicago Library, Digitization Unit
<?xml version="1.0"?>
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title>University of Chicago Convocation Programs</dc:title>
<dc:date>2024-06-01</dc:date>
<dc:identifier>b2gg00s0zd8p</dc:identifier>
<dc:description>Programs for the University of Chicago's quarterly convocations. List names, honors, and degrees of graduates.</dc:description>

Author: Charles Blair

Created: 2026-10-07 Wed 15:12

Validate