cocina-models 0.107.0 → 0.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +40 -18
- data/README.md +7 -31
- data/description_types.yml +2 -0
- data/docs/description_types.md +2 -0
- data/lib/cocina/generator/datatype.rb +1 -1
- data/lib/cocina/generator/generator.rb +1 -0
- data/lib/cocina/generator/schema_array.rb +1 -1
- data/lib/cocina/generator/schema_base.rb +10 -2
- data/lib/cocina/generator/schema_ref.rb +2 -2
- data/lib/cocina/generator/union_type.rb +1 -1
- data/lib/cocina/generator/vocab.rb +6 -5
- data/lib/cocina/models/access_role.rb +1 -0
- data/lib/cocina/models/admin_policy.rb +1 -0
- data/lib/cocina/models/admin_policy_access_template.rb +9 -3
- data/lib/cocina/models/admin_policy_administrative.rb +10 -1
- data/lib/cocina/models/admin_policy_lite.rb +3 -0
- data/lib/cocina/models/admin_policy_with_metadata.rb +1 -0
- data/lib/cocina/models/applies_to.rb +2 -1
- data/lib/cocina/models/barcode.rb +1 -0
- data/lib/cocina/models/business_barcode.rb +2 -0
- data/lib/cocina/models/catalog_link.rb +1 -0
- data/lib/cocina/models/catkey_barcode.rb +3 -0
- data/lib/cocina/models/citation_only_access.rb +2 -1
- data/lib/cocina/models/cocina_version.rb +2 -0
- data/lib/cocina/models/collection.rb +3 -1
- data/lib/cocina/models/collection_access.rb +6 -2
- data/lib/cocina/models/collection_identification.rb +8 -1
- data/lib/cocina/models/collection_lite.rb +7 -1
- data/lib/cocina/models/collection_with_metadata.rb +1 -0
- data/lib/cocina/models/contributor.rb +13 -3
- data/lib/cocina/models/copyright.rb +2 -0
- data/lib/cocina/models/created_in_folio_identifier.rb +2 -0
- data/lib/cocina/models/description.rb +14 -0
- data/lib/cocina/models/descriptive_access_metadata.rb +7 -0
- data/lib/cocina/models/descriptive_admin_metadata.rb +6 -0
- data/lib/cocina/models/descriptive_basic_value.rb +15 -3
- data/lib/cocina/models/descriptive_geographic_metadata.rb +1 -0
- data/lib/cocina/models/descriptive_grouped_value.rb +2 -1
- data/lib/cocina/models/descriptive_parallel_contributor.rb +11 -3
- data/lib/cocina/models/descriptive_parallel_event.rb +8 -1
- data/lib/cocina/models/descriptive_parallel_value.rb +2 -1
- data/lib/cocina/models/descriptive_value.rb +13 -2
- data/lib/cocina/models/descriptive_value_language.rb +5 -0
- data/lib/cocina/models/doi.rb +2 -1
- data/lib/cocina/models/doi_exceptions.rb +6 -1
- data/lib/cocina/models/dro.rb +4 -1
- data/lib/cocina/models/dro_access.rb +6 -2
- data/lib/cocina/models/dro_lite.rb +10 -1
- data/lib/cocina/models/dro_structural.rb +4 -0
- data/lib/cocina/models/dro_with_metadata.rb +2 -0
- data/lib/cocina/models/druid.rb +1 -0
- data/lib/cocina/models/embargo.rb +4 -1
- data/lib/cocina/models/event.rb +8 -0
- data/lib/cocina/models/file.rb +8 -3
- data/lib/cocina/models/file_set.rb +1 -0
- data/lib/cocina/models/file_use.rb +1 -0
- data/lib/cocina/models/folio_catalog_link.rb +3 -1
- data/lib/cocina/models/identification.rb +8 -1
- data/lib/cocina/models/lane_medical_barcode.rb +2 -0
- data/lib/cocina/models/language.rb +22 -3
- data/lib/cocina/models/language_tag.rb +2 -0
- data/lib/cocina/models/libraries_doi.rb +11 -0
- data/lib/cocina/models/license.rb +2 -0
- data/lib/cocina/models/mapping/to_mods/name_writer.rb +1 -1
- data/lib/cocina/models/migrated_from_symphony_identifier.rb +2 -0
- data/lib/cocina/models/migrated_from_voyager_identifier.rb +2 -0
- data/lib/cocina/models/preregistered_repository_doi.rb +12 -0
- data/lib/cocina/models/purl.rb +1 -0
- data/lib/cocina/models/related_resource.rb +17 -1
- data/lib/cocina/models/repository_doi.rb +13 -0
- data/lib/cocina/models/request_admin_policy.rb +3 -0
- data/lib/cocina/models/request_administrative.rb +2 -1
- data/lib/cocina/models/request_collection.rb +3 -0
- data/lib/cocina/models/request_description.rb +16 -1
- data/lib/cocina/models/request_dro.rb +8 -1
- data/lib/cocina/models/request_dro_structural.rb +1 -0
- data/lib/cocina/models/request_file.rb +4 -1
- data/lib/cocina/models/request_file_set.rb +1 -0
- data/lib/cocina/models/request_identification.rb +8 -1
- data/lib/cocina/models/sequence.rb +1 -0
- data/lib/cocina/models/source.rb +3 -1
- data/lib/cocina/models/source_id.rb +10 -0
- data/lib/cocina/models/standard.rb +5 -1
- data/lib/cocina/models/standard_barcode.rb +2 -0
- data/lib/cocina/models/symphony_catalog_link.rb +3 -1
- data/lib/cocina/models/title.rb +13 -2
- data/lib/cocina/models/use_and_reproduction_statement.rb +5 -0
- data/lib/cocina/models/version.rb +1 -1
- data/lib/cocina/models.rb +5 -1
- data/openapi.yml +24 -13
- metadata +4 -2
- data/lib/cocina/models/doi_pattern.rb +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dd16339f9a675493e71e0ced334d9f5c265dd0ce0c712f7016f8fd0e4e5c4125
|
|
4
|
+
data.tar.gz: 03f80e5b956fd69a8dbf978469668f62bac2c70a9100f781d05d4c3d7f662f92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0f258871c023833f9d43443c2140e091671d18d1f4c65c12626e14308ee78c99baa91fdb2a408b88d0ad3f7197931ddfb57979b122c806eec664e1b15a6fdff
|
|
7
|
+
data.tar.gz: 8f5d5d83bbf5c0ed0a919056458b7ac13bf009f537f69fbf60c8220acdcf14adeb594a5ff0c601da87859cae23e85fea7fd49b2d0368d500c1530bcdf041a629
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
cocina-models (0.
|
|
4
|
+
cocina-models (0.108.0)
|
|
5
5
|
activesupport
|
|
6
6
|
deprecation
|
|
7
7
|
dry-struct (~> 1.0)
|
|
@@ -19,14 +19,14 @@ PATH
|
|
|
19
19
|
GEM
|
|
20
20
|
remote: https://rubygems.org/
|
|
21
21
|
specs:
|
|
22
|
-
activesupport (8.0
|
|
22
|
+
activesupport (8.1.0)
|
|
23
23
|
base64
|
|
24
|
-
benchmark (>= 0.3)
|
|
25
24
|
bigdecimal
|
|
26
25
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
27
26
|
connection_pool (>= 2.2.5)
|
|
28
27
|
drb
|
|
29
28
|
i18n (>= 1.6, < 2)
|
|
29
|
+
json
|
|
30
30
|
logger (>= 1.4.2)
|
|
31
31
|
minitest (>= 5.1)
|
|
32
32
|
securerandom (>= 0.3)
|
|
@@ -35,15 +35,17 @@ GEM
|
|
|
35
35
|
ast (2.4.3)
|
|
36
36
|
attr_extras (7.1.0)
|
|
37
37
|
base64 (0.3.0)
|
|
38
|
-
|
|
39
|
-
bigdecimal (3.2.3)
|
|
40
|
-
byebug (12.0.0)
|
|
38
|
+
bigdecimal (3.3.1)
|
|
41
39
|
committee (5.0.0)
|
|
42
40
|
json_schema (~> 0.14, >= 0.14.3)
|
|
43
41
|
openapi_parser (~> 1.0)
|
|
44
42
|
rack (>= 1.5)
|
|
45
43
|
concurrent-ruby (1.3.5)
|
|
46
44
|
connection_pool (2.5.4)
|
|
45
|
+
date (3.4.1)
|
|
46
|
+
debug (1.11.0)
|
|
47
|
+
irb (~> 1.10)
|
|
48
|
+
reline (>= 0.3.8)
|
|
47
49
|
deprecation (1.1.0)
|
|
48
50
|
activesupport
|
|
49
51
|
diff-lcs (1.6.2)
|
|
@@ -75,10 +77,16 @@ GEM
|
|
|
75
77
|
activesupport (>= 3.0, < 9.0)
|
|
76
78
|
equivalent-xml (0.6.0)
|
|
77
79
|
nokogiri (>= 1.4.3)
|
|
80
|
+
erb (5.1.1)
|
|
78
81
|
i18n (1.14.7)
|
|
79
82
|
concurrent-ruby (~> 1.0)
|
|
80
83
|
ice_nine (0.11.2)
|
|
81
|
-
|
|
84
|
+
io-console (0.8.1)
|
|
85
|
+
irb (1.15.2)
|
|
86
|
+
pp (>= 0.6.0)
|
|
87
|
+
rdoc (>= 4.0.0)
|
|
88
|
+
reline (>= 0.4.2)
|
|
89
|
+
json (2.15.2)
|
|
82
90
|
json_schema (0.21.0)
|
|
83
91
|
jsonpath (1.1.5)
|
|
84
92
|
multi_json
|
|
@@ -86,7 +94,7 @@ GEM
|
|
|
86
94
|
lint_roller (1.1.0)
|
|
87
95
|
logger (1.7.0)
|
|
88
96
|
mini_portile2 (2.8.9)
|
|
89
|
-
minitest (5.
|
|
97
|
+
minitest (5.26.0)
|
|
90
98
|
multi_json (1.17.0)
|
|
91
99
|
nokogiri (1.18.10)
|
|
92
100
|
mini_portile2 (~> 2.8.2)
|
|
@@ -94,33 +102,45 @@ GEM
|
|
|
94
102
|
openapi_parser (1.0.0)
|
|
95
103
|
optimist (3.2.1)
|
|
96
104
|
parallel (1.27.0)
|
|
97
|
-
parser (3.3.
|
|
105
|
+
parser (3.3.10.0)
|
|
98
106
|
ast (~> 2.4.1)
|
|
99
107
|
racc
|
|
100
108
|
patience_diff (1.2.0)
|
|
101
109
|
optimist (~> 3.0)
|
|
102
|
-
|
|
110
|
+
pp (0.6.3)
|
|
111
|
+
prettyprint
|
|
112
|
+
prettyprint (0.2.0)
|
|
113
|
+
prism (1.6.0)
|
|
114
|
+
psych (5.2.6)
|
|
115
|
+
date
|
|
116
|
+
stringio
|
|
103
117
|
racc (1.8.1)
|
|
104
|
-
rack (3.2.
|
|
118
|
+
rack (3.2.3)
|
|
105
119
|
rainbow (3.1.1)
|
|
106
120
|
rake (13.3.0)
|
|
121
|
+
rdoc (6.15.0)
|
|
122
|
+
erb
|
|
123
|
+
psych (>= 4.0.0)
|
|
124
|
+
tsort
|
|
107
125
|
regexp_parser (2.11.3)
|
|
108
|
-
|
|
126
|
+
reline (0.6.2)
|
|
127
|
+
io-console (~> 0.5)
|
|
128
|
+
rspec (3.13.2)
|
|
109
129
|
rspec-core (~> 3.13.0)
|
|
110
130
|
rspec-expectations (~> 3.13.0)
|
|
111
131
|
rspec-mocks (~> 3.13.0)
|
|
112
|
-
rspec-core (3.13.
|
|
132
|
+
rspec-core (3.13.6)
|
|
113
133
|
rspec-support (~> 3.13.0)
|
|
114
134
|
rspec-expectations (3.13.5)
|
|
115
135
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
116
136
|
rspec-support (~> 3.13.0)
|
|
117
|
-
rspec-mocks (3.13.
|
|
137
|
+
rspec-mocks (3.13.6)
|
|
118
138
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
119
139
|
rspec-support (~> 3.13.0)
|
|
120
140
|
rspec-support (3.13.6)
|
|
121
141
|
rspec_junit_formatter (0.6.0)
|
|
122
142
|
rspec-core (>= 2, < 4, != 2.12.0)
|
|
123
|
-
rubocop (1.81.
|
|
143
|
+
rubocop (1.81.6)
|
|
124
144
|
json (~> 2.3)
|
|
125
145
|
language_server-protocol (~> 3.17.0.2)
|
|
126
146
|
lint_roller (~> 1.1.0)
|
|
@@ -148,17 +168,19 @@ GEM
|
|
|
148
168
|
simplecov_json_formatter (~> 0.1)
|
|
149
169
|
simplecov-html (0.13.2)
|
|
150
170
|
simplecov_json_formatter (0.1.4)
|
|
151
|
-
|
|
171
|
+
stringio (3.1.7)
|
|
172
|
+
super_diff (0.17.0)
|
|
152
173
|
attr_extras (>= 6.2.4)
|
|
153
174
|
diff-lcs
|
|
154
175
|
patience_diff
|
|
155
176
|
thor (1.4.0)
|
|
177
|
+
tsort (0.2.0)
|
|
156
178
|
tzinfo (2.0.6)
|
|
157
179
|
concurrent-ruby (~> 1.0)
|
|
158
180
|
unicode-display_width (3.2.0)
|
|
159
181
|
unicode-emoji (~> 4.1)
|
|
160
182
|
unicode-emoji (4.1.0)
|
|
161
|
-
uri (1.0.
|
|
183
|
+
uri (1.0.4)
|
|
162
184
|
zeitwerk (2.7.3)
|
|
163
185
|
|
|
164
186
|
PLATFORMS
|
|
@@ -166,9 +188,9 @@ PLATFORMS
|
|
|
166
188
|
|
|
167
189
|
DEPENDENCIES
|
|
168
190
|
bundler (~> 2.0)
|
|
169
|
-
byebug
|
|
170
191
|
cocina-models!
|
|
171
192
|
committee
|
|
193
|
+
debug
|
|
172
194
|
rake (~> 13.0)
|
|
173
195
|
rspec (~> 3.0)
|
|
174
196
|
rspec_junit_formatter
|
data/README.md
CHANGED
|
@@ -91,32 +91,8 @@ RAILS_ENV=production bin/validate-cocina -p 8
|
|
|
91
91
|
|
|
92
92
|
## Running Reports in DSA
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
1. Connect to the `sdr-infra` box:
|
|
97
|
-
```shell
|
|
98
|
-
ssh sdr-infra
|
|
99
|
-
```
|
|
100
|
-
1. Start a shell as the `deploy` user:
|
|
101
|
-
```shell
|
|
102
|
-
# you may or may not need to supply the `-n SUNETID` argument
|
|
103
|
-
ksu deploy
|
|
104
|
-
```
|
|
105
|
-
1. Go to the `~/dor-services-app` directory and reset to main if needed (verify nobody else is using this first though):
|
|
106
|
-
```shell
|
|
107
|
-
cd ~/dor-services-app
|
|
108
|
-
git status # see if there are any unsaved changes, if so, you may need to git stash them
|
|
109
|
-
git pull # OR git reset --hard main to just ditch any local unsaved changes
|
|
110
|
-
```
|
|
111
|
-
1. Connect to the desired database by setting the environment variables as described in the section above. This must be done each time you SSH back into the box to run a new report.
|
|
112
|
-
1. Run the report (good idea to do it in a screen or via background process in case you get disconnected):
|
|
113
|
-
```shell
|
|
114
|
-
bundle exec bin/rails r -e production "BadIso8601Dates.report" > BadIso8601Dates.csv
|
|
115
|
-
```
|
|
116
|
-
1. When done, you can pull the report to your laptop as needed:
|
|
117
|
-
```shell
|
|
118
|
-
scp sdr-infra:/opt/app/deploy/dor-services-app/BadIso8601Dates.csv .
|
|
119
|
-
```
|
|
94
|
+
See https://github.com/sul-dlss/dor-services-app/blob/main/README.md#running-reports
|
|
95
|
+
|
|
120
96
|
|
|
121
97
|
## Releasing a patch change
|
|
122
98
|
A patch change is a change that (1) does not affect the data model; (2) does not alter the openapi.yml; and more broadly (3) does not matter if some applications have the change and others do not.
|
|
@@ -143,7 +119,7 @@ Send a note to `#dlss-infra-chg-mgmt` on Slack to let people know what is changi
|
|
|
143
119
|
The release process is much like any other gem. While on main:
|
|
144
120
|
1. Bump the version in `lib/cocina/models/version.rb`
|
|
145
121
|
2. `bundle install` so that `Gemfile.lock` is updated.
|
|
146
|
-
3. Commit those changes.
|
|
122
|
+
3. Commit those changes.
|
|
147
123
|
4. Run:
|
|
148
124
|
```
|
|
149
125
|
bundle exec rake release
|
|
@@ -179,11 +155,11 @@ Copy and paste the cocina-models schemas to each project's `openapi.yml`. By con
|
|
|
179
155
|
If you updated the `openapi.yml` in step 3A, use the same PR for step 3B. Why? When [dor-services-app](https://github.com/sul-dlss/dor-services-app), for example, is updated to use the new models (via the auto-update script), these clients should be updated at the same time or there is risk of models produced by dor-services-app not being acceptable to the clients.
|
|
180
156
|
|
|
181
157
|
1. Perform `bundle update --conservative cocina-models dor-services-client` in the services above and make PRs for those repos if they don't already exist. You may first need to update how these gems are pinned in the `Gemfile` in order to bump them.
|
|
182
|
-
2. Note that sdr-client is not currently used in these applications, but if it were, would also need to be bumped to the latest release.
|
|
158
|
+
2. Note that sdr-client is not currently used in these applications, but if it were, would also need to be bumped to the latest release.
|
|
183
159
|
|
|
184
160
|
#### Step 3C: Merge 'em
|
|
185
161
|
|
|
186
|
-
Get the directly coupled services PRs merged before the deploy in step 5.
|
|
162
|
+
Get the directly coupled services PRs merged before the deploy in step 5.
|
|
187
163
|
|
|
188
164
|
See the IMPORTANT note above about the timing of merging these PRs if you are waiting for dependency updates to make the updates to other dependent applications.
|
|
189
165
|
|
|
@@ -211,7 +187,7 @@ Create a branch and update cocina-models:
|
|
|
211
187
|
```
|
|
212
188
|
bundle update --conservative cocina-models
|
|
213
189
|
```
|
|
214
|
-
Once merged, it will deploy to stage via CD.
|
|
190
|
+
Once merged, it will deploy to stage via CD.
|
|
215
191
|
|
|
216
192
|
### Step 5: Deploy and test
|
|
217
193
|
|
|
@@ -228,7 +204,7 @@ It is safest to ensure _all_ the integration tests run cleanly. However, patch
|
|
|
228
204
|
|
|
229
205
|
**[Turn off Google Books](https://sul-gbooks-prod.stanford.edu/features) when deploying to production.** This avoids failed deposit due to a temporary Cocina model mismatch. Unlike other applications, the deposits will fail without retry and require manual remediation.
|
|
230
206
|
|
|
231
|
-
In addition to deploying infrastructure apps via sdr-deploy, tag and cut a release of purl-fetcher. That will trigger its deploy to production.
|
|
207
|
+
In addition to deploying infrastructure apps via sdr-deploy, tag and cut a release of purl-fetcher. That will trigger its deploy to production.
|
|
232
208
|
|
|
233
209
|
## Usage conventions
|
|
234
210
|
|
data/description_types.yml
CHANGED
|
@@ -99,6 +99,8 @@ contributor.note:
|
|
|
99
99
|
description: Institution with which the contributor is associated.
|
|
100
100
|
- value: citation status
|
|
101
101
|
description: Indicator of whether the contributor should be included in the citation.
|
|
102
|
+
- value: contact email
|
|
103
|
+
description: Preferred email contact for contributor.
|
|
102
104
|
- value: description
|
|
103
105
|
description: Biographical information about the contributor.
|
|
104
106
|
event:
|
data/docs/description_types.md
CHANGED
|
@@ -106,6 +106,8 @@ _Path: contributor.note.type_
|
|
|
106
106
|
* Institution with which the contributor is associated.
|
|
107
107
|
* citation status
|
|
108
108
|
* Indicator of whether the contributor should be included in the citation.
|
|
109
|
+
* contact email
|
|
110
|
+
* Preferred email contact for contributor.
|
|
109
111
|
* description
|
|
110
112
|
* Biographical information about the contributor.
|
|
111
113
|
# Event types
|
|
@@ -7,7 +7,7 @@ module Cocina
|
|
|
7
7
|
GENERIC_ITEMS_NAME = 'items'
|
|
8
8
|
|
|
9
9
|
def generate
|
|
10
|
-
"attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type}).default([].freeze)"
|
|
10
|
+
"#{preamble}attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type}).default([].freeze)"
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def array_of_type
|
|
@@ -46,7 +46,15 @@ module Cocina
|
|
|
46
46
|
def description
|
|
47
47
|
return '' unless schema_doc.description
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
to_multiline_comment(schema_doc.description)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def to_multiline_comment(string)
|
|
53
|
+
string
|
|
54
|
+
.split(/(.{80,}?) /)
|
|
55
|
+
.compact_blank
|
|
56
|
+
.map { |comment_chunk| "# #{comment_chunk}\n" }
|
|
57
|
+
.join
|
|
50
58
|
end
|
|
51
59
|
|
|
52
60
|
def deprecation
|
|
@@ -58,7 +66,7 @@ module Cocina
|
|
|
58
66
|
def example
|
|
59
67
|
return '' unless schema_doc.example
|
|
60
68
|
|
|
61
|
-
"
|
|
69
|
+
to_multiline_comment("example: #{schema_doc.example}")
|
|
62
70
|
end
|
|
63
71
|
|
|
64
72
|
def relaxed_comment
|
|
@@ -6,9 +6,9 @@ module Cocina
|
|
|
6
6
|
class SchemaRef < SchemaBase
|
|
7
7
|
def generate
|
|
8
8
|
if required && !relaxed
|
|
9
|
-
"attribute(:#{name.camelize(:lower)}, #{schema_doc.name}.default { #{schema_doc.name}.new })"
|
|
9
|
+
"#{preamble}attribute(:#{name.camelize(:lower)}, #{schema_doc.name}.default { #{schema_doc.name}.new })"
|
|
10
10
|
else
|
|
11
|
-
"attribute? :#{name.camelize(:lower)}, #{schema_doc.name}.optional"
|
|
11
|
+
"#{preamble}attribute? :#{name.camelize(:lower)}, #{schema_doc.name}.optional"
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
end
|
|
@@ -52,11 +52,12 @@ module Cocina
|
|
|
52
52
|
private_constant :BASE, :URIS
|
|
53
53
|
|
|
54
54
|
def vocabs
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
schemas.values
|
|
56
|
+
.filter_map { |schema| schema.properties&.[]('type')&.enum }
|
|
57
|
+
.flat_map(&:to_a)
|
|
58
|
+
.select { |vocab| vocab.start_with?(BASE) }
|
|
59
|
+
.uniq
|
|
60
|
+
.sort
|
|
60
61
|
end
|
|
61
62
|
|
|
62
63
|
def names
|
|
@@ -6,6 +6,7 @@ module Cocina
|
|
|
6
6
|
class AccessRole < Struct
|
|
7
7
|
# Name of role
|
|
8
8
|
attribute :name, Types::Strict::String.enum('dor-apo-depositor', 'dor-apo-manager', 'dor-apo-viewer', 'sdr-administrator', 'sdr-viewer', 'hydrus-collection-creator', 'hydrus-collection-manager', 'hydrus-collection-depositor', 'hydrus-collection-item-depositor', 'hydrus-collection-reviewer', 'hydrus-collection-viewer')
|
|
9
|
+
# The users and groups that are members of the role
|
|
9
10
|
attribute :members, Types::Strict::Array.of(AccessRoleMember).default([].freeze)
|
|
10
11
|
end
|
|
11
12
|
end
|
|
@@ -17,6 +17,7 @@ module Cocina
|
|
|
17
17
|
attribute :externalIdentifier, Druid
|
|
18
18
|
attribute :label, Types::Strict::String
|
|
19
19
|
attribute :version, Types::Strict::Integer
|
|
20
|
+
# Administrative properties for an AdminPolicy
|
|
20
21
|
attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })
|
|
21
22
|
attribute? :description, Description.optional
|
|
22
23
|
end
|
|
@@ -2,15 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
module Cocina
|
|
4
4
|
module Models
|
|
5
|
-
# Provides the template of access settings that is copied to the items governed by
|
|
5
|
+
# Provides the template of access settings that is copied to the items governed by
|
|
6
|
+
# an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults
|
|
7
|
+
# and has no embargo.
|
|
6
8
|
class AdminPolicyAccessTemplate < Struct
|
|
7
9
|
# The human readable copyright statement that applies
|
|
8
10
|
# example: Copyright World Trade Organization
|
|
9
11
|
attribute? :copyright, Copyright.optional
|
|
10
12
|
# The human readable use and reproduction statement that applies
|
|
11
|
-
# example: Property rights reside with the repository. Literary rights reside with
|
|
13
|
+
# example: Property rights reside with the repository. Literary rights reside with
|
|
14
|
+
# the creators of the documents or their heirs. To obtain permission to publish or
|
|
15
|
+
# reproduce, please contact the Public Services Librarian of the Dept. of Special Collections
|
|
16
|
+
# (http://library.stanford.edu/spc).
|
|
12
17
|
attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
|
|
13
|
-
# The license governing reuse of the DRO. Should be an IRI for known licenses (i.e.
|
|
18
|
+
# The license governing reuse of the DRO. Should be an IRI for known licenses (i.e.
|
|
19
|
+
# CC, RightsStatement.org URI, etc.).
|
|
14
20
|
attribute? :license, License.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
|
|
15
21
|
# Access level.
|
|
16
22
|
# Validation of this property is relaxed. See the openapi for full validation.
|
|
@@ -4,16 +4,25 @@ module Cocina
|
|
|
4
4
|
module Models
|
|
5
5
|
# Administrative properties for an AdminPolicy
|
|
6
6
|
class AdminPolicyAdministrative < Struct
|
|
7
|
+
# Provides the template of access settings that is copied to the items governed by
|
|
8
|
+
# an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults
|
|
9
|
+
# and has no embargo.
|
|
7
10
|
attribute(:accessTemplate, AdminPolicyAccessTemplate.default { AdminPolicyAccessTemplate.new })
|
|
11
|
+
# When you register an item with this admin policy, these are the workflows that are
|
|
12
|
+
# available.
|
|
8
13
|
attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
|
|
9
|
-
# An additional workflow to start for objects managed by this admin policy once the
|
|
14
|
+
# An additional workflow to start for objects managed by this admin policy once the
|
|
15
|
+
# end-accession workflow step is complete
|
|
10
16
|
# example: wasCrawlPreassemblyWF
|
|
11
17
|
attribute? :disseminationWorkflow, Types::Strict::String
|
|
18
|
+
# When you register an item with this admin policy, these are the collections that
|
|
19
|
+
# are available.
|
|
12
20
|
attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
|
|
13
21
|
# example: druid:bc123df4567
|
|
14
22
|
attribute :hasAdminPolicy, Druid
|
|
15
23
|
# example: druid:bc123df4567
|
|
16
24
|
attribute :hasAgreement, Druid
|
|
25
|
+
# The access roles conferred by this AdminPolicy (used by Argo)
|
|
17
26
|
attribute :roles, Types::Strict::Array.of(AccessRole).default([].freeze)
|
|
18
27
|
end
|
|
19
28
|
end
|
|
@@ -15,7 +15,10 @@ module Cocina
|
|
|
15
15
|
attribute :externalIdentifier, Druid
|
|
16
16
|
attribute :label, Types::Strict::String
|
|
17
17
|
attribute :version, Types::Strict::Integer
|
|
18
|
+
# Administrative properties for an AdminPolicy
|
|
19
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
|
18
20
|
attribute? :administrative, AdminPolicyAdministrative.optional
|
|
21
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
|
19
22
|
attribute? :description, Description.optional
|
|
20
23
|
end
|
|
21
24
|
end
|
|
@@ -18,6 +18,7 @@ module Cocina
|
|
|
18
18
|
attribute :externalIdentifier, Druid
|
|
19
19
|
attribute :label, Types::Strict::String
|
|
20
20
|
attribute :version, Types::Strict::Integer
|
|
21
|
+
# Administrative properties for an AdminPolicy
|
|
21
22
|
attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })
|
|
22
23
|
attribute? :description, Description.optional
|
|
23
24
|
# When the object was created.
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Cocina
|
|
4
4
|
module Models
|
|
5
|
-
# Property model for indicating the parts, aspects, or versions of the resource to
|
|
5
|
+
# Property model for indicating the parts, aspects, or versions of the resource to
|
|
6
|
+
# which a descriptive element is applicable.
|
|
6
7
|
class AppliesTo < Struct
|
|
7
8
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([].freeze)
|
|
8
9
|
end
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Cocina
|
|
4
4
|
module Models
|
|
5
|
-
# A type of access for an object wherein users can see the metadata and a list of files,
|
|
5
|
+
# A type of access for an object wherein users can see the metadata and a list of files,
|
|
6
|
+
# but the files will not have view or download access
|
|
6
7
|
class CitationOnlyAccess < Struct
|
|
7
8
|
# Access level.
|
|
8
9
|
attribute :view, Types::Strict::String.enum('citation-only')
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Cocina
|
|
4
4
|
module Models
|
|
5
|
-
# A group of Digital Repository Objects that indicate some type of conceptual grouping
|
|
5
|
+
# A group of Digital Repository Objects that indicate some type of conceptual grouping
|
|
6
|
+
# within the domain that is worth reusing across the system.
|
|
6
7
|
class Collection < Struct
|
|
7
8
|
include Validatable
|
|
8
9
|
|
|
@@ -25,6 +26,7 @@ module Cocina
|
|
|
25
26
|
attribute :label, Types::Strict::String
|
|
26
27
|
# Version for the Collection within SDR.
|
|
27
28
|
attribute :version, Types::Strict::Integer
|
|
29
|
+
# Access metadata for collections
|
|
28
30
|
attribute(:access, CollectionAccess.default { CollectionAccess.new })
|
|
29
31
|
attribute(:administrative, Administrative.default { Administrative.new })
|
|
30
32
|
attribute(:description, Description.default { Description.new })
|
|
@@ -10,9 +10,13 @@ module Cocina
|
|
|
10
10
|
# example: Copyright World Trade Organization
|
|
11
11
|
attribute? :copyright, Copyright.optional
|
|
12
12
|
# The human readable use and reproduction statement that applies
|
|
13
|
-
# example: Property rights reside with the repository. Literary rights reside with
|
|
13
|
+
# example: Property rights reside with the repository. Literary rights reside with
|
|
14
|
+
# the creators of the documents or their heirs. To obtain permission to publish or
|
|
15
|
+
# reproduce, please contact the Public Services Librarian of the Dept. of Special Collections
|
|
16
|
+
# (http://library.stanford.edu/spc).
|
|
14
17
|
attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
|
|
15
|
-
# The license governing reuse of the DRO. Should be an IRI for known licenses (i.e.
|
|
18
|
+
# The license governing reuse of the DRO. Should be an IRI for known licenses (i.e.
|
|
19
|
+
# CC, RightsStatement.org URI, etc.).
|
|
16
20
|
attribute? :license, License.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
|
|
17
21
|
end
|
|
18
22
|
end
|
|
@@ -4,7 +4,14 @@ module Cocina
|
|
|
4
4
|
module Models
|
|
5
5
|
class CollectionIdentification < Struct
|
|
6
6
|
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([].freeze)
|
|
7
|
-
# Unique identifier in some other system. This is because a large proportion of what
|
|
7
|
+
# Unique identifier in some other system. This is because a large proportion of what
|
|
8
|
+
# is deposited in SDR, historically and currently, are representations of objects that
|
|
9
|
+
# are also represented in other systems. For example, digitized paper and A/V collections
|
|
10
|
+
# have physical manifestations, and those physical objects are managed in systems that
|
|
11
|
+
# have their own identifiers. Similarly, books have barcodes, archival materials have
|
|
12
|
+
# collection numbers and physical locations, etc. The sourceId allows determining if
|
|
13
|
+
# an item has been deposited before and where to look for the original item if you're
|
|
14
|
+
# looking at its SDR representation. The format is: "namespace:identifier"
|
|
8
15
|
|
|
9
16
|
# example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
|
|
10
17
|
attribute? :sourceId, SourceId.optional
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Cocina
|
|
4
4
|
module Models
|
|
5
|
-
# A group of Digital Repository Objects that indicate some type of conceptual grouping
|
|
5
|
+
# A group of Digital Repository Objects that indicate some type of conceptual grouping
|
|
6
|
+
# within the domain that is worth reusing across the system.
|
|
6
7
|
class CollectionLite < Struct
|
|
7
8
|
include Checkable
|
|
8
9
|
|
|
@@ -23,9 +24,14 @@ module Cocina
|
|
|
23
24
|
attribute :label, Types::Strict::String
|
|
24
25
|
# Version for the Collection within SDR.
|
|
25
26
|
attribute :version, Types::Strict::Integer
|
|
27
|
+
# Access metadata for collections
|
|
28
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
|
26
29
|
attribute? :access, CollectionAccess.optional
|
|
30
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
|
27
31
|
attribute? :administrative, Administrative.optional
|
|
32
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
|
28
33
|
attribute? :description, Description.optional
|
|
34
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
|
29
35
|
attribute? :identification, CollectionIdentification.optional
|
|
30
36
|
end
|
|
31
37
|
end
|
|
@@ -25,6 +25,7 @@ module Cocina
|
|
|
25
25
|
attribute :label, Types::Strict::String
|
|
26
26
|
# Version for the Collection within SDR.
|
|
27
27
|
attribute :version, Types::Strict::Integer
|
|
28
|
+
# Access metadata for collections
|
|
28
29
|
attribute(:access, CollectionAccess.default { CollectionAccess.new })
|
|
29
30
|
attribute(:administrative, Administrative.default { Administrative.new })
|
|
30
31
|
attribute(:description, Description.default { Description.new })
|