cocina-models 0.35.0 → 0.40.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/.rubocop_todo.yml +16 -9
- 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/generator/schema_base.rb +5 -1
- data/lib/cocina/models/descriptive_basic_value.rb +3 -2
- data/lib/cocina/models/descriptive_value.rb +3 -2
- data/lib/cocina/models/descriptive_value_required.rb +3 -2
- 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/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 +3 -2
- 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_id.rb +9 -0
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +74 -26
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9154e8ca9a9e0a023094e98709e443b58570a358deb4c8b329509642bfda0f7
|
4
|
+
data.tar.gz: 317c6faa7072fa4441c601e277a63b60149c183ba9b836ab95c0f2ee0f96f949
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 949161b1712417293974e89d98b62116d0cba3582d60fbfb728dfb6a51b78ca737ad02509a9f711cdc3aba27886caed1ca224711ec6ba80d3ba14822febfdf64
|
7
|
+
data.tar.gz: 5a3b10e3b9747b3e1317754eb40b0e3c9c581cf8397aaafdd8e5a5a338b07791f32b2f54d159e2399dd7934d1a49f709dd63af04388ad1d0e85386229d3be978
|
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/.rubocop_todo.yml
CHANGED
@@ -1,18 +1,25 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2020-
|
3
|
+
# on 2020-09-08 19:05:09 UTC using RuboCop version 0.89.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
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
10
|
-
|
11
|
-
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: AllowedMethods.
|
11
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
12
|
+
Lint/SafeNavigationChain:
|
13
|
+
Exclude:
|
14
|
+
- 'lib/cocina/generator/schema_base.rb'
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
# Configuration parameters: IgnoredMethods.
|
18
|
+
Metrics/CyclomaticComplexity:
|
19
|
+
Max: 8
|
12
20
|
|
13
|
-
# Offense count:
|
14
|
-
# Configuration parameters:
|
15
|
-
|
21
|
+
# Offense count: 1
|
22
|
+
# Configuration parameters: MinBodyLength.
|
23
|
+
Style/GuardClause:
|
16
24
|
Exclude:
|
17
|
-
- '
|
18
|
-
- 'spec/cocina/models/file_set_shared_examples.rb'
|
25
|
+
- 'lib/cocina/generator/schema_base.rb'
|
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)
|
@@ -54,7 +54,11 @@ module Cocina
|
|
54
54
|
when 'boolean'
|
55
55
|
'Strict::Bool'
|
56
56
|
else
|
57
|
-
|
57
|
+
if doc.one_of&.map(&:type).all? { |o| %w[integer string].include?(o) }
|
58
|
+
'Nominal::Any'
|
59
|
+
else
|
60
|
+
raise "#{schema_doc.type} not supported"
|
61
|
+
end
|
58
62
|
end
|
59
63
|
end
|
60
64
|
|
@@ -5,8 +5,8 @@ module Cocina
|
|
5
5
|
class DescriptiveBasicValue < Struct
|
6
6
|
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
|
-
# String value of the descriptive element.
|
9
|
-
attribute :value, Types::
|
8
|
+
# String or integer value of the descriptive element.
|
9
|
+
attribute :value, Types::Nominal::Any.meta(omittable: true)
|
10
10
|
# Type of value provided by the descriptive element.
|
11
11
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
12
12
|
# Status of the descriptive element value relative to other instances of the element.
|
@@ -23,6 +23,7 @@ module Cocina
|
|
23
23
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
24
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
25
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
26
|
+
attribute :language, Standard.optional.meta(omittable: true)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
@@ -5,8 +5,8 @@ module Cocina
|
|
5
5
|
class DescriptiveValue < Struct
|
6
6
|
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
|
-
# String value of the descriptive element.
|
9
|
-
attribute :value, Types::
|
8
|
+
# String or integer value of the descriptive element.
|
9
|
+
attribute :value, Types::Nominal::Any.meta(omittable: true)
|
10
10
|
# Type of value provided by the descriptive element.
|
11
11
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
12
12
|
# Status of the descriptive element value relative to other instances of the element.
|
@@ -23,6 +23,7 @@ module Cocina
|
|
23
23
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
24
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
25
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
26
|
+
attribute :language, Standard.optional.meta(omittable: true)
|
26
27
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
27
28
|
end
|
28
29
|
end
|
@@ -5,8 +5,8 @@ module Cocina
|
|
5
5
|
class DescriptiveValueRequired < Struct
|
6
6
|
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
|
-
# String value of the descriptive element.
|
9
|
-
attribute :value, Types::
|
8
|
+
# String or integer value of the descriptive element.
|
9
|
+
attribute :value, Types::Nominal::Any.meta(omittable: true)
|
10
10
|
# Type of value provided by the descriptive element.
|
11
11
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
12
12
|
# Status of the descriptive element value relative to other instances of the element.
|
@@ -23,6 +23,7 @@ module Cocina
|
|
23
23
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
24
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
25
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
26
|
+
attribute :language, Standard.optional.meta(omittable: true)
|
26
27
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
27
28
|
end
|
28
29
|
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/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)
|
@@ -5,8 +5,8 @@ module Cocina
|
|
5
5
|
class Language < Struct
|
6
6
|
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
|
-
# String value of the descriptive element.
|
9
|
-
attribute :value, Types::
|
8
|
+
# String or integer value of the descriptive element.
|
9
|
+
attribute :value, Types::Nominal::Any.meta(omittable: true)
|
10
10
|
# Type of value provided by the descriptive element.
|
11
11
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
12
12
|
# Status of the descriptive element value relative to other instances of the element.
|
@@ -23,6 +23,7 @@ module Cocina
|
|
23
23
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
24
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
25
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
26
|
+
attribute :language, Standard.optional.meta(omittable: true)
|
26
27
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
27
28
|
attribute :script, DescriptiveValue.optional.meta(omittable: true)
|
28
29
|
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/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:
|
@@ -430,8 +430,10 @@ components:
|
|
430
430
|
additionalProperties: false
|
431
431
|
properties:
|
432
432
|
value:
|
433
|
-
description: String value of the descriptive element.
|
434
|
-
|
433
|
+
description: String or integer value of the descriptive element.
|
434
|
+
oneOf:
|
435
|
+
- type: string
|
436
|
+
- type: integer
|
435
437
|
type:
|
436
438
|
description: Type of value provided by the descriptive element.
|
437
439
|
type: string
|
@@ -465,6 +467,9 @@ components:
|
|
465
467
|
type: array
|
466
468
|
items:
|
467
469
|
$ref: "#/components/schemas/DescriptiveValue"
|
470
|
+
language:
|
471
|
+
# description: Language of the descriptive element value.
|
472
|
+
$ref: "#/components/schemas/Standard"
|
468
473
|
DescriptiveParallelValue:
|
469
474
|
description: Value model for multiple representations of the same information (e.g. in different languages).
|
470
475
|
type: object
|
@@ -567,6 +572,10 @@ components:
|
|
567
572
|
- 'citation-only'
|
568
573
|
- 'dark'
|
569
574
|
default: 'dark'
|
575
|
+
controlledDigitalLending:
|
576
|
+
description: Available for controlled digital lending.
|
577
|
+
type: boolean
|
578
|
+
default: false
|
570
579
|
copyright:
|
571
580
|
description: The human readable copyright statement that applies
|
572
581
|
example: Copyright World Trade Organization
|
@@ -620,7 +629,10 @@ components:
|
|
620
629
|
items:
|
621
630
|
$ref: '#/components/schemas/Sequence'
|
622
631
|
isMemberOf:
|
623
|
-
|
632
|
+
description: Collections that this DRO is a member of
|
633
|
+
type: array
|
634
|
+
items:
|
635
|
+
$ref: '#/components/schemas/Druid'
|
624
636
|
hasAgreement:
|
625
637
|
description: Agreement that covers the deposit of the DRO into SDR.
|
626
638
|
type: string
|
@@ -721,7 +733,7 @@ components:
|
|
721
733
|
items:
|
722
734
|
$ref: '#/components/schemas/MessageDigest'
|
723
735
|
access:
|
724
|
-
$ref: '#/components/schemas/
|
736
|
+
$ref: '#/components/schemas/FileAccess'
|
725
737
|
administrative:
|
726
738
|
$ref: '#/components/schemas/FileAdministrative'
|
727
739
|
presentation:
|
@@ -735,6 +747,44 @@ components:
|
|
735
747
|
- access
|
736
748
|
- administrative
|
737
749
|
- hasMessageDigests
|
750
|
+
FileAccess:
|
751
|
+
description: Access metadata for files
|
752
|
+
type: object
|
753
|
+
additionalProperties: false
|
754
|
+
properties:
|
755
|
+
access:
|
756
|
+
description: Access level
|
757
|
+
type: string
|
758
|
+
enum:
|
759
|
+
- 'world'
|
760
|
+
- 'stanford'
|
761
|
+
- 'location-based'
|
762
|
+
- 'citation-only'
|
763
|
+
- 'dark'
|
764
|
+
default: 'dark'
|
765
|
+
controlledDigitalLending:
|
766
|
+
description: Available for controlled digital lending.
|
767
|
+
type: boolean
|
768
|
+
default: false
|
769
|
+
download:
|
770
|
+
description: Download access level for a file
|
771
|
+
type: string
|
772
|
+
enum:
|
773
|
+
- 'world'
|
774
|
+
- 'stanford'
|
775
|
+
- 'location-based'
|
776
|
+
- 'none'
|
777
|
+
default: 'none'
|
778
|
+
readLocation:
|
779
|
+
description: If access is "location-based", which location should have access.
|
780
|
+
type: string
|
781
|
+
enum:
|
782
|
+
- 'spec'
|
783
|
+
- 'music'
|
784
|
+
- 'ars'
|
785
|
+
- 'art'
|
786
|
+
- 'hoover'
|
787
|
+
- 'm&m'
|
738
788
|
FileAdministrative:
|
739
789
|
type: object
|
740
790
|
additionalProperties: false
|
@@ -797,22 +847,14 @@ components:
|
|
797
847
|
additionalProperties: false
|
798
848
|
properties:
|
799
849
|
sourceId:
|
800
|
-
|
801
|
-
description: >
|
802
|
-
Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
|
803
|
-
historically and currently, are representations of objects that are also represented in other systems.
|
804
|
-
For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
|
805
|
-
in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
|
806
|
-
and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
|
807
|
-
look for the original item if you're looking at its SDR representation.
|
808
|
-
example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
|
850
|
+
$ref: '#/components/schemas/SourceId'
|
809
851
|
catalogLinks:
|
810
852
|
type: array
|
811
853
|
items:
|
812
854
|
$ref: '#/components/schemas/CatalogLink'
|
813
855
|
Language:
|
814
856
|
description: Languages, scripts, symbolic systems, and notations used in all
|
815
|
-
or part of a resource.
|
857
|
+
or part of a resource or its descriptive metadata.
|
816
858
|
type: object
|
817
859
|
additionalProperties: false
|
818
860
|
allOf:
|
@@ -1054,7 +1096,10 @@ components:
|
|
1054
1096
|
items:
|
1055
1097
|
$ref: '#/components/schemas/Sequence'
|
1056
1098
|
isMemberOf:
|
1057
|
-
|
1099
|
+
description: Collections that this DRO is a member of
|
1100
|
+
type: array
|
1101
|
+
items:
|
1102
|
+
$ref: '#/components/schemas/Druid'
|
1058
1103
|
hasAgreement:
|
1059
1104
|
type: string
|
1060
1105
|
RequestFile:
|
@@ -1084,7 +1129,7 @@ components:
|
|
1084
1129
|
items:
|
1085
1130
|
$ref: '#/components/schemas/MessageDigest'
|
1086
1131
|
access:
|
1087
|
-
$ref: '#/components/schemas/
|
1132
|
+
$ref: '#/components/schemas/FileAccess'
|
1088
1133
|
administrative:
|
1089
1134
|
$ref: '#/components/schemas/FileAdministrative'
|
1090
1135
|
presentation:
|
@@ -1131,15 +1176,7 @@ components:
|
|
1131
1176
|
additionalProperties: false
|
1132
1177
|
properties:
|
1133
1178
|
sourceId:
|
1134
|
-
|
1135
|
-
description: >
|
1136
|
-
Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
|
1137
|
-
historically and currently, are representations of objects that are also represented in other systems.
|
1138
|
-
For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
|
1139
|
-
in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
|
1140
|
-
and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
|
1141
|
-
look for the original item if you're looking at its SDR representation.
|
1142
|
-
example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
|
1179
|
+
$ref: '#/components/schemas/SourceId'
|
1143
1180
|
catalogLinks:
|
1144
1181
|
type: array
|
1145
1182
|
items:
|
@@ -1206,3 +1243,14 @@ components:
|
|
1206
1243
|
$ref: "#/components/schemas/DescriptiveValue"
|
1207
1244
|
source:
|
1208
1245
|
$ref: "#/components/schemas/Source"
|
1246
|
+
SourceId:
|
1247
|
+
type: string
|
1248
|
+
pattern: '^.+:.+$'
|
1249
|
+
description: >
|
1250
|
+
Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
|
1251
|
+
historically and currently, are representations of objects that are also represented in other systems.
|
1252
|
+
For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
|
1253
|
+
in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
|
1254
|
+
and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
|
1255
|
+
look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
|
1256
|
+
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.40.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-09 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
|
@@ -273,9 +274,11 @@ files:
|
|
273
274
|
- lib/cocina/models/dro.rb
|
274
275
|
- lib/cocina/models/dro_access.rb
|
275
276
|
- lib/cocina/models/dro_structural.rb
|
277
|
+
- lib/cocina/models/druid.rb
|
276
278
|
- lib/cocina/models/embargo.rb
|
277
279
|
- lib/cocina/models/event.rb
|
278
280
|
- lib/cocina/models/file.rb
|
281
|
+
- lib/cocina/models/file_access.rb
|
279
282
|
- lib/cocina/models/file_administrative.rb
|
280
283
|
- lib/cocina/models/file_set.rb
|
281
284
|
- lib/cocina/models/file_set_structural.rb
|
@@ -296,6 +299,7 @@ files:
|
|
296
299
|
- lib/cocina/models/request_identification.rb
|
297
300
|
- lib/cocina/models/sequence.rb
|
298
301
|
- lib/cocina/models/source.rb
|
302
|
+
- lib/cocina/models/source_id.rb
|
299
303
|
- lib/cocina/models/standard.rb
|
300
304
|
- lib/cocina/models/validator.rb
|
301
305
|
- lib/cocina/models/version.rb
|
@@ -304,15 +308,15 @@ files:
|
|
304
308
|
homepage: https://github.com/sul-dlss/cocina-models
|
305
309
|
licenses: []
|
306
310
|
metadata: {}
|
307
|
-
post_install_message:
|
311
|
+
post_install_message:
|
308
312
|
rdoc_options: []
|
309
313
|
require_paths:
|
310
314
|
- lib
|
311
315
|
required_ruby_version: !ruby/object:Gem::Requirement
|
312
316
|
requirements:
|
313
|
-
- - "
|
317
|
+
- - "~>"
|
314
318
|
- !ruby/object:Gem::Version
|
315
|
-
version: '
|
319
|
+
version: '2.5'
|
316
320
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
317
321
|
requirements:
|
318
322
|
- - ">="
|
@@ -320,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
320
324
|
version: '0'
|
321
325
|
requirements: []
|
322
326
|
rubygems_version: 3.1.2
|
323
|
-
signing_key:
|
327
|
+
signing_key:
|
324
328
|
specification_version: 4
|
325
329
|
summary: Data models for the SDR
|
326
330
|
test_files: []
|