cocina-models 0.34.0 → 0.38.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +63 -1
- data/README.md +11 -0
- data/cocina-models.gemspec +1 -0
- data/docs/maps/DRO.json +9 -2
- data/lib/cocina/generator/datatype.rb +22 -0
- data/lib/cocina/generator/generator.rb +11 -3
- data/lib/cocina/models/contributor.rb +3 -1
- data/lib/cocina/models/description.rb +4 -2
- data/lib/cocina/models/descriptive_access_metadata.rb +13 -0
- data/lib/cocina/models/descriptive_admin_metadata.rb +3 -1
- data/lib/cocina/models/descriptive_basic_value.rb +10 -3
- data/lib/cocina/models/descriptive_parallel_value.rb +9 -0
- data/lib/cocina/models/descriptive_structured_value.rb +1 -1
- data/lib/cocina/models/descriptive_value.rb +10 -4
- data/lib/cocina/models/descriptive_value_required.rb +10 -4
- data/lib/cocina/models/dro_access.rb +2 -0
- data/lib/cocina/models/dro_structural.rb +1 -2
- data/lib/cocina/models/druid.rb +9 -0
- data/lib/cocina/models/event.rb +1 -1
- data/lib/cocina/models/file.rb +1 -1
- data/lib/cocina/models/file_access.rb +16 -0
- data/lib/cocina/models/identification.rb +2 -0
- data/lib/cocina/models/language.rb +30 -0
- data/lib/cocina/models/related_resource.rb +21 -0
- data/lib/cocina/models/request_dro.rb +1 -1
- data/lib/cocina/models/request_dro_structural.rb +1 -2
- data/lib/cocina/models/request_file.rb +1 -1
- data/lib/cocina/models/request_identification.rb +2 -0
- data/lib/cocina/models/source.rb +1 -0
- data/lib/cocina/models/source_id.rb +9 -0
- data/lib/cocina/models/standard.rb +16 -0
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +337 -111
- metadata +16 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c956bcb234bb19ae05ab24d3b64efd2827bf23ab0d7953c5dc8405532f2391f
|
4
|
+
data.tar.gz: 3fa549a561323f9cb19a595159e3c7eafd100be257920240dc2dde6800766af7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03ba5b89ddf4fdbaa9a3167004771b9bcacf92409800735e1816e3db132bc3d4199fe62218f48053d7cd2bf5faeb53d2c542b16ee1b420bf5fec154f8a444da9
|
7
|
+
data.tar.gz: b2fbbd2b9b1477bcdead8c3c8a186ae96c577e3b8431f7c23d92fa44b97d320f3e3f415121e26231f88f2ee594c0e3949eed5f65865e88fed24d52c7f1952cda
|
data/.rubocop.yml
CHANGED
@@ -4,6 +4,9 @@ inherit_from: .rubocop_todo.yml
|
|
4
4
|
require:
|
5
5
|
- rubocop-rspec
|
6
6
|
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 2.5
|
9
|
+
|
7
10
|
Layout/LineLength:
|
8
11
|
Max: 114
|
9
12
|
Exclude:
|
@@ -80,4 +83,63 @@ Style/RedundantRegexpEscape:
|
|
80
83
|
|
81
84
|
Style/SlicingWithRange:
|
82
85
|
Enabled: true
|
83
|
-
|
86
|
+
|
87
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
88
|
+
Enabled: true
|
89
|
+
|
90
|
+
Lint/DuplicateElsifCondition:
|
91
|
+
Enabled: true
|
92
|
+
|
93
|
+
Lint/DuplicateRescueException:
|
94
|
+
Enabled: true
|
95
|
+
|
96
|
+
Lint/EmptyConditionalBody:
|
97
|
+
Enabled: true
|
98
|
+
|
99
|
+
Lint/FloatComparison:
|
100
|
+
Enabled: true
|
101
|
+
|
102
|
+
Lint/MissingSuper:
|
103
|
+
Enabled: true
|
104
|
+
|
105
|
+
Lint/OutOfRangeRegexpRef:
|
106
|
+
Enabled: true
|
107
|
+
|
108
|
+
Lint/SelfAssignment:
|
109
|
+
Enabled: true
|
110
|
+
|
111
|
+
Lint/TopLevelReturnWithArgument:
|
112
|
+
Enabled: true
|
113
|
+
|
114
|
+
Lint/UnreachableLoop:
|
115
|
+
Enabled: true
|
116
|
+
|
117
|
+
Style/ArrayCoercion:
|
118
|
+
Enabled: true
|
119
|
+
|
120
|
+
Style/CaseLikeIf:
|
121
|
+
Enabled: true
|
122
|
+
|
123
|
+
Style/ExplicitBlockArgument:
|
124
|
+
Enabled: true
|
125
|
+
|
126
|
+
Style/GlobalStdStream:
|
127
|
+
Enabled: true
|
128
|
+
|
129
|
+
Style/HashAsLastArrayItem:
|
130
|
+
Enabled: true
|
131
|
+
|
132
|
+
Style/HashLikeCase:
|
133
|
+
Enabled: true
|
134
|
+
|
135
|
+
Style/OptionalBooleanParameter:
|
136
|
+
Enabled: false
|
137
|
+
|
138
|
+
Style/RedundantFileExtensionInRequire:
|
139
|
+
Enabled: true
|
140
|
+
|
141
|
+
Style/SingleArgumentDig:
|
142
|
+
Enabled: true
|
143
|
+
|
144
|
+
Style/StringConcatenation:
|
145
|
+
Enabled: true
|
data/README.md
CHANGED
@@ -32,6 +32,17 @@ The generator is tested via its output when run against `openapi.yml`, viz., the
|
|
32
32
|
|
33
33
|
Beyond what is necessary to test the generator, the Cocina model classes are not tested, i.e., they are assumed to be as specified in `openapi.yml`.
|
34
34
|
|
35
|
+
## Releasing
|
36
|
+
|
37
|
+
The release process is much like any other gem. First bump the version in `lib/cocina/models/version.rb`, and commit the result. Then run:
|
38
|
+
```
|
39
|
+
bundle exec rake release
|
40
|
+
```
|
41
|
+
which pushes the gem to rubygems.org. Next write up the release notes: https://github.com/sul-dlss/cocina-models/releases .
|
42
|
+
|
43
|
+
Finally, you must release versions of [sdr-client](https://github.com/sul-dlss/sdr-client) and [dor-services-client](https://github.com/sul-dlss/dor-services-client/) pinned to this version because [Argo](https://github.com/sul-dlss/argo) depends on both of those. When [dor-services-app](https://github.com/sul-dlss/dor-services-app) is updated to use the new models (via the auto-update script), the clients must be updated at the same time or there is risk of models produced by dor-services-app not being acceptable to the clients.
|
44
|
+
|
45
|
+
|
35
46
|
## Using this gem
|
36
47
|
|
37
48
|
If you are using this gem in an application that has an API that accepts Cocina models (e.g., SDR API, Dor-Services-App), make sure that the `openapi.yml` for the application includes the schemas that match the schemas in this `openapi.yml`.
|
data/cocina-models.gemspec
CHANGED
@@ -22,6 +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.5'
|
25
26
|
|
26
27
|
spec.add_dependency 'activesupport'
|
27
28
|
spec.add_dependency 'dry-struct', '~> 1.0'
|
data/docs/maps/DRO.json
CHANGED
@@ -81,6 +81,10 @@
|
|
81
81
|
"description": "The human readable copyright statement that applies to the DRO.",
|
82
82
|
"type": "string"
|
83
83
|
},
|
84
|
+
"controlledDigitalLending": {
|
85
|
+
"description": "If the object is available for controlled digital lending.",
|
86
|
+
"type": "boolean"
|
87
|
+
},
|
84
88
|
"download": {
|
85
89
|
"description": "Download level for the DRO metadata.",
|
86
90
|
"type": "string",
|
@@ -294,8 +298,11 @@
|
|
294
298
|
}
|
295
299
|
},
|
296
300
|
"isMemberOf": {
|
297
|
-
"description": "
|
298
|
-
"type": "
|
301
|
+
"description": "Collections that this DRO is a member of",
|
302
|
+
"type": "array",
|
303
|
+
"items": {
|
304
|
+
"type": "string"
|
305
|
+
}
|
299
306
|
},
|
300
307
|
"isTargetOf": {
|
301
308
|
"description": "An Annotation instance that applies to the DRO.",
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Generator
|
5
|
+
# Class for generating from an openapi schema
|
6
|
+
class Datatype < SchemaBase
|
7
|
+
def generate
|
8
|
+
<<~RUBY
|
9
|
+
# frozen_string_literal: true
|
10
|
+
|
11
|
+
module Cocina
|
12
|
+
module Models
|
13
|
+
#{name} = Types::String.constrained(
|
14
|
+
format: /#{schema_doc.pattern}/i
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
RUBY
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -17,10 +17,13 @@ module Cocina
|
|
17
17
|
def generate
|
18
18
|
clean_output
|
19
19
|
|
20
|
-
|
20
|
+
# rubocop:disable Style/HashEachMethods
|
21
|
+
# This is not a Hash
|
22
|
+
schemas.keys.each do |schema_name|
|
21
23
|
schema = schema_for(schema_name)
|
22
24
|
generate_for(schema) if schema
|
23
25
|
end
|
26
|
+
# rubocop:enable Style/HashEachMethods
|
24
27
|
|
25
28
|
generate_vocab
|
26
29
|
end
|
@@ -53,9 +56,14 @@ module Cocina
|
|
53
56
|
|
54
57
|
def schema_for(schema_name)
|
55
58
|
schema_doc = schemas[schema_name]
|
56
|
-
return nil if schema_doc.nil?
|
59
|
+
return nil if schema_doc.nil?
|
57
60
|
|
58
|
-
|
61
|
+
case schema_doc.type
|
62
|
+
when 'object'
|
63
|
+
Schema.new(schema_doc)
|
64
|
+
when 'string'
|
65
|
+
Datatype.new(schema_doc)
|
66
|
+
end
|
59
67
|
end
|
60
68
|
|
61
69
|
def generate_for(schema)
|
@@ -6,9 +6,11 @@ module Cocina
|
|
6
6
|
attribute :name, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
# Entity type of the contributor (person, organization, etc.).
|
8
8
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
|
-
# Status of the contributor relative to other parallel contributors.
|
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
11
|
attribute :role, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
@@ -7,12 +7,14 @@ module Cocina
|
|
7
7
|
attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
|
8
8
|
attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
|
9
9
|
attribute :form, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
10
|
-
attribute :language, Types::Strict::Array.of(
|
10
|
+
attribute :language, Types::Strict::Array.of(Language).meta(omittable: true)
|
11
11
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
12
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
|
+
attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
14
|
# Stanford persistent URL associated with the resource.
|
14
15
|
attribute :purl, Types::Strict::String.meta(omittable: true)
|
15
|
-
attribute :
|
16
|
+
attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
|
17
|
+
attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
|
16
18
|
attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
17
19
|
attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
|
18
20
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class DescriptiveAccessMetadata < Struct
|
6
|
+
attribute :url, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
|
+
attribute :physicalLocation, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
|
+
attribute :accessContact, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
9
|
+
attribute :digitalRepository, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
10
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -5,8 +5,10 @@ module Cocina
|
|
5
5
|
class DescriptiveAdminMetadata < Struct
|
6
6
|
attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
|
7
7
|
attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
|
8
|
-
attribute :language, Types::Strict::Array.of(
|
8
|
+
attribute :language, Types::Strict::Array.of(Language).meta(omittable: true)
|
9
9
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
10
|
+
attribute :standard, Standard.optional.meta(omittable: true)
|
11
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
@@ -3,19 +3,26 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveBasicValue < Struct
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
6
8
|
# String value of the descriptive element.
|
7
9
|
attribute :value, Types::Strict::String.meta(omittable: true)
|
8
10
|
# Type of value provided by the descriptive element.
|
9
11
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
10
|
-
# Status of the descriptive element relative to other instances of the element.
|
12
|
+
# Status of the descriptive element value relative to other instances of the element.
|
11
13
|
attribute :status, Types::Strict::String.meta(omittable: true)
|
12
14
|
# Code value of the descriptive element.
|
13
15
|
attribute :code, Types::Strict::String.meta(omittable: true)
|
14
16
|
# URI value of the descriptive element.
|
15
17
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
16
|
-
attribute :standard,
|
17
|
-
attribute :encoding,
|
18
|
+
attribute :standard, Standard.optional.meta(omittable: true)
|
19
|
+
attribute :encoding, Standard.optional.meta(omittable: true)
|
18
20
|
attribute :source, Source.optional.meta(omittable: true)
|
21
|
+
# The preferred display label to use for the descriptive element in access systems.
|
22
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
23
|
+
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
|
+
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
19
26
|
end
|
20
27
|
end
|
21
28
|
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(
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -3,20 +3,26 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveValue < Struct
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
6
8
|
# String value of the descriptive element.
|
7
9
|
attribute :value, Types::Strict::String.meta(omittable: true)
|
8
10
|
# Type of value provided by the descriptive element.
|
9
11
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
10
|
-
# Status of the descriptive element relative to other instances of the element.
|
12
|
+
# Status of the descriptive element value relative to other instances of the element.
|
11
13
|
attribute :status, Types::Strict::String.meta(omittable: true)
|
12
14
|
# Code value of the descriptive element.
|
13
15
|
attribute :code, Types::Strict::String.meta(omittable: true)
|
14
16
|
# URI value of the descriptive element.
|
15
17
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
16
|
-
attribute :standard,
|
17
|
-
attribute :encoding,
|
18
|
+
attribute :standard, Standard.optional.meta(omittable: true)
|
19
|
+
attribute :encoding, Standard.optional.meta(omittable: true)
|
18
20
|
attribute :source, Source.optional.meta(omittable: true)
|
19
|
-
|
21
|
+
# The preferred display label to use for the descriptive element in access systems.
|
22
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
23
|
+
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
|
+
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
20
26
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
21
27
|
end
|
22
28
|
end
|
@@ -3,20 +3,26 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DescriptiveValueRequired < Struct
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
6
8
|
# String value of the descriptive element.
|
7
9
|
attribute :value, Types::Strict::String.meta(omittable: true)
|
8
10
|
# Type of value provided by the descriptive element.
|
9
11
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
10
|
-
# Status of the descriptive element relative to other instances of the element.
|
12
|
+
# Status of the descriptive element value relative to other instances of the element.
|
11
13
|
attribute :status, Types::Strict::String.meta(omittable: true)
|
12
14
|
# Code value of the descriptive element.
|
13
15
|
attribute :code, Types::Strict::String.meta(omittable: true)
|
14
16
|
# URI value of the descriptive element.
|
15
17
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
16
|
-
attribute :standard,
|
17
|
-
attribute :encoding,
|
18
|
+
attribute :standard, Standard.optional.meta(omittable: true)
|
19
|
+
attribute :encoding, Standard.optional.meta(omittable: true)
|
18
20
|
attribute :source, Source.optional.meta(omittable: true)
|
19
|
-
|
21
|
+
# The preferred display label to use for the descriptive element in access systems.
|
22
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
23
|
+
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
|
+
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
20
26
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
21
27
|
end
|
22
28
|
end
|
@@ -4,6 +4,8 @@ module Cocina
|
|
4
4
|
module Models
|
5
5
|
class DROAccess < Struct
|
6
6
|
attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
|
7
|
+
# Available for controlled digital lending.
|
8
|
+
attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
|
7
9
|
# The human readable copyright statement that applies
|
8
10
|
# example: Copyright World Trade Organization
|
9
11
|
attribute :copyright, Types::Strict::String.meta(omittable: true)
|
@@ -5,8 +5,7 @@ module Cocina
|
|
5
5
|
class DROStructural < Struct
|
6
6
|
attribute :contains, Types::Strict::Array.of(FileSet).meta(omittable: true)
|
7
7
|
attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).meta(omittable: true)
|
8
|
-
|
9
|
-
attribute :isMemberOf, Types::Strict::String.meta(omittable: true)
|
8
|
+
attribute :isMemberOf, Types::Strict::Array.of(Druid).meta(omittable: true)
|
10
9
|
# Agreement that covers the deposit of the DRO into SDR.
|
11
10
|
attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
|
12
11
|
end
|
data/lib/cocina/models/event.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Event < Struct
|
6
|
-
attribute :structuredValue, Types::Strict::Array.of(
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
# Description of the event (creation, publication, etc.).
|
8
8
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
9
|
attribute :date, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
data/lib/cocina/models/file.rb
CHANGED
@@ -24,7 +24,7 @@ module Cocina
|
|
24
24
|
# Use for the File.
|
25
25
|
attribute :use, Types::Strict::String.meta(omittable: true)
|
26
26
|
attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([].freeze)
|
27
|
-
attribute(:access,
|
27
|
+
attribute(:access, FileAccess.default { FileAccess.new })
|
28
28
|
attribute(:administrative, FileAdministrative.default { FileAdministrative.new })
|
29
29
|
attribute :presentation, Presentation.optional.meta(omittable: true)
|
30
30
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class FileAccess < Struct
|
6
|
+
# Access level
|
7
|
+
attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
|
8
|
+
# Available for controlled digital lending.
|
9
|
+
attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
|
10
|
+
# Download access level for a file
|
11
|
+
attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
|
12
|
+
# If access is "location-based", which location should have access.
|
13
|
+
attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -3,6 +3,8 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Identification < Struct
|
6
|
+
# 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"
|
7
|
+
|
6
8
|
# example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
|
7
9
|
attribute :sourceId, Types::Strict::String.meta(omittable: true)
|
8
10
|
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
|