Instructions for validating an existing bag with the BagIt Python build.
From the BagIt spec,
A complete bag MUST have the following attributes:
- Every required element MUST be present.
- Every file in every payload manifest MUST be present.
- Every file in every tag manifest MUST be present. Tag files not listed in a tag manifest MAY be present.
- Every payload file MUST be listed in at least one manifest. Payload files MAY be listed in more than one payload manifest.
- Every element present MUST comply with this specification.
A valid bag MUST have the following attributes:
- The bag MUST be complete
- Every CHECKSUM in every payload manifest and tag manifest can be sucessfully verified against the contents of its corresponding FILENAME.
- Validate the bag you created. In Terminal, enter this command:
bagit.py --validate [drag and drop existing bag]
-
Is your bag valid? I hope so! The bag should contain files consistent with the original files and that are appropriately formed. Congratulations on your first bag validation! 👝✅
-
Try to validate a bag provided to you. Run the validation command again but this time on NDSR_BagIt_sample_02.
-
What message was printed in Terminal? Was it NDSR_BagIt_sample_02 is invalid: Oxum error. Found 3 files and 613223 bytes on disk; expected 3 files and 613217 bytes.?
- That's because this bag's payload had been modified. Take a peek in the t file. The text in this file has been changed, which BagIt recognized as a byte different of 6 bytes. No difference too small for BagIt to catch!
-
I have to be honest with you - I threw you another curveball! Open the tagmanifest-md5.txt file in NDSR_BagIt_sample_02. There's something in there that shouldn't be. But why didn't the validation error tell you that?
- According the BagIt spec, "tag files that do not appear in a tag manifest can be modified, added to, or removed from a bag without impacting the completeness or validity of the bag".
Still can't get enough BagIt? Check out more activities around creating, modifying, and validating bags.