-
Notifications
You must be signed in to change notification settings - Fork 4
/
DROID_integrity_check.csvs
48 lines (48 loc) · 2.69 KB
/
DROID_integrity_check.csvs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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: