cocina-models 0.61.3 → 0.63.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +9 -48
- data/.rubocop.yml +116 -1
- data/.rubocop_todo.yml +5 -4
- data/Gemfile +1 -0
- data/README.md +19 -6
- data/cocina-models.gemspec +6 -4
- data/docs/sampleETD/foxml.xml +1 -1
- data/docs/sampleETD/xn109qc9773_bibframe.ttl +1 -1
- data/docs/sampleETD/xn109qc9773_taco.json +1 -1
- data/lib/cocina/generator/schema_array.rb +1 -9
- data/lib/cocina/models/admin_policy_administrative.rb +3 -3
- data/lib/cocina/models/administrative.rb +1 -1
- data/lib/cocina/models/applies_to.rb +1 -1
- data/lib/cocina/models/collection_identification.rb +1 -1
- data/lib/cocina/models/contributor.rb +5 -5
- data/lib/cocina/models/description.rb +10 -10
- data/lib/cocina/models/descriptive_access_metadata.rb +6 -6
- data/lib/cocina/models/descriptive_admin_metadata.rb +6 -6
- data/lib/cocina/models/descriptive_basic_value.rb +5 -5
- data/lib/cocina/models/descriptive_geographic_metadata.rb +2 -2
- data/lib/cocina/models/descriptive_grouped_value.rb +1 -1
- data/lib/cocina/models/descriptive_parallel_contributor.rb +4 -4
- data/lib/cocina/models/descriptive_parallel_event.rb +6 -6
- data/lib/cocina/models/descriptive_parallel_value.rb +1 -1
- data/lib/cocina/models/descriptive_structured_value.rb +1 -1
- data/lib/cocina/models/descriptive_value.rb +6 -6
- data/lib/cocina/models/descriptive_value_language.rb +1 -1
- data/lib/cocina/models/dro_structural.rb +3 -3
- data/lib/cocina/models/event.rb +7 -7
- data/lib/cocina/models/file_set_structural.rb +1 -1
- data/lib/cocina/models/identification.rb +2 -2
- data/lib/cocina/models/language.rb +5 -5
- data/lib/cocina/models/purl.rb +1 -1
- data/lib/cocina/models/related_resource.rb +9 -9
- data/lib/cocina/models/request_dro_structural.rb +3 -3
- data/lib/cocina/models/request_file_set_structural.rb +1 -1
- data/lib/cocina/models/request_identification.rb +1 -1
- data/lib/cocina/models/sequence.rb +1 -1
- data/lib/cocina/models/source.rb +1 -1
- data/lib/cocina/models/standard.rb +1 -1
- data/lib/cocina/models/title.rb +6 -6
- data/lib/cocina/models/version.rb +1 -1
- data/lib/cocina/models.rb +1 -0
- data/openapi.yml +2 -2
- metadata +28 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6d9b7c11061f4e03dc5d8f8b7ed61dce99e05467f229fb9678792abdd7ae00e
|
4
|
+
data.tar.gz: de835512797d500cda81ca8c17155fd7a518ba47629c0be9519488ae86d6ed34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6db0d195fc2f8a610b0ed9f2f94b7fe7473f49c00e7a6f92ccef010dc6ee428e614a276d98ba80ad673f5720299d7b7a6ac0d4dedabce165035d3a8c6bc1614b
|
7
|
+
data.tar.gz: b43aa74787005ed59b5aec644f582cb2412cc1b4cc2ebb6422f28faba4939e86751d108716a40928872bb76f1c72c78aa5368ca66f338ec5c59cc22830808366
|
data/.circleci/config.yml
CHANGED
@@ -1,51 +1,12 @@
|
|
1
1
|
version: 2.1
|
2
|
-
|
3
|
-
|
4
|
-
docker:
|
5
|
-
- image: circleci/buildpack-deps:stretch
|
6
|
-
jobs:
|
7
|
-
test:
|
8
|
-
docker:
|
9
|
-
- image: circleci/ruby:2.7.0-node
|
10
|
-
steps:
|
11
|
-
- checkout
|
12
|
-
- run:
|
13
|
-
name: install bundler
|
14
|
-
command: gem install bundler -v 2.1.4
|
15
|
-
- run:
|
16
|
-
name: Install gem dependencies
|
17
|
-
command: bundle check || bundle install
|
18
|
-
- run:
|
19
|
-
name: Lint using rubocop
|
20
|
-
command: bundle exec rubocop
|
21
|
-
- run:
|
22
|
-
name: Setup Code Climate test-reporter
|
23
|
-
command: |
|
24
|
-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
25
|
-
chmod +x ./cc-test-reporter
|
26
|
-
./cc-test-reporter before-build
|
27
|
-
- run:
|
28
|
-
name: Run RSpec test suite
|
29
|
-
command: bundle exec rspec
|
30
|
-
- run:
|
31
|
-
name: upload test coverage report to Code Climate
|
32
|
-
command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
|
33
|
-
- run:
|
34
|
-
name: Validate API specification
|
35
|
-
command: |
|
36
|
-
sudo npm install -g openapi-enforcer-cli
|
37
|
-
result=$(openapi-enforcer validate openapi.yml)
|
38
|
-
[[ $result =~ "Document is valid" ]] && {
|
39
|
-
echo "Validation good"
|
40
|
-
exit 0
|
41
|
-
} || {
|
42
|
-
echo $result
|
43
|
-
exit 1
|
44
|
-
}
|
45
|
-
|
2
|
+
orbs:
|
3
|
+
ruby-rails: sul-dlss/ruby-rails@2.0.0
|
46
4
|
workflows:
|
47
|
-
|
48
|
-
|
49
|
-
test:
|
5
|
+
build:
|
50
6
|
jobs:
|
51
|
-
|
7
|
+
- ruby-rails/validate-api:
|
8
|
+
name: validate
|
9
|
+
- ruby-rails/lint:
|
10
|
+
name: lint
|
11
|
+
- ruby-rails/test-gem:
|
12
|
+
name: test
|
data/.rubocop.yml
CHANGED
@@ -3,9 +3,11 @@
|
|
3
3
|
inherit_from: .rubocop_todo.yml
|
4
4
|
require:
|
5
5
|
- rubocop-rspec
|
6
|
+
- rubocop-rake
|
6
7
|
|
7
8
|
AllCops:
|
8
|
-
|
9
|
+
# dor-services-app is stuck at ruby 2 until we get off Fedora3
|
10
|
+
TargetRubyVersion: 2.7
|
9
11
|
|
10
12
|
# ----- Layout ------
|
11
13
|
|
@@ -154,3 +156,116 @@ Style/SoleNestedConditional: # (new in 0.89)
|
|
154
156
|
Enabled: true
|
155
157
|
Style/StringConcatenation:
|
156
158
|
Enabled: true
|
159
|
+
|
160
|
+
Gemspec/DateAssignment: # new in 1.10
|
161
|
+
Enabled: true
|
162
|
+
Gemspec/RequireMFA: # new in 1.23
|
163
|
+
Enabled: true
|
164
|
+
Layout/LineEndStringConcatenationIndentation: # new in 1.18
|
165
|
+
Enabled: true
|
166
|
+
Layout/SpaceBeforeBrackets: # new in 1.7
|
167
|
+
Enabled: true
|
168
|
+
Lint/AmbiguousAssignment: # new in 1.7
|
169
|
+
Enabled: true
|
170
|
+
Lint/AmbiguousOperatorPrecedence: # new in 1.21
|
171
|
+
Enabled: true
|
172
|
+
Lint/AmbiguousRange: # new in 1.19
|
173
|
+
Enabled: true
|
174
|
+
Lint/DeprecatedConstants: # new in 1.8
|
175
|
+
Enabled: true
|
176
|
+
Lint/DuplicateBranch: # new in 1.3
|
177
|
+
Enabled: true
|
178
|
+
Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
|
179
|
+
Enabled: true
|
180
|
+
Lint/EmptyBlock: # new in 1.1
|
181
|
+
Enabled: true
|
182
|
+
Lint/EmptyClass: # new in 1.3
|
183
|
+
Enabled: true
|
184
|
+
Lint/EmptyInPattern: # new in 1.16
|
185
|
+
Enabled: true
|
186
|
+
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
|
187
|
+
Enabled: true
|
188
|
+
Lint/LambdaWithoutLiteralBlock: # new in 1.8
|
189
|
+
Enabled: true
|
190
|
+
Lint/NoReturnInBeginEndBlocks: # new in 1.2
|
191
|
+
Enabled: true
|
192
|
+
Lint/NumberedParameterAssignment: # new in 1.9
|
193
|
+
Enabled: true
|
194
|
+
Lint/OrAssignmentToConstant: # new in 1.9
|
195
|
+
Enabled: true
|
196
|
+
Lint/RedundantDirGlobSort: # new in 1.8
|
197
|
+
Enabled: true
|
198
|
+
Lint/RequireRelativeSelfPath: # new in 1.22
|
199
|
+
Enabled: true
|
200
|
+
Lint/SymbolConversion: # new in 1.9
|
201
|
+
Enabled: true
|
202
|
+
Lint/ToEnumArguments: # new in 1.1
|
203
|
+
Enabled: true
|
204
|
+
Lint/TripleQuotes: # new in 1.9
|
205
|
+
Enabled: true
|
206
|
+
Lint/UnexpectedBlockArity: # new in 1.5
|
207
|
+
Enabled: true
|
208
|
+
Lint/UnmodifiedReduceAccumulator: # new in 1.1
|
209
|
+
Enabled: true
|
210
|
+
Lint/UselessRuby2Keywords: # new in 1.23
|
211
|
+
Enabled: true
|
212
|
+
Naming/BlockForwarding: # new in 1.24
|
213
|
+
Enabled: true
|
214
|
+
Security/IoMethods: # new in 1.22
|
215
|
+
Enabled: true
|
216
|
+
Style/ArgumentsForwarding: # new in 1.1
|
217
|
+
Enabled: true
|
218
|
+
Style/CollectionCompact: # new in 1.2
|
219
|
+
Enabled: true
|
220
|
+
Style/DocumentDynamicEvalDefinition: # new in 1.1
|
221
|
+
Enabled: true
|
222
|
+
Style/EndlessMethod: # new in 1.8
|
223
|
+
Enabled: true
|
224
|
+
Style/FileRead: # new in 1.24
|
225
|
+
Enabled: true
|
226
|
+
Style/FileWrite: # new in 1.24
|
227
|
+
Enabled: true
|
228
|
+
Style/HashConversion: # new in 1.10
|
229
|
+
Enabled: true
|
230
|
+
Style/HashExcept: # new in 1.7
|
231
|
+
Enabled: true
|
232
|
+
Style/IfWithBooleanLiteralBranches: # new in 1.9
|
233
|
+
Enabled: true
|
234
|
+
Style/InPatternThen: # new in 1.16
|
235
|
+
Enabled: true
|
236
|
+
Style/MapToHash: # new in 1.24
|
237
|
+
Enabled: true
|
238
|
+
Style/MultilineInPatternThen: # new in 1.16
|
239
|
+
Enabled: true
|
240
|
+
Style/NegatedIfElseCondition: # new in 1.2
|
241
|
+
Enabled: true
|
242
|
+
Style/NilLambda: # new in 1.3
|
243
|
+
Enabled: true
|
244
|
+
Style/NumberedParameters: # new in 1.22
|
245
|
+
Enabled: true
|
246
|
+
Style/NumberedParametersLimit: # new in 1.22
|
247
|
+
Enabled: true
|
248
|
+
Style/OpenStructUse: # new in 1.23
|
249
|
+
Enabled: true
|
250
|
+
Style/QuotedSymbols: # new in 1.16
|
251
|
+
Enabled: true
|
252
|
+
Style/RedundantArgument: # new in 1.4
|
253
|
+
Enabled: true
|
254
|
+
Style/RedundantSelfAssignmentBranch: # new in 1.19
|
255
|
+
Enabled: true
|
256
|
+
Style/SelectByRegexp: # new in 1.22
|
257
|
+
Enabled: true
|
258
|
+
Style/StringChars: # new in 1.12
|
259
|
+
Enabled: true
|
260
|
+
Style/SwapValues: # new in 1.1
|
261
|
+
Enabled: true
|
262
|
+
RSpec/ExcessiveDocstringSpacing: # new in 2.5
|
263
|
+
Enabled: true
|
264
|
+
RSpec/IdenticalEqualityAssertion: # new in 2.4
|
265
|
+
Enabled: true
|
266
|
+
RSpec/SubjectDeclaration: # new in 2.5
|
267
|
+
Enabled: true
|
268
|
+
RSpec/FactoryBot/SyntaxMethods: # new in 2.7
|
269
|
+
Enabled: true
|
270
|
+
RSpec/Rails/AvoidSetupHook: # new in 2.4
|
271
|
+
Enabled: true
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude`
|
3
|
+
# on 2022-01-14 00:32:36 UTC using RuboCop version 1.24.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -14,9 +14,10 @@ Lint/SafeNavigationChain:
|
|
14
14
|
- 'lib/cocina/generator/schema_base.rb'
|
15
15
|
|
16
16
|
# Offense count: 1
|
17
|
-
# Configuration parameters: CountKeywordArgs.
|
17
|
+
# Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters.
|
18
18
|
Metrics/ParameterLists:
|
19
|
-
|
19
|
+
Exclude:
|
20
|
+
- 'lib/cocina/generator/schema_base.rb'
|
20
21
|
|
21
22
|
# Offense count: 1
|
22
23
|
# Configuration parameters: MinBodyLength.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -65,17 +65,30 @@ At the same, we have found it convenient to use these PRs to also bump the versi
|
|
65
65
|
|
66
66
|
### Step 4: Update other dependent applications
|
67
67
|
|
68
|
-
Once the above listed steps have been completed, all the following applications that use cocina-models should be updated and released at the same time
|
68
|
+
Once the above listed steps have been completed, all the following applications that use cocina-models should be updated and released at the same time. "Cocina Level 2" describes this set of updates.
|
69
69
|
|
70
|
-
* [sul-dlss/
|
70
|
+
* [sul-dlss/argo](https://github.com/sul-dlss/argo/)
|
71
71
|
* [sul-dlss/common-accessioning](https://github.com/sul-dlss/common-accessioning/)
|
72
|
+
* [sul-dlss/dor_indexing_app](https://github.com/sul-dlss/dor_indexing_app/)
|
72
73
|
* [sul-dlss/google-books](https://github.com/sul-dlss/google-books/)
|
73
|
-
* [sul-dlss/argo](https://github.com/sul-dlss/argo/)
|
74
|
-
* [sul-dlss/pre-assembly](https://github.com/sul-dlss/pre-assembly/)
|
75
|
-
* [sul-dlss/hydra_etd](https://github.com/sul-dlss/hydra_etd/)
|
76
|
-
* [sul-dlss/hydrus](https://github.com/sul-dlss/hydrus/)
|
77
74
|
* [sul-dlss/happy-heron](https://github.com/sul-dlss/happy-heron/)
|
75
|
+
* [sul-dlss/hydra_etd](https://github.com/sul-dlss/hydra_etd/)
|
78
76
|
* [sul-dlss/infrastructure-integration-test](https://github.com/sul-dlss/infrastructure-integration-test/)
|
77
|
+
* [sul-dlss/pre-assembly](https://github.com/sul-dlss/pre-assembly/)
|
78
|
+
|
79
|
+
There are scripts to help with this:
|
80
|
+
|
81
|
+
#### Step 4A: Create the PRs
|
82
|
+
|
83
|
+
access-update-scripts repo has a script for this: `cocina_level2_prs.rb`. You will need a github access token with scopes of "read:org" and "repo" (see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) to run it, as noted in the comments at the top of that script.
|
84
|
+
|
85
|
+
#### Step 4B: Merge the PRs
|
86
|
+
|
87
|
+
[sul-dlss/access-update-scripts](https://github.com/sul-dlss/access-update-scripts) has a switch in the `merge-all.rb` script for this, as noted in the comments at the top of that script. (`REPOS_PATH=infrastructure GH_ACCESS_TOKEN=abc123 COCINA_LEVEL2= ./merge-all.rb`)
|
88
|
+
|
89
|
+
### Step 5: Deploy all affected applications together
|
90
|
+
|
91
|
+
[sul-dlss/sdr-deploy](https://github.com/sul-dlss/sdr-deploy) has a flag in the deploy script to limit deploys to cocina dependent applications. Refer to instructions in the [sdr-deploy/README](https://github.com/sul-dlss/sdr-deploy/blob/main/README.md#only-deploy-repos-related-to-cocina-models-update).
|
79
92
|
|
80
93
|
## Usage conventions
|
81
94
|
|
data/cocina-models.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.bindir = 'exe'
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
25
|
-
spec.required_ruby_version = '>= 2.
|
25
|
+
spec.required_ruby_version = '>= 2.7'
|
26
26
|
|
27
27
|
spec.add_dependency 'activesupport'
|
28
28
|
spec.add_dependency 'dry-struct', '~> 1.0'
|
@@ -36,7 +36,9 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency 'committee'
|
37
37
|
spec.add_development_dependency 'rake', '~> 13.0'
|
38
38
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
39
|
-
spec.add_development_dependency 'rubocop', '~>
|
40
|
-
spec.add_development_dependency 'rubocop-
|
41
|
-
spec.add_development_dependency '
|
39
|
+
spec.add_development_dependency 'rubocop', '~> 1.24'
|
40
|
+
spec.add_development_dependency 'rubocop-rake'
|
41
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
|
42
|
+
spec.add_development_dependency 'simplecov'
|
43
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
42
44
|
end
|
data/docs/sampleETD/foxml.xml
CHANGED
@@ -944,7 +944,7 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
|
|
944
944
|
<note>Submitted to the Graduate School of Education.</note>
|
945
945
|
<note type="thesis">Thesis (Ph.D.)--Stanford University, 2015.</note>
|
946
946
|
<location>
|
947
|
-
<url displayLabel="electronic resource" usage="primary display">
|
947
|
+
<url displayLabel="electronic resource" usage="primary display">https://purl.stanford.edu/xn109qc9773</url>
|
948
948
|
</location>
|
949
949
|
<recordInfo>
|
950
950
|
<recordContentSource authority="marcorg">CSt</recordContentSource>
|
@@ -86,7 +86,7 @@
|
|
86
86
|
|
87
87
|
:xn109qc9773_item [ a bf:Item ;
|
88
88
|
bf:electronicLocator [ a rdf:Resource ;
|
89
|
-
rdf:value <
|
89
|
+
rdf:value <https://purl.stanford.edu/xn109qc9773> ;
|
90
90
|
bf:note [ a bf:Note ;
|
91
91
|
rdfs:label "primary display" ;
|
92
92
|
bf:noteType "URL usage"
|
@@ -5,15 +5,7 @@ module Cocina
|
|
5
5
|
# Class for generating from an openapi array
|
6
6
|
class SchemaArray < SchemaBase
|
7
7
|
def generate
|
8
|
-
"attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type})
|
9
|
-
end
|
10
|
-
|
11
|
-
def omittable
|
12
|
-
if required && !relaxed
|
13
|
-
'.default([].freeze)'
|
14
|
-
else
|
15
|
-
'.meta(omittable: true)'
|
16
|
-
end
|
8
|
+
"attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type}).default([].freeze)"
|
17
9
|
end
|
18
10
|
|
19
11
|
def array_of_type
|
@@ -6,16 +6,16 @@ module Cocina
|
|
6
6
|
# This is an XML expression of the default access (see defaultAccess)
|
7
7
|
attribute :defaultObjectRights, Types::Strict::String.default('<?xml version="1.0" encoding="UTF-8"?><rightsMetadata><access type="discover"><machine><world/></machine></access><access type="read"><machine><world/></machine></access><use><human type="useAndReproduction"/><human type="creativeCommons"/><machine type="creativeCommons" uri=""/><human type="openDataCommons"/><machine type="openDataCommons" uri=""/></use><copyright><human/></copyright></rightsMetadata>').meta(omittable: true)
|
8
8
|
attribute :defaultAccess, AdminPolicyDefaultAccess.optional.meta(omittable: true)
|
9
|
-
attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).
|
9
|
+
attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
|
10
10
|
# An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
|
11
11
|
# example: wasCrawlPreassemblyWF
|
12
12
|
attribute :disseminationWorkflow, Types::Strict::String.meta(omittable: true)
|
13
|
-
attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).
|
13
|
+
attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
|
14
14
|
# example: druid:bc123df4567
|
15
15
|
attribute :hasAdminPolicy, Types::Strict::String
|
16
16
|
# example: druid:bc123df4567
|
17
17
|
attribute :referencesAgreement, Types::Strict::String.meta(omittable: true)
|
18
|
-
attribute :roles, Types::Strict::Array.of(AccessRole).
|
18
|
+
attribute :roles, Types::Strict::Array.of(AccessRole).default([].freeze)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -5,7 +5,7 @@ module Cocina
|
|
5
5
|
class Administrative < Struct
|
6
6
|
# example: druid:bc123df4567
|
7
7
|
attribute :hasAdminPolicy, Types::Strict::String
|
8
|
-
attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).
|
8
|
+
attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).default([].freeze)
|
9
9
|
# Administrative or Internal project this resource is a part of
|
10
10
|
# example: Google Books
|
11
11
|
attribute :partOfProject, Types::Strict::String.meta(omittable: true)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class CollectionIdentification < Struct
|
6
|
-
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).
|
6
|
+
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([].freeze)
|
7
7
|
# Unique identifier in some other system. This is because a large proportion of what is deposited in SDR, historically and currently, are representations of objects that are also represented in other systems. For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
|
8
8
|
|
9
9
|
# example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
|
@@ -3,17 +3,17 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Contributor < Struct
|
6
|
-
attribute :name, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :name, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
7
|
# Entity type of the contributor (person, organization, etc.).
|
8
8
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
9
|
# Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
|
10
10
|
attribute :status, Types::Strict::String.meta(omittable: true)
|
11
|
-
attribute :role, Types::Strict::Array.of(DescriptiveValue).
|
12
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
13
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
11
|
+
attribute :role, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
12
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
14
|
# URL or other pointer to the location of the contributor information.
|
15
15
|
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
16
|
-
attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).
|
16
|
+
attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).default([].freeze)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -4,19 +4,19 @@ module Cocina
|
|
4
4
|
module Models
|
5
5
|
class Description < Struct
|
6
6
|
attribute :title, Types::Strict::Array.of(Title).default([].freeze)
|
7
|
-
attribute :contributor, Types::Strict::Array.of(Contributor).
|
8
|
-
attribute :event, Types::Strict::Array.of(Event).
|
9
|
-
attribute :form, Types::Strict::Array.of(DescriptiveValue).
|
10
|
-
attribute :geographic, Types::Strict::Array.of(DescriptiveGeographicMetadata).
|
11
|
-
attribute :language, Types::Strict::Array.of(Language).
|
12
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
13
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
14
|
-
attribute :subject, Types::Strict::Array.of(DescriptiveValue).
|
7
|
+
attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
|
8
|
+
attribute :event, Types::Strict::Array.of(Event).default([].freeze)
|
9
|
+
attribute :form, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
10
|
+
attribute :geographic, Types::Strict::Array.of(DescriptiveGeographicMetadata).default([].freeze)
|
11
|
+
attribute :language, Types::Strict::Array.of(Language).default([].freeze)
|
12
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
|
+
attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
15
15
|
# Stanford persistent URL associated with the related resource. Note this is http, not https.
|
16
16
|
attribute :purl, Types::Strict::String.meta(omittable: true)
|
17
17
|
attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
|
18
|
-
attribute :relatedResource, Types::Strict::Array.of(RelatedResource).
|
19
|
-
attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).
|
18
|
+
attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([].freeze)
|
19
|
+
attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
20
20
|
attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
|
21
21
|
# URL or other pointer to the location of the resource description.
|
22
22
|
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
@@ -3,12 +3,12 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveAccessMetadata < Struct
|
6
|
-
attribute :url, Types::Strict::Array.of(DescriptiveValue).
|
7
|
-
attribute :physicalLocation, Types::Strict::Array.of(DescriptiveValue).
|
8
|
-
attribute :digitalLocation, Types::Strict::Array.of(DescriptiveValue).
|
9
|
-
attribute :accessContact, Types::Strict::Array.of(DescriptiveValue).
|
10
|
-
attribute :digitalRepository, Types::Strict::Array.of(DescriptiveValue).
|
11
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :url, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
|
+
attribute :physicalLocation, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
8
|
+
attribute :digitalLocation, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
9
|
+
attribute :accessContact, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
10
|
+
attribute :digitalRepository, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
11
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -3,12 +3,12 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveAdminMetadata < Struct
|
6
|
-
attribute :contributor, Types::Strict::Array.of(Contributor).
|
7
|
-
attribute :event, Types::Strict::Array.of(Event).
|
8
|
-
attribute :language, Types::Strict::Array.of(Language).
|
9
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
10
|
-
attribute :metadataStandard, Types::Strict::Array.of(Standard).
|
11
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
|
7
|
+
attribute :event, Types::Strict::Array.of(Event).default([].freeze)
|
8
|
+
attribute :language, Types::Strict::Array.of(Language).default([].freeze)
|
9
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
10
|
+
attribute :metadataStandard, Types::Strict::Array.of(Standard).default([].freeze)
|
11
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -3,9 +3,9 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveBasicValue < Struct
|
6
|
-
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).
|
7
|
-
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).
|
8
|
-
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
8
|
+
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
9
9
|
# String or integer value of the descriptive element.
|
10
10
|
attribute :value, Types::Nominal::Any.meta(omittable: true)
|
11
11
|
# Type of value provided by the descriptive element.
|
@@ -18,13 +18,13 @@ module Cocina
|
|
18
18
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
19
19
|
attribute :standard, Standard.optional.meta(omittable: true)
|
20
20
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
21
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
21
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
22
22
|
attribute :source, Source.optional.meta(omittable: true)
|
23
23
|
# The preferred display label to use for the descriptive element in access systems.
|
24
24
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
25
25
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
26
26
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
27
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
27
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
28
28
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
29
29
|
# URL or other pointer to the location of the value of the descriptive element.
|
30
30
|
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
@@ -3,8 +3,8 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveGeographicMetadata < Struct
|
6
|
-
attribute :form, Types::Strict::Array.of(DescriptiveValue).
|
7
|
-
attribute :subject, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :form, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
|
+
attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveGroupedValue < Struct
|
6
|
-
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -3,14 +3,14 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveParallelContributor < Struct
|
6
|
-
attribute :name, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :name, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
7
|
# Entity type of the contributor (person, organization, etc.).
|
8
8
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
9
|
# Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
|
10
10
|
attribute :status, Types::Strict::String.meta(omittable: true)
|
11
|
-
attribute :role, Types::Strict::Array.of(DescriptiveValue).
|
12
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
13
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
11
|
+
attribute :role, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
12
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
14
|
# URL or other pointer to the location of the contributor information.
|
15
15
|
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
16
16
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
@@ -3,16 +3,16 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveParallelEvent < Struct
|
6
|
-
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
7
|
# Description of the event (creation, publication, etc.).
|
8
8
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
9
|
# The preferred display label to use for the event in access systems.
|
10
10
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
11
|
-
attribute :date, Types::Strict::Array.of(DescriptiveValue).
|
12
|
-
attribute :contributor, Types::Strict::Array.of(Contributor).
|
13
|
-
attribute :location, Types::Strict::Array.of(DescriptiveValue).
|
14
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
15
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
11
|
+
attribute :date, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
12
|
+
attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
|
13
|
+
attribute :location, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
15
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
16
16
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
17
17
|
end
|
18
18
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveParallelValue < Struct
|
6
|
-
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveStructuredValue < Struct
|
6
|
-
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -3,9 +3,9 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveValue < Struct
|
6
|
-
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).
|
7
|
-
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).
|
8
|
-
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
8
|
+
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
9
9
|
# String or integer value of the descriptive element.
|
10
10
|
attribute :value, Types::Nominal::Any.meta(omittable: true)
|
11
11
|
# Type of value provided by the descriptive element.
|
@@ -18,17 +18,17 @@ module Cocina
|
|
18
18
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
19
19
|
attribute :standard, Standard.optional.meta(omittable: true)
|
20
20
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
21
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
21
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
22
22
|
attribute :source, Source.optional.meta(omittable: true)
|
23
23
|
# The preferred display label to use for the descriptive element in access systems.
|
24
24
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
25
25
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
26
26
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
27
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
27
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
28
28
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
29
29
|
# URL or other pointer to the location of the value of the descriptive element.
|
30
30
|
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
31
|
-
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).
|
31
|
+
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([].freeze)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -9,7 +9,7 @@ module Cocina
|
|
9
9
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
10
10
|
# String describing the standard or encoding.
|
11
11
|
attribute :value, Types::Strict::String.meta(omittable: true)
|
12
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
12
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
13
|
# The version of the standard or encoding.
|
14
14
|
attribute :version, Types::Strict::String.meta(omittable: true)
|
15
15
|
attribute :source, Source.optional.meta(omittable: true)
|
@@ -3,9 +3,9 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DROStructural < Struct
|
6
|
-
attribute :contains, Types::Strict::Array.of(FileSet).
|
7
|
-
attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).
|
8
|
-
attribute :isMemberOf, Types::Strict::Array.of(Druid).
|
6
|
+
attribute :contains, Types::Strict::Array.of(FileSet).default([].freeze)
|
7
|
+
attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).default([].freeze)
|
8
|
+
attribute :isMemberOf, Types::Strict::Array.of(Druid).default([].freeze)
|
9
9
|
# Agreement that covers the deposit of the DRO into SDR.
|
10
10
|
attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
|
11
11
|
end
|
data/lib/cocina/models/event.rb
CHANGED
@@ -3,18 +3,18 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Event < Struct
|
6
|
-
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
7
|
# Description of the event (creation, publication, etc.).
|
8
8
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
9
|
# The preferred display label to use for the event in access systems.
|
10
10
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
11
|
-
attribute :date, Types::Strict::Array.of(DescriptiveValue).
|
12
|
-
attribute :contributor, Types::Strict::Array.of(Contributor).
|
13
|
-
attribute :location, Types::Strict::Array.of(DescriptiveValue).
|
14
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
15
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
11
|
+
attribute :date, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
12
|
+
attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
|
13
|
+
attribute :location, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
15
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
16
16
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
17
|
-
attribute :parallelEvent, Types::Strict::Array.of(DescriptiveParallelEvent).
|
17
|
+
attribute :parallelEvent, Types::Strict::Array.of(DescriptiveParallelEvent).default([].freeze)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -5,9 +5,9 @@ module Cocina
|
|
5
5
|
class Identification < Struct
|
6
6
|
# A barcode
|
7
7
|
attribute :barcode, Types::Nominal::Any.meta(omittable: true)
|
8
|
-
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).
|
8
|
+
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([].freeze)
|
9
9
|
# Digital Object Identifier (https://www.doi.org)
|
10
|
-
# example: 10.25740/
|
10
|
+
# example: 10.25740/bc123df4567
|
11
11
|
attribute :doi, Types::Strict::String.meta(omittable: true)
|
12
12
|
# Unique identifier in some other system. This is because a large proportion of what is deposited in SDR, historically and currently, are representations of objects that are also represented in other systems. For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
|
13
13
|
|
@@ -3,15 +3,15 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Language < Struct
|
6
|
-
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).
|
6
|
+
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([].freeze)
|
7
7
|
# Code value of the descriptive element.
|
8
8
|
attribute :code, Types::Strict::String.meta(omittable: true)
|
9
9
|
# The preferred display label to use for the descriptive element in access systems.
|
10
10
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
11
11
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
12
|
-
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).
|
13
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
14
|
-
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).
|
12
|
+
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
15
15
|
# present for mapping to additional schemas in the future and for consistency but not otherwise used
|
16
16
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
17
17
|
attribute :script, DescriptiveValue.optional.meta(omittable: true)
|
@@ -19,7 +19,7 @@ module Cocina
|
|
19
19
|
# Status of the language relative to other parallel language elements (e.g. the primary language)
|
20
20
|
attribute :status, Types::Strict::String.enum('primary').meta(omittable: true)
|
21
21
|
attribute :standard, Standard.optional.meta(omittable: true)
|
22
|
-
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).
|
22
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
23
23
|
# URI value of the descriptive element.
|
24
24
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
25
25
|
# Value of the descriptive element.
|
data/lib/cocina/models/purl.rb
CHANGED
@@ -9,19 +9,19 @@ module Cocina
|
|
9
9
|
attribute :status, Types::Strict::String.meta(omittable: true)
|
10
10
|
# The preferred display label to use for the related resource in access systems.
|
11
11
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
12
|
-
attribute :title, Types::Strict::Array.of(DescriptiveValue).
|
13
|
-
attribute :contributor, Types::Strict::Array.of(Contributor).
|
14
|
-
attribute :event, Types::Strict::Array.of(Event).
|
15
|
-
attribute :form, Types::Strict::Array.of(DescriptiveValue).
|
16
|
-
attribute :language, Types::Strict::Array.of(Language).
|
17
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
18
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
12
|
+
attribute :title, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
|
+
attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
|
14
|
+
attribute :event, Types::Strict::Array.of(Event).default([].freeze)
|
15
|
+
attribute :form, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
16
|
+
attribute :language, Types::Strict::Array.of(Language).default([].freeze)
|
17
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
18
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
19
19
|
attribute :standard, Standard.optional.meta(omittable: true)
|
20
|
-
attribute :subject, Types::Strict::Array.of(DescriptiveValue).
|
20
|
+
attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
21
21
|
# Stanford persistent URL associated with the related resource. Note this is http, not https.
|
22
22
|
attribute :purl, Types::Strict::String.meta(omittable: true)
|
23
23
|
attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
|
24
|
-
attribute :relatedResource, Types::Strict::Array.of(RelatedResource).
|
24
|
+
attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([].freeze)
|
25
25
|
attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
|
26
26
|
# The version of the related resource.
|
27
27
|
attribute :version, Types::Strict::String.meta(omittable: true)
|
@@ -3,9 +3,9 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class RequestDROStructural < Struct
|
6
|
-
attribute :contains, Types::Strict::Array.of(RequestFileSet).
|
7
|
-
attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).
|
8
|
-
attribute :isMemberOf, Types::Strict::Array.of(Druid).
|
6
|
+
attribute :contains, Types::Strict::Array.of(RequestFileSet).default([].freeze)
|
7
|
+
attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).default([].freeze)
|
8
|
+
attribute :isMemberOf, Types::Strict::Array.of(Druid).default([].freeze)
|
9
9
|
attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
|
10
10
|
end
|
11
11
|
end
|
@@ -5,7 +5,7 @@ module Cocina
|
|
5
5
|
class RequestIdentification < Struct
|
6
6
|
# A barcode
|
7
7
|
attribute :barcode, Types::Nominal::Any.meta(omittable: true)
|
8
|
-
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).
|
8
|
+
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([].freeze)
|
9
9
|
# Unique identifier in some other system. This is because a large proportion of what is deposited in SDR, historically and currently, are representations of objects that are also represented in other systems. For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
|
10
10
|
|
11
11
|
# example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Sequence < Struct
|
6
|
-
attribute :members, Types::Strict::Array.of(Types::Strict::String).
|
6
|
+
attribute :members, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
|
7
7
|
# The direction that a sequence of canvases should be displayed to the user
|
8
8
|
attribute :viewingDirection, Types::Strict::String.enum('right-to-left', 'left-to-right').meta(omittable: true)
|
9
9
|
end
|
data/lib/cocina/models/source.rb
CHANGED
@@ -9,7 +9,7 @@ module Cocina
|
|
9
9
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
10
10
|
# String describing the value source.
|
11
11
|
attribute :value, Types::Strict::String.meta(omittable: true)
|
12
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
12
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
13
|
# The version of the value source.
|
14
14
|
attribute :version, Types::Strict::String.meta(omittable: true)
|
15
15
|
end
|
@@ -9,7 +9,7 @@ module Cocina
|
|
9
9
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
10
10
|
# String describing the standard or encoding.
|
11
11
|
attribute :value, Types::Strict::String.meta(omittable: true)
|
12
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
12
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
13
|
# The version of the standard or encoding.
|
14
14
|
attribute :version, Types::Strict::String.meta(omittable: true)
|
15
15
|
attribute :source, Source.optional.meta(omittable: true)
|
data/lib/cocina/models/title.rb
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Title < Struct
|
6
|
-
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).
|
7
|
-
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).
|
8
|
-
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
7
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
8
|
+
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
9
9
|
# String or integer value of the descriptive element.
|
10
10
|
attribute :value, Types::Nominal::Any.meta(omittable: true)
|
11
11
|
# Type of value provided by the descriptive element.
|
@@ -18,17 +18,17 @@ module Cocina
|
|
18
18
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
19
19
|
attribute :standard, Standard.optional.meta(omittable: true)
|
20
20
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
21
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).
|
21
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
22
22
|
attribute :source, Source.optional.meta(omittable: true)
|
23
23
|
# The preferred display label to use for the descriptive element in access systems.
|
24
24
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
25
25
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
26
26
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
27
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).
|
27
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
28
28
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
29
29
|
# URL or other pointer to the location of the value of the descriptive element.
|
30
30
|
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
31
|
-
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).
|
31
|
+
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([].freeze)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
data/lib/cocina/models.rb
CHANGED
data/openapi.yml
CHANGED
@@ -1396,8 +1396,8 @@ components:
|
|
1396
1396
|
description: Stanford persistent URL associated with the related resource. Note this is http, not https.
|
1397
1397
|
type: string
|
1398
1398
|
format: uri
|
1399
|
-
# Canonical URI is
|
1400
|
-
pattern: '^
|
1399
|
+
# Canonical URI is https
|
1400
|
+
pattern: '^https:\/\/'
|
1401
1401
|
RelatedResource:
|
1402
1402
|
description: Other resource associated with the described resource.
|
1403
1403
|
type: object
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocina-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.63.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -170,42 +170,56 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
173
|
+
version: '1.24'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
180
|
+
version: '1.24'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rubocop-rake
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
196
|
name: rubocop-rspec
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
184
198
|
requirements:
|
185
199
|
- - "~>"
|
186
200
|
- !ruby/object:Gem::Version
|
187
|
-
version: '1
|
201
|
+
version: '2.1'
|
188
202
|
type: :development
|
189
203
|
prerelease: false
|
190
204
|
version_requirements: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
206
|
- - "~>"
|
193
207
|
- !ruby/object:Gem::Version
|
194
|
-
version: '1
|
208
|
+
version: '2.1'
|
195
209
|
- !ruby/object:Gem::Dependency
|
196
210
|
name: simplecov
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|
198
212
|
requirements:
|
199
|
-
- - "
|
213
|
+
- - ">="
|
200
214
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0
|
215
|
+
version: '0'
|
202
216
|
type: :development
|
203
217
|
prerelease: false
|
204
218
|
version_requirements: !ruby/object:Gem::Requirement
|
205
219
|
requirements:
|
206
|
-
- - "
|
220
|
+
- - ">="
|
207
221
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0
|
222
|
+
version: '0'
|
209
223
|
description: SDR data models that can be validated
|
210
224
|
email:
|
211
225
|
- jcoyne@justincoyne.com
|
@@ -329,7 +343,8 @@ files:
|
|
329
343
|
- openapi.yml
|
330
344
|
homepage: https://github.com/sul-dlss/cocina-models
|
331
345
|
licenses: []
|
332
|
-
metadata:
|
346
|
+
metadata:
|
347
|
+
rubygems_mfa_required: 'true'
|
333
348
|
post_install_message:
|
334
349
|
rdoc_options: []
|
335
350
|
require_paths:
|
@@ -338,14 +353,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
338
353
|
requirements:
|
339
354
|
- - ">="
|
340
355
|
- !ruby/object:Gem::Version
|
341
|
-
version: '2.
|
356
|
+
version: '2.7'
|
342
357
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
343
358
|
requirements:
|
344
359
|
- - ">="
|
345
360
|
- !ruby/object:Gem::Version
|
346
361
|
version: '0'
|
347
362
|
requirements: []
|
348
|
-
rubygems_version: 3.
|
363
|
+
rubygems_version: 3.3.4
|
349
364
|
signing_key:
|
350
365
|
specification_version: 4
|
351
366
|
summary: Data models for the SDR
|