Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

49 lines (48 sloc) 2.69 KB
version 1.1
@totalColumns 18
/*-----------------------------------------------------------------------------\
| This schema is designed to run on a CSV exported from The National Archives' |
| DROID file format identification tool profile. It will report an error for |
| any files where the checksum does not match the one originally calculated |
| or if any files or folders have been added or removed since the original |
| The error report will give the data line number of the error, and also the |
| data line number where the CSV Validator first encountered that checksum. |
| These line numbers do not include the header row, so if viewing your CSV file|
| in Excel or OpenOffice Calc you will need to add one to the reported line |
| number to find the relevant entry. |
| |
| As folders do not have a checksum, we exclude them from the checksum check |
| by examining the URI field, if the URI ends with a slash, we check just that |
| the SHA256_HASH is empty. If the RESOURCE column from DROID were included in |
| the output could use if($RESOURCE/is("folder") to test instead. |
| to run this you will need to replace "files" in the integrityCheck test |
| with the name of the top level Folder in your DROID report. That is, if you |
| ran the report starting at, for example, C:\users\documents, replace |
| files with documents. |
| |
| We also need to skip files inside zips and other containers for this purpose |
| as it is sufficient to check that the container itself is unchanged. |
| |
| Authors: |
| David Underdown, The National Archives |
\-----------------------------------------------------------------------------*/
ID:
PARENT_ID:
URI: fileExists integrityCheck("","files","includeFolder")
//replace "files" in integrityCheck with name of top level folder within your DROID report (in quotes)
//Will probably need to add eg or starts("iso:") etc for each possible container type in the conditional
FILE_PATH:
NAME:
METHOD:
STATUS:
SIZE:
TYPE:
EXT:
LAST_MODIFIED:
EXTENSION_MISMATCH:
SHA256_HASH: if($URI/ends("/"),empty,if($URI/starts("file:"),checksum(file($URI),"SHA-256"),notEmpty)) //folders do not have a checksum, and CSV validator cannot access files in containers
FORMAT_COUNT:
PUID:
MIME_TYPE:
FORMAT_NAME:
FORMAT_VERSION:
You can’t perform that action at this time.