Skip to content

Commit 1f2b53e

Browse files
authored
DD-1965 Add packaging format extension (#11)
When creating a storage root, copy the packaging-format-registry and property-registry extensions to its extensions directory. When adding a new version of an object, update the object-version-properties with a hard-coded (for now) packaging-format = DANS RDA BagPack Profile/0.1.0 property. Upgraded dans-ocfl-java-extensions and dans-layer-store-lib dependencies, so that the files in the extension folder are now also backed by the database and can therefore be retrieved faster. This is necessary for updating object-version-properties to be feasible.
1 parent ab4c3ae commit 1f2b53e

18 files changed

Lines changed: 579 additions & 7 deletions

File tree

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</parent>
2828

2929
<artifactId>dd-data-vault</artifactId>
30-
<version>0.9.1-SNAPSHOT</version>
30+
<version>0.10.0-SNAPSHOT</version>
3131

3232
<name>DD Data Vault</name>
3333
<url>https://github.com/DANS-KNAW/dd-data-vault</url>
@@ -73,6 +73,7 @@
7373
<dependency>
7474
<groupId>nl.knaw.dans</groupId>
7575
<artifactId>dans-ocfl-java-extensions-lib</artifactId>
76+
<version>0.5.0</version>
7677
</dependency>
7778
<dependency>
7879
<groupId>io.ocfl</groupId>

src/main/assembly/dist/cfg/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ dataVault:
6666
#
6767
ocflRepository:
6868
workDir: /data/vault/tmp
69+
rootExtensionsSourcePath: /etc/opt/dans.knaw.nl/dd-data-vault/ocfl-root-extensions
6970

7071
#
7172
# Default version information to be used when no version information is provided when adding an object version. Currently, there is no way to
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
DANS BagPack Profile v0.1.0
2+
===========================
3+
4+
Introduction
5+
------------
6+
7+
### Version
8+
9+
* Document version: 0.1.0
10+
* Publication date: N/A
11+
12+
### Status
13+
14+
The status of this document is DRAFT.
15+
16+
### Scope
17+
18+
This document specifies what constitutes a DANS BagPack in its most simple form. This version of the document is a preliminary release. The requirements in it
19+
are non-normative and therefore formulated as "SHOULD"-rules. BagPacks that declare themselves as following the DANS BagPack Profile v0.1.0 are a best effort
20+
and are not validated.
21+
22+
### Overview and Conventions
23+
24+
#### Keywords
25+
26+
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
27+
interpreted as described in [RFC 2119]{:target=_blank}.
28+
29+
The key word "SHOULD" is also used to specify requirements that are impossible or impractical to check by the archival organization (i.e. DANS). The client
30+
should do its best to meet these requirements, but not rely on their being validated by the archival organization.
31+
32+
#### Subdivisions
33+
34+
The requirements are subdivided into the following sections:
35+
36+
* RDA BagPack Related - requirements that refer back to the [RDA BagPack]{:target=_blank} specifications. If a bag only needs to comply with the RDA BagPack
37+
specifications, then it should be sufficient to only check this section.
38+
* Extra Requirements for DANS BagPack - requirements that are specific to the DANS BagPack Profile, and which are in addition to the RDA BagPack requirements.
39+
40+
The sections are numbered and may have numbered subsections. The requirements themselves are stated as numbered rules. Rules may have parts that are labeled
41+
with letters: (a), (b), (c), etc. To uniquely identify a specific rule, use the notation
42+
43+
```
44+
<section-nr>[.<subsection-nr>].<rule-nr> [(<letter>)]
45+
```
46+
47+
Example: `2.3.4 (e)` means part **e** of the fourth rule in subsection 3 of section 2.
48+
49+
50+
Requirements
51+
------------
52+
53+
### 1. RDA BagPack Related
54+
55+
The following items are required by the [RDA BagPack]{:target=_blank} specifications:
56+
57+
1. A DANS BagPack SHOULD be valid according to [BagIt v1.0]{:target=_blank}.
58+
2. A DANS BagPack SHOULD contain a file `metadata/datacite.xml` (a) this file SHOULD be valid according to the
59+
[DataCite schema version 4.0 or later]{:target=_blank}, except for the requirement that there MUST be a DOI present: a DOI is not required for a DANS
60+
BagPack; (b) [DataCite's recommended properties]{:target=_blank} SHOULD be present.
61+
3. Other files besides `datacite.xml` MAY be present in the `metadata` folder.
62+
4. The files in the `metadata` folder SHOULD be mentioned in the `tag-manifest` (this is optional in BagIt, but required by RDA BagPack).
63+
5. `BagIt-Profile-Identifier` SHOULD be provided.
64+
65+
### 2. Extra Requirements for DANS BagPack
66+
67+
The following items are required by the DANS BagPack Profile, in addition to the requirements of RDA BagPack:
68+
69+
1. `BagIt-Profile-Identifier` SHOULD contain `https://doi.org/10.17026/e948-0r32`.
70+
2. There SHOULD be a file called `metadata/pid-mapping.txt`.
71+
3. There SHOULD be a file called `metadata/oai-ore.jsonld`.
72+
73+
[RFC 2119]: {{ rfc_2119 }}
74+
[BagIt v1.0]: {{ bagit }}
75+
[RDA BagPack]: {{ rda_bagpack }}
76+
[DataCite schema version 4.0 or later]: {{ datacite_4_0 }}
77+
[DANS BagPack BagIt Profile]: {{ dans_bagpack_bagit_profile }}
78+
[DataCite's recommended properties]: {{ levels_of_obligation }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
3+
"BagIt-Profile-Info": {
4+
"BagIt-Profile-Identifier": "https://doi.org/10.17026/e948-0r32",
5+
"Source-Organization": "dans.knaw.nl",
6+
"Contact-Name": "DANS-KNAW",
7+
"Contact-Email": "info@dans.knaw.nl",
8+
"External-Description": "DANS BagPack Profile",
9+
"Version": "1.0.0"
10+
},
11+
"Bag-Info": {
12+
"Bagging-Date": {
13+
"required": true
14+
},
15+
"Source-Organization": {
16+
"required": false
17+
},
18+
"Contact-Name": {
19+
"required": true
20+
},
21+
"Contact-Phone": {
22+
"required": false
23+
},
24+
"Contact-Email": {
25+
"required": true
26+
},
27+
"External-Identifier": {
28+
"required": true
29+
},
30+
"External-Description": {
31+
"required": false
32+
},
33+
"Bag-Size": {
34+
"required": true
35+
},
36+
"Payload-Oxum": {
37+
"required": true
38+
},
39+
"Source-Identifier": {
40+
"required": false
41+
}
42+
},
43+
"Manifests-Required": [
44+
"sha1"
45+
],
46+
"Allow-Fetch.txt": false,
47+
"Serialization": "optional",
48+
"Accept-Serialization": [
49+
"application/zip",
50+
"application/tar",
51+
"application/tar+gzip"
52+
],
53+
"Accept-BagIt-Version": [
54+
"1.0"
55+
],
56+
"Tag-Manifests-Required": [
57+
"sha1"
58+
],
59+
"Tag-Files-Required": [
60+
"metadata/datacite.xml",
61+
"metadata/pid-mapping.txt",
62+
"metadata/oai-ore.jsonld"
63+
]
64+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extensionName": "packaging-format-registry",
3+
"packagingFormatDigestAlgorithm": "md5",
4+
"digestAlgorithm": "sha512"
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"manifest": {
3+
"7e33ca1db30a5e8a00f5ad0c0529509e": {
4+
"name": "DANS RDA BagPack Profile",
5+
"version": "0.1.0",
6+
"summary": "Extension of the RDA BagPack Profile for DANS"
7+
}
8+
}
9+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
94384db8fc982e39d9d9006718342db91a1718c19f7da759a8ca2f9e5ac2418ce54fabbeb2b1a0c41f0401373e5b85c4727fe30d5c2216df203bce40d6b12774 packaging_format_inventory.json
2+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extensionName": "property-registry",
3+
"propertyRegistry": {
4+
"packaging-format": {
5+
"description": "The packaging format of the current object version, as defined in the packaging-format-registry extension.",
6+
"type": "string",
7+
"required": true
8+
}
9+
}
10+
}

src/main/java/nl/knaw/dans/datavault/DdDataVaultApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public void run(final DdDataVaultConfig configuration, final Environment environ
8282
var itemStore = new LayeredItemStore(dao, layerManager, new StoreInventoryDbBackedContentManager());
8383
var ocflRepositoryProvider = createUnitOfWorkAwareProxy(OcflRepositoryProvider.builder()
8484
.itemStore(itemStore)
85+
.rootExtensionsSourcePath(configuration.getDataVault().getOcflRepository().getRootExtensionsSourcePath())
8586
.defaultVersionInfoConfig(configuration.getDataVault().getDefaultVersionInfo())
8687
.workDir(configuration.getDataVault().getOcflRepository().getWorkDir())
8788
.build());

0 commit comments

Comments
 (0)