Skip to content

Commit 76b2e95

Browse files
committed
[feature] sample schema for testing
1 parent ff8da2a commit 76b2e95

4 files changed

Lines changed: 97 additions & 0 deletions
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
version 1.0
2+
@totalColumns 42
3+
/*-------------------------------------------------------------------------------
4+
|Schema: ADM_363-technical-acquisition-with-minimal-transcription.csvs |
5+
|Authors: Nicki Welch |
6+
| David Underdown |
7+
|Purpose: To capture metadata about the digitisation of the ADM 363 series |
8+
| Primarily technical metadata, but with a minimal amount of |
9+
| transcription to verify that the records may be publicly released |
10+
| after receipt by The National Archives |
11+
|Revision: 1.0 first release |
12+
| 1.1 update as some official numbers only single digit |
13+
| 1.2 allow M as official number prefix too |
14+
| 1.3 further additions to prefixes, L, S, SS, SSX |
15+
| 1.4 allow for asterisk and ? in official number |
16+
| 1.5 further prefixes MX, KX, JX, and longer volume number |
17+
| 1.6 add explicit check that checksum is not that for a 0 byte file |
18+
| 1.7 Fix errors eg use correct not(), rather than isNot() |
19+
| 1.8 Allow brackets etc in comments, range checking for birth year |
20+
| ???? for birth year |
21+
| 1.9 Add piece check in ordinal: unique($piece,$item,$ordinal) |
22+
| Remove and in($resource_uri) from item: |
23+
| resource_uri, change starts(...) to |
24+
| regex("...") |
25+
| 2.0 Allow LX as a prefix too |
26+
|-------------------------------------------------------------------------------*/
27+
batch_code: length(10) regex("^ADM362B([0-9]{3})$")
28+
department: (is("ADM") if($file_path/notEmpty,in($file_path) and in($resource_uri)))
29+
series: is("362") and if($file_path/notEmpty,in($file_path) and in($resource_uri))
30+
piece: range(1,69720) if($file_path/notEmpty,in($file_path) and in($resource_uri))
31+
item: ((positiveInteger unique($piece,$item,$ordinal)) or empty) if($file_path/notEmpty,in($file_path))
32+
ordinal: if($item/empty,empty,unique($piece,$item,$ordinal))
33+
file_uuid: if($ordinal/empty,empty,uuid4 unique)
34+
file_path: uri if($ordinal/empty,empty,unique fileExists regex("^file:\/\/\/ADM_362\/[0-9]{1,5}\/[1-9][0-9]{0,4}\/[1-9][0-9]{0,4}_[0-9]{1,4}\.jp2$"))
35+
file_checksum: if($ordinal/empty,empty,not("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") and checksum(file($file_path),"SHA-256"))
36+
resource_uri: if($ordinal/notEmpty,uri and regex("^http://datagov.nationalarchives.gov.uk/66/ADM/362/[1-9][0-9]*/[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$"))
37+
scan_operator: if($ordinal/empty,empty,length(1,12) regex("^[0-9a-zA-Z]{1,12}$"))
38+
scan_id: if($ordinal/empty,empty,length(1,12) regex("^[0-9a-zA-Z_]{1,12}$"))
39+
scan_location: if($ordinal/empty,empty,regex("[-\w\s,]+"))
40+
scan_native_format: if($ordinal/empty,empty,regex("[0-9\w\s,.:]+"))
41+
scan_timestamp: if($ordinal/empty,empty,xDateTime)
42+
image_resolution: if($ordinal/empty,empty,is("300"))
43+
image_width: if($ordinal/empty,empty,positiveInteger)
44+
image_height: if($ordinal/empty,empty,positiveInteger)
45+
image_tonal_resolution: if($ordinal/empty,empty,is("24-bit colour"))
46+
image_format: if($ordinal/empty,empty,is("x-fmt/392"))
47+
image_colour_space: if($ordinal/empty,empty,is("sRGB"))
48+
process_location: if($ordinal/empty,empty,regex("[-\w\s,]+"))
49+
jp2_creation_timestamp: if($ordinal/empty,empty,xDateTime)
50+
uuid_timestamp: if($ordinal/empty,empty,xDateTime)
51+
embed_timestamp: if($ordinal/empty,empty,xDateTime)
52+
image_split: if($ordinal/empty,empty,is("yes") or is("no"))
53+
image_split_other_uuid: if($ordinal/empty,empty,if($image_split/is("yes"),uuid4,is("")))
54+
image_split_operator: if($ordinal/empty,empty,if($image_split/is("yes"),length(1,12) and regex("^[0-9a-zA-Z]{1,12}$"),is("")))
55+
image_split_timestamp: if($ordinal/empty,empty,if($image_split/is("yes"),xDateTime,is("")))
56+
image_crop: if($ordinal/empty,empty,is("auto") or is("manual") or is("none"))
57+
image_crop_operator: if($ordinal/empty,empty,if($image_split/is("manual"),length(1,12) and regex("^[0-9a-zA-Z]{1,12}$"),is("")))
58+
image_crop_timestamp: if($ordinal/empty,empty,if($image_crop/is("none"),empty,xDateTime))
59+
image_deskew: if($ordinal/empty,empty,is("yes") or is("no"))
60+
image_deskew_operator: if($ordinal/empty,empty,if($image_deskew/is("yes"),regex("^[0-9a-zA-Z]{1,12}$"),is("")))
61+
image_deskew_timestamp: if($ordinal/empty,empty,if($image_deskew/is("yes"),xDateTime,is("")))
62+
QA-code: regex("^[0-9/,]{1,2}$") @optional
63+
comments: regex("[-\w\s,\.\(\)\/'":\?]+") @optional
64+
transcribed_volume_number: if($item/empty,regex("[0-9A-Z\-\s]{1,19}"),is(""))
65+
transcribed_birth_date_day: if(($ordinal/empty and $item/notEmpty),regex("^\*|([0\?][1-9\?])|([1-2\?][0-9\?])|([3\?][0-1\?])$"),is(""))
66+
transcribed_birth_date_month: if(($ordinal/empty and $item/notEmpty),is("*") or is("?") or is("January") or is("February") or is("March") or is("April") or is("May") or is("June") or is("July") or is("August") or is("September") or is("October") or is("November") or is("December"), is(""))
67+
transcribed_birth_date_year: if(($ordinal/empty and $item/notEmpty),if(positiveInteger,range(1850,1914),regex("^1[7-9][0-9\?]{2}|\*|\?{4}$")),is(""))
68+
transcribed_official_number: if(($ordinal/empty and $item/notEmpty),regex("^(([CDP]\/)?([FJKLMS]|LX|MX|JX|KX|SS|SSX)[/?0-9]{1,6}|[/?1-9][/?0-9]{5}|\*)$"),is(""))
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "ADM_362-technical-acquisition-with-minimal-transcription",
3+
"name": "ADM_362-technical-acquisition-with-minimal-transcription",
4+
"version": "1.0.0",
5+
"date": "2015-11-01",
6+
"url": "https://github.com/digital-preservation/csv-schema/blob/master/example-schemas/ADM_362-technical-acquisition-with-minimal-transcription.csvs",
7+
"description": "Minor updates and bug fixes"
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
database /tmp/testdb
2+
table customer
3+
# indicate csv format with a delimiter of |
4+
csv |
5+
# Name Type Tag
6+
field CustID varchar(10) 1
7+
field Company varchar(80) 2
8+
field Address varchar(80) 3
9+
field City varchar(20) 4
10+
field State varchar(10) 5
11+
field Zip varchar(10) 6
12+
field Country varchar(10) 7
13+
field Phone varchar(20) 8
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "thunder-stone-sample-csvs",
3+
"name": "thunder-stone-sample-csvs",
4+
"version": "1.0.0",
5+
"date": "2015-11-01",
6+
"url": "https://docs.thunderstone.com/site/texisman/example_schema_comma_separated.html",
7+
"description": "sample file for testing"
8+
}

0 commit comments

Comments
 (0)