-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.html
529 lines (519 loc) · 27.1 KB
/
index.html
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<!DOCTYPE html>
<html>
<head>
<title>BagIt Profiles Specification 1.4.0</title>
<meta charset='utf-8'>
<script src='https://www.w3.org/Tools/respec/respec-w3c' async class='remove'></script>
<script class='remove'>
var respecConfig = {
specStatus: "unofficial",
shortName: "bagit-profiles",
editors: [
{
name: "Nick Ruest",
url: "https://ruebot.net",
orcid: "0000-0003-1891-1112",
company: "York University"
},
{
name: "Mark Jordan",
retiredDate: "2019-12-01",
company: "Simon Fraser University"
},
{
name: "Tim DiLauro",
orcid: "0000-0002-9997-3464",
company: "Lyrasis"
},
{
name: "John Scancella",
mailto: "[email protected]"
}
],
latestVersion: null,
edDraftURI: "https://bagit-profiles.github.io/bagit-profiles-specification/",
github: "https://github.com/bagit-profiles/bagit-profiles-specification",
wgPublicList: "https://groups.google.com/g/digital-curation",
otherLinks: [{
key: "Previous version",
data: [
{
value: "1.3.0",
href: "https://bagit-profiles.github.io/bagit-profiles-specification/v-1.3.0"
},
{
value: "1.2.0",
href: "https://github.com/bagit-profiles/bagit-profiles-specification/blob/c5ecfa8afe0e3de11eccb68f3f1e9d56197a1578/README.md"
},
{
value: "1.1.0",
href: "https://github.com/bagit-profiles/bagit-profiles-specification/blob/abaedfc3cec2bfaf20cd19d96893085a83ca6f3d/README.md"
}
]
},{
key: "Repository",
data: [
{
value: "Github",
href: "https://github.com/bagit-profiles/bagit-profiles-specification"
},
{
value: "Issues",
href: "https://github.com//bagit-profiles/bagit-profiles-specification/issues"
},
{
value: "Commits",
href: "https://github.com/bagit-profiles/bagit-profiles-specification/commits"
}
]
}],
};
</script>
</head>
<body>
<p class='copyright'>This document is licensed under a <a class='subfoot' href='https://creativecommons.org/publicdomain/zero/1.0/' rel='license'>CC0 1.0 Universal (CC0 1.0) Public Domain Dedication</a>.</p>
<section id='abstract'>
<h2>Introduction</h2>
<p>
The purpose of the BagIt Profiles Specification is to allow creators and consumers of Bags to agree on optional components of the Bags they are exchanging. Details of the Profile are instantiated in a JSON ([[RFC8259]]) file that both the producing and consuming applications interpret using the conventions described below. The Profile file sits at an HTTP URI (e.g., `http://example.com/bagitprofiles/profile-bar-v0.1.json`), and can therefore be read by any number of applications creating or consuming Bags:
</p>
<p>
<pre>
BagIt Profile JSON file
/ \
v v
Bag creating app 1 --> Bag consuming app
Bag creating app 2
</pre>
</p>
<p>
This proposed Specification builds on the sample Profile included in the Library of Congress Bagger tool. However, that Profile was local to LC and not intended to be implemented widely. The proposed Specification is intended to be an optional extension to the cannonical BagIt spec, and in no way modifies that specification. Like [[RFC8493]], this specification is agnostic to the payload stored in a Bag's data directory.
</p>
<p>
Use cases for BagIt Profiles include distributed mass production of Bags, repository or application-specific content ingestion via Bags (e.g. SWORD, Archivematica), and Preservation-as-a-Service.
</p>
<h2>Workflow</h2>
<p>
The intended workflow for using a BagIt Profile is:
<ol>
<li>
The creator of the Bags ensures that Bags it produces meet all of the constraints expressed in the agreed-upon and published BagIt Profile file. The creator declares the `BagIt-Profile-Identifier` in the `bag-info.txt` file of the Bags.
</li>
<li>
The consumer of the Bags identifies the Profile(s) from the `BagIt-Profile-Identifier` field in their `bag-info.txt`. The consumer then retrieves the Profile file from its URI and validates incoming Bags against it; specifically, it must complete the Bag if `fetch.txt` is present, validate the complete Bag against the Profile, and then validate the Bag against the cannonical BagIt spec.
</li>
</ol>
</p>
<p>
Each of these steps may be performed by a separate tool or microservice; in fact, implementers may integrate validation functionality in tools that perform other Bag-processing functions. For example, the completion of a holey Bag might be performed by a more general Bag-processing tool and need not be delegated to a separate validation tool.
</p>
<p>
Some Profile constraints are fatal: for example, failure to validate 'Accept-Serialization' or 'Accept-BagIt-Version' implies that the rest of the bag is unverifiable and processing should stop. Therefore, the task that checks these two constraints should be performed as early as possible in the workflow. Processing may continue after non-fatal errors in order to generate a comprehensive error report.
</p>
</section>
<section id='sotd'>
</section>
<section id="conformance">
</section>
<section id="implementation-details">
<h2>Implementation Details</h2>
<p>
Bags complying to a BagIt Profile MUST contain the tag `BagIt-Profile-Identifier` in their `bag-info.txt`, which value is the URI of the JSON file containing the BagIt Profile it conforms to. This tag MAY be repeated if the Bag conforms to multiple BagIt Profiles. The URI that identifies the BagIt Profile SHOULD be versioned, e.g. `http://example.com/bagitprofiles/profile-bar-v0.1.json`.
</p>
<p>
Resolving the URI with `Accept: application/json` SHOULD provide a BagIt Profile as JSON according to this specification.
</p>
The following fields make up a BagIt Profile. Each field is a top-level JSON key, as illustrated in the examples that follow. LIST in the field definitions indicates that the key can have one or more values, serialized as a JSON array. Itemized values separated by a `|` indicate allowed options for that field.
</p>
<ol>
<li>
`BagIt-Profile-Info`:
<p>
A list of tags that describes the Profile itself. The following tags are required in this section: `Source-Organization`, `External-Description`, `Version`, and `BagIt-Profile-Identifier`. Starting with version [`v1.2.0`],
`BagIt-Profile-Version` is also required.
</p>
<p>
The `Source-Organization` and `External-Description` tags are taken from the reserved tags defined in [[!RFC8493]] <a href="https://tools.ietf.org/html/rfc8493#section-2.2.2">section 2.2.2</a>.
</p>
<p>
The value of `Version` contains the version of the Profile; the value of `BagIt-Profile-Identifier` is the URI where the Profile file is available, and will have the same value as the `BagIt-Profile-Identifier` tag in `bag-info.txt`.
</p>
<p>
The value of `BagIt-Profile-Version` contains the version of this specification that the BagIt Profile conforms to, e.g. `"1.3.0"`. Since the tag was introduced after version `1.1.0`, any profile not explicitly defining `BagIt-Profile-Version` should be treated as conforming to version `1.1.0` of this specification.
</p>
<p>
Inclusion of `Contact-Name`, `Contact-Phone` and `Contact-Email` is OPTIONAL as defined in [[RFC8493]] <a href="https://tools.ietf.org/html/rfc8493#section-2.2.2">section 2.2.2</a>, but is encouraged.
</p>
</li>
<li>
`Bag-Info`:
<p>
Specifies which tags are required, etc. in `bag-info.txt`. Each tag definition takes four optional parameters:
</p>
<ol>
<li>
`required` is true or false (default `false`) and indicates whether or not this tag is required.
</li>
<li>
`values` is a list of acceptable values. If empty or missing, any value is accepted.
</li>
<li>
`repeatable` is `true` or `false` (default `true`) to indicate whether or not this tag can be repeated in `bag-info.txt`.
</li>
<li>
`description` is a string providing notes or description related to this tag.
</li>
</ol>
<p>
Implementers may define in the `Bag-Info` section of their BagIt Profile whatever tags their application requires, i.e., tags defined here are not limited to the 'reserved metadata element names' identified in [[!RFC8493]] <a href="https://tools.ietf.org/html/rfc8493#section-2.2.2">section 2.2.2</a>.
</p>
<p>
The tag `BagIt-Profile-Identifier` is always required, but SHOULD NOT be listed under `Bag-Info` in the Profile.
</p>
</li>
<li>
`Manifests-Required`: LIST
<p>
Each manifest type in LIST is required. The list contains the type of manifest (not the complete filename), e.g. `["sha1", "md5"]`.
</p>
</li>
<li>
`Manifests-Allowed`: LIST
<p>
If specified, only the manifest types in LIST are permitted. The list contains the type of manifest (not the complete filename), e.g. `["sha1", "md5"]`.
</p>
<p>
When specified along with `Manifests-Required`, `Manifests-Allowed` must include at least all of the manifest types listed in `Manifests-Required`.
</p>
<p>
If not specified, all manifest types are permitted.
</p>
</li>
<li>
`Allow-Fetch.txt`: `true`|`false`
<p>
A fetch.txt file is allowed within the bag. Default: `true`
</p>
</li>
<li>
`Fetch.txt-Required`: `true`|`false`
<p>
Only specify when `Allow-Fetch.txt` is `true`. Default is `false`.
</p>
</li>
<li>
`Data-Empty`: `true`|`false`
<p>
If `true` then the `/data` directory must contain either
no files or a single zero byte length file. If `false`,
no constraints are placed on the `/data`
directory. Default is `false`.
</p>
</li>
<li>
`Serialization`: `forbidden`|`required`|`optional`
<p>
Allow, forbid or require serialization of Bags. Default is `optional`.
</p>
</li>
<li>
`Accept-Serialization`: LIST
<p>
A list of MIME types acceptable as serialized formats. E.g. "application/zip". If serialization has a value of required or optional, at least one value is needed. If serialization is forbidden, this has no meaning.
</p>
</li>
<li>
`Accept-BagIt-Version`: LIST
<p>
A list of BagIt version numbers that will be accepted, e.g. "1.0". At least one version is required.
</p>
</li>
<li>
`Tag-Manifests-Required`: LIST
<p>
Each tag manifest type in LIST is required. The list contains the type of manifest (not the complete filename), e.g. `["sha1", "md5"]`.
</p>
</li>
<li>
`Tag-Manifests-Allowed`: LIST
<p>
If specified, only the tag manifest types in LIST are permitted. The list contains the type of manifest (not the complete filename), e.g. `["sha1", "md5"]`.
</p>
<p>
When specified along with `Tag-Manifests-Required`, `Tag-Manifests-Allowed` must include at least all of the tag manifest types listed in `Tag-Manifests-Required`.
</p>
<p>
If not specified, all tag manifest types are permitted.
</p>
</li>
<li>
`Tag-Files-Required`: LIST
<p>
A list of a tag files that MUST be included in a conformant Bag. Entries are full path names relative to the Bag base directory. As per [[RFC8493]] <a href="https://tools.ietf.org/html/rfc8493#section-2.2.4">section 2.2.4</a>, these tag files need not be listed in tag manifiest files. `Tag-Files-Required` SHOULD NOT include `bag-info.txt` (which is always required), nor any required manifest files, which instead are required by `Manifests-Required` and `Tag-Manifests-Required`.
</p>
<p>
Every file in `Tag-Files-Required` MUST also be covered by the path patterns in `Tag-Files-Allowed`.
</p>
</li>
<li>
`Tag-Files-Allowed`: LIST
<p>
A list of tag files that MAY be included in a conformant Bag. Entries are either full path names relative to the bag base directory or path name patterns in which asterisks can represent zero or more characters (c.f. <a href="http://man7.org/linux/man-pages/man7/glob.7.html">glob(7)</a>).
</p>
<p>
Conformants bags MUST NOT contain any payload that does not match the specified `Tag-Files-Allowed`. If `Tag-Files-Allowed` is not provided, its value is assumed to be `['*']`, i.e. all tag files are allowed.
</p>
<p>
As per [[RFC8493]] <a href="https://tools.ietf.org/html/rfc8493#section-2">section 2</a>, these tag files need not be listed in tag manifest files. `Tag-Files-Required` SHOULD NOT include `bag-info.txt` (which is always required), nor any required manifest files, which instead are required by `Manifests-Required` and `Tag-Manifests-Required`.
</p>
<p>
At least all the tag files listed in `Tag-Files-Required` MUST be in included in `Tag-Files-Allowed`.
</p>
</li>
<li>
`Payload-Files-Required`: LIST
<p>
A list of a payload files and/or directories that MUST be included in a conformant Bag. Entries are full path names relative to the Bag base directory, e.g. `data/LICENSE.txt` or `data/src/`. Paths requiring directory existence MUST end with `/`, indicating that in conformant Bags, the directory MUST be present with at least one file or subdirectory (which may have a placeholder file to indicate an empty directory, see [[RFC8493]] <a href="https://tools.ietf.org/html/rfc8493#section-2.1.3">section 2.1.3</a>).
</p>
<p>
Every file in `Payload-Files-Required` MUST also be covered by the path patterns in `Payload-Files-Allowed`.
</p>
</li>
<li>
`Payload-Files-Allowed`: LIST
<p>
A list of payload files or directories that MAY be included in a conformant Bag. Each entry MUST be either a full path name relative to the bag base directory, or a path name pattern in which asterisks can represent zero or more characters (c.f. [glob(7)](http://man7.org/linux/man-pages/man7/glob.7.html)). Paths requiring permitted directories MUST end with `/*` (not `/`).<br>
</p>
<p>
Conformants bags MUST NOT contain any payload that does not match the specified `Payload-Files-Allowed`. If `Payload-Files-Allowed` is not provided, its value is assumed to be ['*'], i.e. all payload files and directories are allowed.
</p>
<p>
At least all the payload paths listed in `Payload-Files-Required` MUST be covered by the list of path patterns in `Payload-Files-Allowed`.
</p>
</li>
</ol>
</section>
</section>
<section id='examples'>
<h2>Examples</h2>
<section id='bagProfileFoo'>
<h3>
<a href="https://raw.githubusercontent.com/bagit-profiles/bagit-profiles/master/bagProfileFoo.json" target="_blank">
bagProfileFoo.json
</a>
</h3>
<pre>
{
"BagIt-Profile-Info":{
"BagIt-Profile-Identifier":"http://www.library.yale.edu/mssa/bagitprofiles/disk_images.json",
"BagIt-Profile-Version": "1.1.0",
"Source-Organization":"Yale University",
"Contact-Name":"Mark Matienzo",
"External-Description":"BagIt Profile for packaging disk images",
"Version":"0.3"
},
"Bag-Info":{
"Bagging-Date":{
"required":true
},
"Source-Organization":{
"required":true,
"values":[
"Simon Fraser University",
"York University"
]
},
"Contact-Phone":{
"required":true
}
},
"Manifests-Required":[
"md5"
],
"Allow-Fetch.txt":false,
"Serialization":"required",
"Accept-Serialization":[
"application/zip",
"application/tar"
],
"Accept-BagIt-Version":[
"0.96",
"0.97"
]
}
</pre>
</section>
<section id='bagProfileBar'>
<h3>
<a href="https://raw.githubusercontent.com/bagit-profiles/bagit-profiles/master/bagProfileBar.json" target="_blank">
bagProfileBar.json
</a>
</h3>
<pre>
{
"BagIt-Profile-Info":{
"BagIt-Profile-Identifier":"http://canadiana.org/standards/bagit/tdr_ingest.json",
"BagIt-Profile-Version": "1.2.0",
"Source-Organization":"Candiana.org",
"Contact-Name":"William Wueppelmann",
"Contact-Email":"[email protected]",
"External-Description":"BagIt Profile for ingesting content into the C.O. TDR loading dock.",
"Version":"1.2"
},
"Bag-Info":{
"Source-Organization":{
"required":true,
"values":[
"Simon Fraser University",
"York University"
]
},
"Organization-Address":{
"required":true,
"values":[
"8888 University Drive Burnaby, B.C. V5A 1S6 Canada",
"4700 Keele Street Toronto, Ontario M3J 1P3 Canada"
]
},
"Contact-Name":{
"required":true,
"values":[
"Mark Jordan",
"Nick Ruest"
]
},
"Contact-Phone":{
"required":false
},
"Contact-Email":{
"required":true
},
"External-Description":{
"required":true
},
"External-Identifier":{
"required":false
},
"Bag-Size":{
"required":true
},
"Bag-Group-Identifier":{
"required":false
},
"Bag-Count":{
"required":true
},
"Internal-Sender-Identifier":{
"required":false
},
"Internal-Sender-Description":{
"required":false
},
"Bagging-Date":{
"required":true
},
"Payload-Oxum":{
"required":true
}
},
"Manifests-Required":[
"md5"
],
"Allow-Fetch.txt":false,
"Serialization":"optional",
"Accept-Serialization":[
"application/zip"
],
"Tag-Manifests-Required":[
"md5"
],
"Tag-Files-Required":[
"DPN/dpnFirstNode.txt",
"DPN/dpnRegistry"
],
"Accept-BagIt-Version":[
"0.96"
]
}
</pre>
</section>
</section>
<section id='ABNF' class=informative>
<h2>ABNF</h2>
<p>
The Augmented Backus-Naur Form (ABNF) rules provided below are non-normative. If there is a discrepancy between requirements in the normative sections and the ABNF, the requirements in the normative sections prevail.
</p>
<p>
Some definitions use the core rules as defined in [[RFC5234]] <a href="https://tools.ietf.org/html/rfc5234#appendix-B.1">appendix B.1</a>.
</p>
<p>
For addr-spec see [[RFC5322]], <a href="https://tools.ietf.org/html/rfc5322#section-3.4.1">section 3.4.1</a>.
</p>
<p>
For absolute-URI see [[RFC3986]], <a href="https://tools.ietf.org/html/rfc3986#section-4.3">section 4.3</a>.
</p>
<p>
<section id='BagitProfileJsonfileABNF'>
<h3>Bagit Profile Json file</h3>
</section>
<pre>
profile = "{" profile-info-section bag-info-section bag-requirements-section "}"
profile-info-section = DQUOTE "BagIt-Profile-Info" DQUOTE ":{" mandatory-profile-info optional-profile-info "},"
mandatory-profile-info = profile-info-source-organization
profile-info-external-description
profile-info-version
profile-info-bagit-profile-identifier
profile-info-bagit-profile-version
profile-info-source-organization = DQUOTE "Source-Organization" DQUOTE ":" quoted-value ","
profile-info-external-description = DQUOTE "External-Description" DQUOTE ":" quoted-value ","
profile-info-version = DQUOTE "Version" DQUOTE ":" quoted-version ","
profile-info-bagit-profile-identifier = DQUOTE "BagIt-Profile-Identifier" DQUOTE ":" quoted-uri ","
profile-info-bagit-profile-version = DQUOTE "BagIt-Profile-Version" DQUOTE ":" quoted-version
optional-profile-info = [optional-profile-info-contact-name]
[optional-profile-info-contact-phone]
[optional-profile-info-contact-email]
optional-profile-info-contact-name = "," DQUOTE "Contact-Name" DQUOTE ":" quoted-value
optional-profile-info-contact-phone = "," DQUOTE "Contact-Phone" DQUOTE ":" quoted-value
optional-profile-info-contact-email = "," DQUOTE "Contact-Email," DQUOTE ":" quoted-email-address
bag-info-section = DQUOTE "Bagit-Info" DQUOTE ":{" bag-info-key-values "},"
bag-info-key-values = bag-info-key-value *("," bag-info-key-value)
bag-info-key-value = quoted-value ":{" requirements "},"
requirements = [required] [repeatable] [description] [values]
required = DQUOTE "required" DQUOTE ":" quoted-boolean ","; Default=false
repeatable = DQUOTE "repeatable" DQUOTE ":" quoted-boolean ","; Default=true
description = DQUOTE "description" DQUOTE ":" quoted-value
values = DQUOTE "values" DQUOTE ":[" quoted-values "]"
bag-requirements-section = manifests-required
manifests-allowed
allow-fetch
fetch-required
data-empty
serialization
accept-serialzation
accept-bagit-version
tag-manifests-required
tag-manifests-allowed
tag-files-required
[tag-files-allowed] ;If Tag-Files-Allowed is not provided, its value is assumed to be ['*'], i.e. all tag files are allowed.
manifests-required = DQUOTE "Manifests-Required" DQUOTE ":[" quoted-values "],"
manifests-allowed = DQUOTE "Manifests-Allowed" DQUOTE ":[" quoted-values "],"
allow-fetch = DQUOTE "Allow-Fetch.txt" DQUOTE ":" quoted-boolean ","
fetch-required = DQUOTE "Fetch.txt-Required" DQUOTE ":" quoted-boolean ","; Default=false
data-empty = DQUOTE "Data-Empty" DQUOTE ":" quoted-boolean ","; Default=false
serialization = DQUOTE "Serialization" DQUOTE ":" DQUOTE ( "forbidden" / "required" / "optional" ) DQUOTE ","; Default=optional
accept-serialzation = DQUOTE "Accept-Serialization" DQUOTE ":[" quoted-values "],"
accept-bagit-version = DQUOTE "Accept-BagIt-Version" DQUOTE ":[" quoted-version *("," quoted-version) "],"
tag-manifests-required = DQUOTE "Tag-Manifests-Required" DQUOTE ":[" quoted-values "],"
tag-manifests-allowed = DQUOTE "Tag-Manifests-Allowed" DQUOTE ":[" quoted-values "],"
tag-files-required = DQUOTE "Tag-Files-Required" DQUOTE ":[" quoted-values "],"
tag-files-allowed = DQUOTE "Tag-Files-Allowed" DQUOTE ":[" quoted-values "]"
quoted-value = DQUOTE 1*VCHAR DQUOTE
quoted-values = quoted-value *("," quoted-value)
quoted-version = DQUOTE DIGIT *("." DIGIT) DQUOTE
quoted-uri = DQUOTE absolute-URI DQUOTE ;See https://tools.ietf.org/html/rfc3986#section-4.3
quoted-email-address = DQUOTE addr-spec DQUOTE ;See https://tools.ietf.org/html/rfc5322#section-3.4.1
quoted-boolean = DQUOTE boolean DQUOTE
</p>
</section>
</body>
</html>