cocina-models 0.34.1 → 0.39.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 +7 -2
- 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 +1 -1
- data/lib/cocina/models/language.rb +30 -0
- data/lib/cocina/models/related_resource.rb +21 -0
- 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 +1 -1
- 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 +339 -110
- 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: b596e537652f3adbdf99641f88e6cdd90a06a8fd60e4554c41124dcec66984e9
|
4
|
+
data.tar.gz: fe1a342bdd92e4400ace4e1ee9f1fa0a2145186870c5adfc32ac5fb5a77bf366
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9b8910c593bcf0295cd290b2c843a93b143c9f6359d1b8d72aa9f62789731ae885bc1a24747228fd9f78adc84c75249b3732114da0b94a9fa74cb77e646acec
|
7
|
+
data.tar.gz: c386a293ffd53005c3afb81248b6ab7c273b3f94b36fd3f93f9db45c35c8c720fd9c478bbefb9ad8f56bf7a9391c7eb7e2092610bd2c63c1615c4bdca45ad215
|
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
|
@@ -56,9 +56,14 @@ module Cocina
|
|
56
56
|
|
57
57
|
def schema_for(schema_name)
|
58
58
|
schema_doc = schemas[schema_name]
|
59
|
-
return nil if schema_doc.nil?
|
59
|
+
return nil if schema_doc.nil?
|
60
60
|
|
61
|
-
|
61
|
+
case schema_doc.type
|
62
|
+
when 'object'
|
63
|
+
Schema.new(schema_doc)
|
64
|
+
when 'string'
|
65
|
+
Datatype.new(schema_doc)
|
66
|
+
end
|
62
67
|
end
|
63
68
|
|
64
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,7 +3,7 @@
|
|
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.
|
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
7
|
|
8
8
|
# example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
|
9
9
|
attribute :sourceId, Types::Strict::String.meta(omittable: true)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class Language < Struct
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
|
+
# String value of the descriptive element.
|
9
|
+
attribute :value, Types::Strict::String.meta(omittable: true)
|
10
|
+
# Type of value provided by the descriptive element.
|
11
|
+
attribute :type, Types::Strict::String.meta(omittable: true)
|
12
|
+
# Status of the descriptive element value relative to other instances of the element.
|
13
|
+
attribute :status, Types::Strict::String.meta(omittable: true)
|
14
|
+
# Code value of the descriptive element.
|
15
|
+
attribute :code, Types::Strict::String.meta(omittable: true)
|
16
|
+
# URI value of the descriptive element.
|
17
|
+
attribute :uri, Types::Strict::String.meta(omittable: true)
|
18
|
+
attribute :standard, Standard.optional.meta(omittable: true)
|
19
|
+
attribute :encoding, Standard.optional.meta(omittable: true)
|
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)
|
26
|
+
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
27
|
+
attribute :script, DescriptiveValue.optional.meta(omittable: true)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class RelatedResource < Struct
|
6
|
+
# The relationship of the related resource to the described resource.
|
7
|
+
attribute :type, Types::Strict::String.meta(omittable: true)
|
8
|
+
attribute :title, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
9
|
+
attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
|
10
|
+
attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
|
11
|
+
attribute :form, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
|
+
attribute :language, Types::Strict::Array.of(Language).meta(omittable: true)
|
13
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
15
|
+
attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
16
|
+
# Stanford persistent URL associated with the related resource.
|
17
|
+
attribute :purl, Types::Strict::String.meta(omittable: true)
|
18
|
+
attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -5,8 +5,7 @@ module Cocina
|
|
5
5
|
class RequestDROStructural < Struct
|
6
6
|
attribute :contains, Types::Strict::Array.of(RequestFileSet).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
|
attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
|
11
10
|
end
|
12
11
|
end
|
@@ -16,7 +16,7 @@ module Cocina
|
|
16
16
|
attribute :externalIdentifier, Types::Strict::String.meta(omittable: true)
|
17
17
|
attribute :use, Types::Strict::String.meta(omittable: true)
|
18
18
|
attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([].freeze)
|
19
|
-
attribute(:access,
|
19
|
+
attribute(:access, FileAccess.default { FileAccess.new })
|
20
20
|
attribute(:administrative, FileAdministrative.default { FileAdministrative.new })
|
21
21
|
attribute :presentation, Presentation.optional.meta(omittable: true)
|
22
22
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class RequestIdentification < 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.
|
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
7
|
|
8
8
|
# example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
|
9
9
|
attribute :sourceId, Types::Strict::String
|
data/lib/cocina/models/source.rb
CHANGED
@@ -9,6 +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).meta(omittable: true)
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class Standard < Struct
|
6
|
+
# Code representing the standard or encoding.
|
7
|
+
attribute :code, Types::Strict::String.meta(omittable: true)
|
8
|
+
# URI for the standard or encoding.
|
9
|
+
attribute :uri, Types::Strict::String.meta(omittable: true)
|
10
|
+
# String describing the standard or encoding.
|
11
|
+
attribute :value, Types::Strict::String.meta(omittable: true)
|
12
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
|
+
attribute :source, Source.optional.meta(omittable: true)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/openapi.yml
CHANGED
@@ -94,7 +94,7 @@ paths:
|
|
94
94
|
components:
|
95
95
|
schemas:
|
96
96
|
Access:
|
97
|
-
description: Access metadata
|
97
|
+
description: Access metadata for collections
|
98
98
|
type: object
|
99
99
|
additionalProperties: false
|
100
100
|
properties:
|
@@ -254,7 +254,7 @@ components:
|
|
254
254
|
$ref: '#/components/schemas/CatalogLink'
|
255
255
|
Contributor:
|
256
256
|
description: Property model for describing agents contributing in some way to
|
257
|
-
the creation and history of the resource
|
257
|
+
the creation and history of the resource.
|
258
258
|
type: object
|
259
259
|
additionalProperties: false
|
260
260
|
properties:
|
@@ -267,7 +267,8 @@ components:
|
|
267
267
|
description: Entity type of the contributor (person, organization, etc.).
|
268
268
|
type: string
|
269
269
|
status:
|
270
|
-
description: Status of the contributor relative to other parallel contributors
|
270
|
+
description: Status of the contributor relative to other parallel contributors
|
271
|
+
(e.g. the primary author among a group of contributors).
|
271
272
|
type: string
|
272
273
|
role:
|
273
274
|
description: Relationships of the contributor to the resource or to an event
|
@@ -275,90 +276,16 @@ components:
|
|
275
276
|
type: array
|
276
277
|
items:
|
277
278
|
$ref: "#/components/schemas/DescriptiveValue"
|
278
|
-
|
279
|
-
|
280
|
-
type: object
|
281
|
-
additionalProperties: false
|
282
|
-
properties:
|
283
|
-
contributor:
|
284
|
-
type: array
|
285
|
-
items:
|
286
|
-
$ref: "#/components/schemas/Contributor"
|
287
|
-
event:
|
288
|
-
type: array
|
289
|
-
items:
|
290
|
-
$ref: "#/components/schemas/Event"
|
291
|
-
language:
|
279
|
+
identifier:
|
280
|
+
description: Identifiers and URIs associated with the contributor entity.
|
292
281
|
type: array
|
293
282
|
items:
|
294
283
|
$ref: "#/components/schemas/DescriptiveValue"
|
295
284
|
note:
|
285
|
+
description: Other information associated with the contributor.
|
296
286
|
type: array
|
297
287
|
items:
|
298
288
|
$ref: "#/components/schemas/DescriptiveValue"
|
299
|
-
DescriptiveBasicValue:
|
300
|
-
description: Value model for descriptive elements without recursive properties.
|
301
|
-
type: object
|
302
|
-
additionalProperties: false
|
303
|
-
properties:
|
304
|
-
value:
|
305
|
-
description: String value of the descriptive element.
|
306
|
-
type: string
|
307
|
-
type:
|
308
|
-
description: Type of value provided by the descriptive element.
|
309
|
-
type: string
|
310
|
-
status:
|
311
|
-
description: Status of the descriptive element relative to other instances
|
312
|
-
of the element.
|
313
|
-
type: string
|
314
|
-
code:
|
315
|
-
description: Code value of the descriptive element.
|
316
|
-
type: string
|
317
|
-
uri:
|
318
|
-
description: URI value of the descriptive element.
|
319
|
-
type: string
|
320
|
-
format: uri
|
321
|
-
standard:
|
322
|
-
description: Descriptive or content standard to which the value conforms.
|
323
|
-
type: array
|
324
|
-
items:
|
325
|
-
type: string
|
326
|
-
encoding:
|
327
|
-
description: Encoding schema, standard, or syntax to which the value conforms.
|
328
|
-
type: array
|
329
|
-
items:
|
330
|
-
type: string
|
331
|
-
source:
|
332
|
-
$ref: "#/components/schemas/Source"
|
333
|
-
DescriptiveStructuredValue:
|
334
|
-
description: Value model for descriptive elements structured as typed values.
|
335
|
-
type: object
|
336
|
-
additionalProperties: false
|
337
|
-
properties:
|
338
|
-
structuredValue:
|
339
|
-
type: array
|
340
|
-
items:
|
341
|
-
$ref: "#/components/schemas/DescriptiveBasicValue"
|
342
|
-
DescriptiveValue:
|
343
|
-
description: Default value model for descriptive elements.
|
344
|
-
type: object
|
345
|
-
additionalProperties: false
|
346
|
-
allOf:
|
347
|
-
- $ref: "#/components/schemas/DescriptiveBasicValue"
|
348
|
-
- $ref: "#/components/schemas/DescriptiveStructuredValue"
|
349
|
-
- $ref: "#/components/schemas/AppliesTo"
|
350
|
-
DescriptiveValueRequired:
|
351
|
-
type: object
|
352
|
-
additionalProperties: false
|
353
|
-
allOf:
|
354
|
-
- $ref: "#/components/schemas/DescriptiveValue"
|
355
|
-
- anyOf:
|
356
|
-
- type: object
|
357
|
-
required:
|
358
|
-
- value
|
359
|
-
- type: object
|
360
|
-
required:
|
361
|
-
- structuredValue
|
362
289
|
Description:
|
363
290
|
type: object
|
364
291
|
additionalProperties: false
|
@@ -387,17 +314,23 @@ components:
|
|
387
314
|
items:
|
388
315
|
$ref: "#/components/schemas/DescriptiveValue"
|
389
316
|
language:
|
390
|
-
description: Languages, scripts, and notations used in all or
|
317
|
+
description: Languages, scripts, symbolic systems, and notations used in all or
|
318
|
+
part of a resource.
|
391
319
|
type: array
|
392
320
|
items:
|
393
|
-
$ref: "#/components/schemas/
|
321
|
+
$ref: "#/components/schemas/Language"
|
394
322
|
note:
|
395
323
|
description: Additional information relevant to a resource.
|
396
324
|
type: array
|
397
325
|
items:
|
398
326
|
$ref: "#/components/schemas/DescriptiveValue"
|
399
327
|
identifier:
|
400
|
-
description:
|
328
|
+
description: Identifiers and URIs associated with the resource.
|
329
|
+
type: array
|
330
|
+
items:
|
331
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
332
|
+
subject:
|
333
|
+
description: Terms associated with the intellectual content of the resource.
|
401
334
|
type: array
|
402
335
|
items:
|
403
336
|
$ref: "#/components/schemas/DescriptiveValue"
|
@@ -405,11 +338,13 @@ components:
|
|
405
338
|
description: Stanford persistent URL associated with the resource.
|
406
339
|
type: string
|
407
340
|
format: uri
|
408
|
-
|
409
|
-
|
341
|
+
access:
|
342
|
+
$ref: "#/components/schemas/DescriptiveAccessMetadata"
|
343
|
+
relatedResource:
|
344
|
+
description: Other resources associated with the described resource.
|
410
345
|
type: array
|
411
346
|
items:
|
412
|
-
$ref: "#/components/schemas/
|
347
|
+
$ref: "#/components/schemas/RelatedResource"
|
413
348
|
marcEncodedData:
|
414
349
|
description: Data about the resource represented in MARC fixed fields and codes.
|
415
350
|
type: array
|
@@ -419,6 +354,156 @@ components:
|
|
419
354
|
$ref: "#/components/schemas/DescriptiveAdminMetadata"
|
420
355
|
required:
|
421
356
|
- title
|
357
|
+
DescriptiveAccessMetadata:
|
358
|
+
description: Information about how to access digital and physical versions of the object.
|
359
|
+
type: object
|
360
|
+
additionalProperties: false
|
361
|
+
properties:
|
362
|
+
url:
|
363
|
+
description: URLs where the resource may be accessed in full or part.
|
364
|
+
type: array
|
365
|
+
items:
|
366
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
367
|
+
physicalLocation:
|
368
|
+
description: Location of a physical version of the resource.
|
369
|
+
type: array
|
370
|
+
items:
|
371
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
372
|
+
accessContact:
|
373
|
+
description: The library, organization, or person responsible for access to the resource.
|
374
|
+
type: array
|
375
|
+
items:
|
376
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
377
|
+
digitalRepository:
|
378
|
+
description: The digital repositories that hold the resource.
|
379
|
+
type: array
|
380
|
+
items:
|
381
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
382
|
+
note:
|
383
|
+
description: Other information related to accessing the resource.
|
384
|
+
type: array
|
385
|
+
items:
|
386
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
387
|
+
DescriptiveAdminMetadata:
|
388
|
+
description: Information about this resource description.
|
389
|
+
type: object
|
390
|
+
additionalProperties: false
|
391
|
+
properties:
|
392
|
+
contributor:
|
393
|
+
description: Contributors to this resource description.
|
394
|
+
type: array
|
395
|
+
items:
|
396
|
+
$ref: "#/components/schemas/Contributor"
|
397
|
+
event:
|
398
|
+
description: Events in the history of this resource description.
|
399
|
+
type: array
|
400
|
+
items:
|
401
|
+
$ref: "#/components/schemas/Event"
|
402
|
+
language:
|
403
|
+
description: Languages, scripts, symbolic systems, and notations used
|
404
|
+
in this resource description.
|
405
|
+
type: array
|
406
|
+
items:
|
407
|
+
$ref: "#/components/schemas/Language"
|
408
|
+
note:
|
409
|
+
description: Other information related to this resource description.
|
410
|
+
type: array
|
411
|
+
items:
|
412
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
413
|
+
standard:
|
414
|
+
# description: Descriptive or content standard to which this resource description conforms.
|
415
|
+
$ref: "#/components/schemas/Standard"
|
416
|
+
identifier:
|
417
|
+
description: Identifiers associated with this resource description.
|
418
|
+
type: array
|
419
|
+
items:
|
420
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
421
|
+
DescriptiveBasicValue:
|
422
|
+
description: Basic value model for descriptive elements.
|
423
|
+
type: object
|
424
|
+
# additionalProperties breaks the validator, unclear as to why.
|
425
|
+
# additionalProperties: false
|
426
|
+
allOf:
|
427
|
+
- $ref: "#/components/schemas/DescriptiveStructuredValue"
|
428
|
+
- $ref: "#/components/schemas/DescriptiveParallelValue"
|
429
|
+
- type: object
|
430
|
+
additionalProperties: false
|
431
|
+
properties:
|
432
|
+
value:
|
433
|
+
description: String or integer value of the descriptive element.
|
434
|
+
oneOf:
|
435
|
+
- type: string
|
436
|
+
- type: integer
|
437
|
+
type:
|
438
|
+
description: Type of value provided by the descriptive element.
|
439
|
+
type: string
|
440
|
+
status:
|
441
|
+
description: Status of the descriptive element value relative to other instances
|
442
|
+
of the element.
|
443
|
+
type: string
|
444
|
+
code:
|
445
|
+
description: Code value of the descriptive element.
|
446
|
+
type: string
|
447
|
+
uri:
|
448
|
+
description: URI value of the descriptive element.
|
449
|
+
type: string
|
450
|
+
format: uri
|
451
|
+
standard:
|
452
|
+
# description: Descriptive or content standard to which the value conforms.
|
453
|
+
$ref: "#/components/schemas/Standard"
|
454
|
+
encoding:
|
455
|
+
# description: Encoding schema, standard, or syntax to which the value conforms.
|
456
|
+
$ref: "#/components/schemas/Standard"
|
457
|
+
source:
|
458
|
+
$ref: "#/components/schemas/Source"
|
459
|
+
displayLabel:
|
460
|
+
description: The preferred display label to use for the descriptive element in access systems.
|
461
|
+
type: string
|
462
|
+
qualifier:
|
463
|
+
description: A term providing information about the circumstances of the statement (e.g., approximate dates).
|
464
|
+
type: string
|
465
|
+
note:
|
466
|
+
description: Other information related to the descriptive element.
|
467
|
+
type: array
|
468
|
+
items:
|
469
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
470
|
+
DescriptiveParallelValue:
|
471
|
+
description: Value model for multiple representations of the same information (e.g. in different languages).
|
472
|
+
type: object
|
473
|
+
additionalProperties: false
|
474
|
+
properties:
|
475
|
+
parallelValue:
|
476
|
+
type: array
|
477
|
+
items:
|
478
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
479
|
+
DescriptiveStructuredValue:
|
480
|
+
description: Value model for descriptive elements structured as typed, ordered values.
|
481
|
+
type: object
|
482
|
+
additionalProperties: false
|
483
|
+
properties:
|
484
|
+
structuredValue:
|
485
|
+
type: array
|
486
|
+
items:
|
487
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
488
|
+
DescriptiveValue:
|
489
|
+
description: Default value model for descriptive elements.
|
490
|
+
type: object
|
491
|
+
additionalProperties: false
|
492
|
+
allOf:
|
493
|
+
- $ref: "#/components/schemas/DescriptiveBasicValue"
|
494
|
+
- $ref: "#/components/schemas/AppliesTo"
|
495
|
+
DescriptiveValueRequired:
|
496
|
+
type: object
|
497
|
+
additionalProperties: false
|
498
|
+
allOf:
|
499
|
+
- $ref: "#/components/schemas/DescriptiveValue"
|
500
|
+
- anyOf:
|
501
|
+
- type: object
|
502
|
+
required:
|
503
|
+
- value
|
504
|
+
- type: object
|
505
|
+
required:
|
506
|
+
- structuredValue
|
422
507
|
DRO:
|
423
508
|
description: Domain-defined abstraction of a 'work'. Digital Repository Objects' abstraction is describable for our domain’s purposes, i.e. for management needs within our system.
|
424
509
|
type: object
|
@@ -484,6 +569,10 @@ components:
|
|
484
569
|
- 'citation-only'
|
485
570
|
- 'dark'
|
486
571
|
default: 'dark'
|
572
|
+
controlledDigitalLending:
|
573
|
+
description: Available for controlled digital lending.
|
574
|
+
type: boolean
|
575
|
+
default: false
|
487
576
|
copyright:
|
488
577
|
description: The human readable copyright statement that applies
|
489
578
|
example: Copyright World Trade Organization
|
@@ -537,7 +626,10 @@ components:
|
|
537
626
|
items:
|
538
627
|
$ref: '#/components/schemas/Sequence'
|
539
628
|
isMemberOf:
|
540
|
-
|
629
|
+
description: Collections that this DRO is a member of
|
630
|
+
type: array
|
631
|
+
items:
|
632
|
+
$ref: '#/components/schemas/Druid'
|
541
633
|
hasAgreement:
|
542
634
|
description: Agreement that covers the deposit of the DRO into SDR.
|
543
635
|
type: string
|
@@ -638,7 +730,7 @@ components:
|
|
638
730
|
items:
|
639
731
|
$ref: '#/components/schemas/MessageDigest'
|
640
732
|
access:
|
641
|
-
$ref: '#/components/schemas/
|
733
|
+
$ref: '#/components/schemas/FileAccess'
|
642
734
|
administrative:
|
643
735
|
$ref: '#/components/schemas/FileAdministrative'
|
644
736
|
presentation:
|
@@ -652,6 +744,44 @@ components:
|
|
652
744
|
- access
|
653
745
|
- administrative
|
654
746
|
- hasMessageDigests
|
747
|
+
FileAccess:
|
748
|
+
description: Access metadata for files
|
749
|
+
type: object
|
750
|
+
additionalProperties: false
|
751
|
+
properties:
|
752
|
+
access:
|
753
|
+
description: Access level
|
754
|
+
type: string
|
755
|
+
enum:
|
756
|
+
- 'world'
|
757
|
+
- 'stanford'
|
758
|
+
- 'location-based'
|
759
|
+
- 'citation-only'
|
760
|
+
- 'dark'
|
761
|
+
default: 'dark'
|
762
|
+
controlledDigitalLending:
|
763
|
+
description: Available for controlled digital lending.
|
764
|
+
type: boolean
|
765
|
+
default: false
|
766
|
+
download:
|
767
|
+
description: Download access level for a file
|
768
|
+
type: string
|
769
|
+
enum:
|
770
|
+
- 'world'
|
771
|
+
- 'stanford'
|
772
|
+
- 'location-based'
|
773
|
+
- 'none'
|
774
|
+
default: 'none'
|
775
|
+
readLocation:
|
776
|
+
description: If access is "location-based", which location should have access.
|
777
|
+
type: string
|
778
|
+
enum:
|
779
|
+
- 'spec'
|
780
|
+
- 'music'
|
781
|
+
- 'ars'
|
782
|
+
- 'art'
|
783
|
+
- 'hoover'
|
784
|
+
- 'm&m'
|
655
785
|
FileAdministrative:
|
656
786
|
type: object
|
657
787
|
additionalProperties: false
|
@@ -714,19 +844,27 @@ components:
|
|
714
844
|
additionalProperties: false
|
715
845
|
properties:
|
716
846
|
sourceId:
|
717
|
-
|
718
|
-
description: >
|
719
|
-
Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
|
720
|
-
historically and currently, are representations of objects that are also represented in other systems.
|
721
|
-
For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
|
722
|
-
in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
|
723
|
-
and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
|
724
|
-
look for the original item if you're looking at its SDR representation.
|
725
|
-
example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
|
847
|
+
$ref: '#/components/schemas/SourceId'
|
726
848
|
catalogLinks:
|
727
849
|
type: array
|
728
850
|
items:
|
729
851
|
$ref: '#/components/schemas/CatalogLink'
|
852
|
+
Language:
|
853
|
+
description: Languages, scripts, symbolic systems, and notations used in all
|
854
|
+
or part of a resource.
|
855
|
+
type: object
|
856
|
+
additionalProperties: false
|
857
|
+
allOf:
|
858
|
+
- $ref: '#/components/schemas/DescriptiveValue'
|
859
|
+
- type: object
|
860
|
+
# additionalProperties breaks the validator, presumably because it can't
|
861
|
+
# conform to other schemas (allOf) and not have additionalProperties
|
862
|
+
# additionalProperties: false
|
863
|
+
properties:
|
864
|
+
script:
|
865
|
+
$ref: '#/components/schemas/DescriptiveValue'
|
866
|
+
# description: An alphabet or other notation used to represent a
|
867
|
+
# language or other symbolic system associated with the resource.
|
730
868
|
MessageDigest:
|
731
869
|
description: The output of the message digest algorithm.
|
732
870
|
type: object
|
@@ -755,6 +893,63 @@ components:
|
|
755
893
|
width:
|
756
894
|
description: Width in pixels
|
757
895
|
type: integer
|
896
|
+
RelatedResource:
|
897
|
+
description: Other resource associated with the described resource.
|
898
|
+
type: object
|
899
|
+
additionalProperties: false
|
900
|
+
properties:
|
901
|
+
type:
|
902
|
+
description: The relationship of the related resource to the described resource.
|
903
|
+
type: string
|
904
|
+
title:
|
905
|
+
description: Titles of the related resource.
|
906
|
+
type: array
|
907
|
+
items:
|
908
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
909
|
+
contributor:
|
910
|
+
description: Agents contributing in some way to the creation and history of the
|
911
|
+
related resource.
|
912
|
+
type: array
|
913
|
+
items:
|
914
|
+
$ref: "#/components/schemas/Contributor"
|
915
|
+
event:
|
916
|
+
description: Events in the history of the related resource.
|
917
|
+
type: array
|
918
|
+
items:
|
919
|
+
$ref: "#/components/schemas/Event"
|
920
|
+
form:
|
921
|
+
description: Characteristics of the related resource's physical, digital, and intellectual
|
922
|
+
form and genre.
|
923
|
+
type: array
|
924
|
+
items:
|
925
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
926
|
+
language:
|
927
|
+
description: Languages, scripts, symbolic systems, and notations used in all or
|
928
|
+
part of a related resource.
|
929
|
+
type: array
|
930
|
+
items:
|
931
|
+
$ref: "#/components/schemas/Language"
|
932
|
+
note:
|
933
|
+
description: Additional information relevant to a related resource.
|
934
|
+
type: array
|
935
|
+
items:
|
936
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
937
|
+
identifier:
|
938
|
+
description: Identifiers and URIs associated with the related resource.
|
939
|
+
type: array
|
940
|
+
items:
|
941
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
942
|
+
subject:
|
943
|
+
description: Terms associated with the intellectual content of the related resource.
|
944
|
+
type: array
|
945
|
+
items:
|
946
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
947
|
+
purl:
|
948
|
+
description: Stanford persistent URL associated with the related resource.
|
949
|
+
type: string
|
950
|
+
format: uri
|
951
|
+
access:
|
952
|
+
$ref: "#/components/schemas/DescriptiveAccessMetadata"
|
758
953
|
ReleaseTag:
|
759
954
|
description: A tag that indicates the item or collection should be released.
|
760
955
|
type: object
|
@@ -898,7 +1093,10 @@ components:
|
|
898
1093
|
items:
|
899
1094
|
$ref: '#/components/schemas/Sequence'
|
900
1095
|
isMemberOf:
|
901
|
-
|
1096
|
+
description: Collections that this DRO is a member of
|
1097
|
+
type: array
|
1098
|
+
items:
|
1099
|
+
$ref: '#/components/schemas/Druid'
|
902
1100
|
hasAgreement:
|
903
1101
|
type: string
|
904
1102
|
RequestFile:
|
@@ -928,7 +1126,7 @@ components:
|
|
928
1126
|
items:
|
929
1127
|
$ref: '#/components/schemas/MessageDigest'
|
930
1128
|
access:
|
931
|
-
$ref: '#/components/schemas/
|
1129
|
+
$ref: '#/components/schemas/FileAccess'
|
932
1130
|
administrative:
|
933
1131
|
$ref: '#/components/schemas/FileAdministrative'
|
934
1132
|
presentation:
|
@@ -975,15 +1173,7 @@ components:
|
|
975
1173
|
additionalProperties: false
|
976
1174
|
properties:
|
977
1175
|
sourceId:
|
978
|
-
|
979
|
-
description: >
|
980
|
-
Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
|
981
|
-
historically and currently, are representations of objects that are also represented in other systems.
|
982
|
-
For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
|
983
|
-
in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
|
984
|
-
and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
|
985
|
-
look for the original item if you're looking at its SDR representation.
|
986
|
-
example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
|
1176
|
+
$ref: '#/components/schemas/SourceId'
|
987
1177
|
catalogLinks:
|
988
1178
|
type: array
|
989
1179
|
items:
|
@@ -1007,8 +1197,8 @@ components:
|
|
1007
1197
|
- right-to-left
|
1008
1198
|
- left-to-right
|
1009
1199
|
Source:
|
1010
|
-
description: Property model for indicating the vocabulary, authority, or
|
1011
|
-
origin for a term, code, or identifier.
|
1200
|
+
description: Property model for indicating the vocabulary, authority, or
|
1201
|
+
other origin for a term, code, or identifier.
|
1012
1202
|
type: object
|
1013
1203
|
additionalProperties: false
|
1014
1204
|
properties:
|
@@ -1022,3 +1212,42 @@ components:
|
|
1022
1212
|
value:
|
1023
1213
|
description: String describing the value source.
|
1024
1214
|
type: string
|
1215
|
+
note:
|
1216
|
+
description: Other information related to the value source.
|
1217
|
+
type: array
|
1218
|
+
items:
|
1219
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
1220
|
+
Standard:
|
1221
|
+
description: Property model for indicating the encoding, standard, or syntax
|
1222
|
+
to which a value conforms.
|
1223
|
+
type: object
|
1224
|
+
additionalProperties: false
|
1225
|
+
properties:
|
1226
|
+
code:
|
1227
|
+
description: Code representing the standard or encoding.
|
1228
|
+
type: string
|
1229
|
+
uri:
|
1230
|
+
description: URI for the standard or encoding.
|
1231
|
+
type: string
|
1232
|
+
format: uri
|
1233
|
+
value:
|
1234
|
+
description: String describing the standard or encoding.
|
1235
|
+
type: string
|
1236
|
+
note:
|
1237
|
+
description: Other information related to the standard or encoding.
|
1238
|
+
type: array
|
1239
|
+
items:
|
1240
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
1241
|
+
source:
|
1242
|
+
$ref: "#/components/schemas/Source"
|
1243
|
+
SourceId:
|
1244
|
+
type: string
|
1245
|
+
pattern: '^.+:.+$'
|
1246
|
+
description: >
|
1247
|
+
Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
|
1248
|
+
historically and currently, are representations of objects that are also represented in other systems.
|
1249
|
+
For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
|
1250
|
+
in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
|
1251
|
+
and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
|
1252
|
+
look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
|
1253
|
+
example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
|
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.39.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -244,6 +244,7 @@ files:
|
|
244
244
|
- docs/sampleETD/xn109qc9773_taco.json
|
245
245
|
- exe/generator
|
246
246
|
- lib/cocina/generator.rb
|
247
|
+
- lib/cocina/generator/datatype.rb
|
247
248
|
- lib/cocina/generator/generator.rb
|
248
249
|
- lib/cocina/generator/schema.rb
|
249
250
|
- lib/cocina/generator/schema_array.rb
|
@@ -263,24 +264,30 @@ files:
|
|
263
264
|
- lib/cocina/models/collection_identification.rb
|
264
265
|
- lib/cocina/models/contributor.rb
|
265
266
|
- lib/cocina/models/description.rb
|
267
|
+
- lib/cocina/models/descriptive_access_metadata.rb
|
266
268
|
- lib/cocina/models/descriptive_admin_metadata.rb
|
267
269
|
- lib/cocina/models/descriptive_basic_value.rb
|
270
|
+
- lib/cocina/models/descriptive_parallel_value.rb
|
268
271
|
- lib/cocina/models/descriptive_structured_value.rb
|
269
272
|
- lib/cocina/models/descriptive_value.rb
|
270
273
|
- lib/cocina/models/descriptive_value_required.rb
|
271
274
|
- lib/cocina/models/dro.rb
|
272
275
|
- lib/cocina/models/dro_access.rb
|
273
276
|
- lib/cocina/models/dro_structural.rb
|
277
|
+
- lib/cocina/models/druid.rb
|
274
278
|
- lib/cocina/models/embargo.rb
|
275
279
|
- lib/cocina/models/event.rb
|
276
280
|
- lib/cocina/models/file.rb
|
281
|
+
- lib/cocina/models/file_access.rb
|
277
282
|
- lib/cocina/models/file_administrative.rb
|
278
283
|
- lib/cocina/models/file_set.rb
|
279
284
|
- lib/cocina/models/file_set_structural.rb
|
280
285
|
- lib/cocina/models/geographic.rb
|
281
286
|
- lib/cocina/models/identification.rb
|
287
|
+
- lib/cocina/models/language.rb
|
282
288
|
- lib/cocina/models/message_digest.rb
|
283
289
|
- lib/cocina/models/presentation.rb
|
290
|
+
- lib/cocina/models/related_resource.rb
|
284
291
|
- lib/cocina/models/release_tag.rb
|
285
292
|
- lib/cocina/models/request_admin_policy.rb
|
286
293
|
- lib/cocina/models/request_collection.rb
|
@@ -292,6 +299,8 @@ files:
|
|
292
299
|
- lib/cocina/models/request_identification.rb
|
293
300
|
- lib/cocina/models/sequence.rb
|
294
301
|
- lib/cocina/models/source.rb
|
302
|
+
- lib/cocina/models/source_id.rb
|
303
|
+
- lib/cocina/models/standard.rb
|
295
304
|
- lib/cocina/models/validator.rb
|
296
305
|
- lib/cocina/models/version.rb
|
297
306
|
- lib/cocina/models/vocab.rb
|
@@ -299,15 +308,15 @@ files:
|
|
299
308
|
homepage: https://github.com/sul-dlss/cocina-models
|
300
309
|
licenses: []
|
301
310
|
metadata: {}
|
302
|
-
post_install_message:
|
311
|
+
post_install_message:
|
303
312
|
rdoc_options: []
|
304
313
|
require_paths:
|
305
314
|
- lib
|
306
315
|
required_ruby_version: !ruby/object:Gem::Requirement
|
307
316
|
requirements:
|
308
|
-
- - "
|
317
|
+
- - "~>"
|
309
318
|
- !ruby/object:Gem::Version
|
310
|
-
version: '
|
319
|
+
version: '2.5'
|
311
320
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
312
321
|
requirements:
|
313
322
|
- - ">="
|
@@ -315,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
315
324
|
version: '0'
|
316
325
|
requirements: []
|
317
326
|
rubygems_version: 3.1.2
|
318
|
-
signing_key:
|
327
|
+
signing_key:
|
319
328
|
specification_version: 4
|
320
329
|
summary: Data models for the SDR
|
321
330
|
test_files: []
|