cocina-models 0.39.0 → 0.42.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +31 -0
- data/.rubocop_todo.yml +16 -9
- data/README.md +13 -0
- data/lib/cocina/generator/generator.rb +2 -2
- data/lib/cocina/generator/schema_base.rb +5 -1
- data/lib/cocina/models/access.rb +0 -2
- data/lib/cocina/models/description.rb +2 -1
- data/lib/cocina/models/descriptive_basic_value.rb +4 -2
- data/lib/cocina/models/descriptive_geographic_metadata.rb +10 -0
- data/lib/cocina/models/descriptive_value.rb +4 -2
- data/lib/cocina/models/descriptive_value_language.rb +19 -0
- data/lib/cocina/models/event.rb +3 -0
- data/lib/cocina/models/language.rb +15 -16
- data/lib/cocina/models/related_resource.rb +7 -0
- data/lib/cocina/models/source.rb +2 -0
- data/lib/cocina/models/standard.rb +2 -0
- data/lib/cocina/models/{descriptive_value_required.rb → title.rb} +5 -3
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +148 -38
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 358d3bd8de0ea4eb5a53c7d841d874cf30c54234d5289fb7902139e8b2148333
|
4
|
+
data.tar.gz: a39777306a95b77ef53c8204e5771a41fffad213ea1256162bdeafd12ea581ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a4fb933796d5e5c9586dbe35e7b29c3a9b3f692925d762b1c9da8be950796fb7107d9675df48c0a5d82dfc0a8f57ba9cb5366e9fbcdcb85177830ab5c653b03
|
7
|
+
data.tar.gz: b15a6ce89a1dd86bf799388eda65a45b5e8a202a8f778d7cdf353aa2b721485794448f755111551d85ebf42fb1cfb011ef91505e64235a1e54490b152941495c
|
data/.rubocop.yml
CHANGED
@@ -143,3 +143,34 @@ Style/SingleArgumentDig:
|
|
143
143
|
|
144
144
|
Style/StringConcatenation:
|
145
145
|
Enabled: true
|
146
|
+
|
147
|
+
Layout/BeginEndAlignment: # (new in 0.91)
|
148
|
+
Enabled: true
|
149
|
+
Lint/ConstantDefinitionInBlock: # (new in 0.91)
|
150
|
+
Enabled: true
|
151
|
+
Lint/DuplicateRequire: # (new in 0.90)
|
152
|
+
Enabled: true
|
153
|
+
Lint/EmptyFile: # (new in 0.90)
|
154
|
+
Enabled: true
|
155
|
+
Lint/HashCompareByIdentity: # (new in 0.93)
|
156
|
+
Enabled: true
|
157
|
+
Lint/IdentityComparison: # (new in 0.91)
|
158
|
+
Enabled: true
|
159
|
+
Lint/RedundantSafeNavigation: # (new in 0.93)
|
160
|
+
Enabled: true
|
161
|
+
Lint/TrailingCommaInAttributeDeclaration: # (new in 0.90)
|
162
|
+
Enabled: true
|
163
|
+
Lint/UselessMethodDefinition: # (new in 0.90)
|
164
|
+
Enabled: true
|
165
|
+
Lint/UselessTimes: # (new in 0.91)
|
166
|
+
Enabled: true
|
167
|
+
Style/ClassEqualityComparison: # (new in 0.93)
|
168
|
+
Enabled: true
|
169
|
+
Style/CombinableLoops: # (new in 0.90)
|
170
|
+
Enabled: true
|
171
|
+
Style/KeywordParametersOrder: # (new in 0.90)
|
172
|
+
Enabled: true
|
173
|
+
Style/RedundantSelfAssignment: # (new in 0.90)
|
174
|
+
Enabled: true
|
175
|
+
Style/SoleNestedConditional: # (new in 0.89)
|
176
|
+
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
@@ -42,6 +42,19 @@ which pushes the gem to rubygems.org. Next write up the release notes: https://
|
|
42
42
|
|
43
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
44
|
|
45
|
+
### Dependent Services
|
46
|
+
|
47
|
+
Once the above listed gems are updated all the following services that use cocina-models should be updated and released at the same time:
|
48
|
+
|
49
|
+
* sul-dlss/sdr-api
|
50
|
+
* sul-dlss/dor-services-app
|
51
|
+
* sul-dlss/google-books
|
52
|
+
* sul-dlss/common-accessioning
|
53
|
+
* sul-dlss/argo
|
54
|
+
* sul-dlss/pre-assembly
|
55
|
+
* sul-dlss/hydrus
|
56
|
+
* sul-dlss/happy-heron
|
57
|
+
* sul-dlss/infrastructure-integration-test
|
45
58
|
|
46
59
|
## Using this gem
|
47
60
|
|
@@ -45,7 +45,7 @@ module Cocina
|
|
45
45
|
FileUtils.rm_f(filepath)
|
46
46
|
|
47
47
|
create_file filepath, vocab.generate
|
48
|
-
run("rubocop -a #{filepath}")
|
48
|
+
run("rubocop -a #{filepath} > /dev/null")
|
49
49
|
end
|
50
50
|
|
51
51
|
private
|
@@ -71,7 +71,7 @@ module Cocina
|
|
71
71
|
FileUtils.rm_f(filepath)
|
72
72
|
|
73
73
|
create_file filepath, schema.generate
|
74
|
-
run("rubocop -a #{filepath}")
|
74
|
+
run("rubocop -a #{filepath} > /dev/null")
|
75
75
|
end
|
76
76
|
|
77
77
|
def clean_output
|
@@ -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
|
|
data/lib/cocina/models/access.rb
CHANGED
@@ -5,8 +5,6 @@ module Cocina
|
|
5
5
|
class Access < Struct
|
6
6
|
# Access level
|
7
7
|
attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
|
8
|
-
# Download access level for a file
|
9
|
-
attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
|
10
8
|
# If access is "location-based", which location should have access.
|
11
9
|
attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
|
12
10
|
end
|
@@ -3,10 +3,11 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Description < Struct
|
6
|
-
attribute :title, Types::Strict::Array.of(
|
6
|
+
attribute :title, Types::Strict::Array.of(Title).default([].freeze)
|
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 :geographic, Types::Strict::Array.of(DescriptiveGeographicMetadata).meta(omittable: true)
|
10
11
|
attribute :language, Types::Strict::Array.of(Language).meta(omittable: true)
|
11
12
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
13
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
@@ -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.
|
@@ -17,12 +17,14 @@ module Cocina
|
|
17
17
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
18
18
|
attribute :standard, Standard.optional.meta(omittable: true)
|
19
19
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
20
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
20
21
|
attribute :source, Source.optional.meta(omittable: true)
|
21
22
|
# The preferred display label to use for the descriptive element in access systems.
|
22
23
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
23
24
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
25
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
26
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
27
|
+
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class DescriptiveGeographicMetadata < Struct
|
6
|
+
attribute :form, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
|
+
attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
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.
|
@@ -17,12 +17,14 @@ module Cocina
|
|
17
17
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
18
18
|
attribute :standard, Standard.optional.meta(omittable: true)
|
19
19
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
20
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
20
21
|
attribute :source, Source.optional.meta(omittable: true)
|
21
22
|
# The preferred display label to use for the descriptive element in access systems.
|
22
23
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
23
24
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
25
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
26
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
27
|
+
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
26
28
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
27
29
|
end
|
28
30
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class DescriptiveValueLanguage < 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
|
+
# The version of the standard or encoding.
|
14
|
+
attribute :version, Types::Strict::String.meta(omittable: true)
|
15
|
+
attribute :source, Source.optional.meta(omittable: true)
|
16
|
+
attribute :valueScript, Standard.optional.meta(omittable: true)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/cocina/models/event.rb
CHANGED
@@ -6,9 +6,12 @@ module Cocina
|
|
6
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
|
+
# The preferred display label to use for the event in access systems.
|
10
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
9
11
|
attribute :date, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
10
12
|
attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
|
11
13
|
attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
15
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
16
|
end
|
14
17
|
end
|
@@ -3,28 +3,27 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Language < Struct
|
6
|
-
attribute :
|
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)
|
6
|
+
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
14
7
|
# Code value of the descriptive element.
|
15
8
|
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
9
|
# The preferred display label to use for the descriptive element in access systems.
|
22
10
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
23
|
-
|
24
|
-
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
11
|
+
attribute :encoding, Standard.optional.meta(omittable: true)
|
25
12
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
26
|
-
attribute :
|
13
|
+
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
|
+
# present for mapping to additional schemas in the future and for consistency but not otherwise used
|
15
|
+
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
27
16
|
attribute :script, DescriptiveValue.optional.meta(omittable: true)
|
17
|
+
attribute :source, Source.optional.meta(omittable: true)
|
18
|
+
# Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
|
19
|
+
attribute :status, Types::Strict::String.enum('primary').meta(omittable: true)
|
20
|
+
attribute :standard, Standard.optional.meta(omittable: true)
|
21
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
22
|
+
# URI value of the descriptive element.
|
23
|
+
attribute :uri, Types::Strict::String.meta(omittable: true)
|
24
|
+
# Value of the descriptive element.
|
25
|
+
attribute :value, Types::Strict::String.meta(omittable: true)
|
26
|
+
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
28
27
|
end
|
29
28
|
end
|
30
29
|
end
|
@@ -5,6 +5,10 @@ module Cocina
|
|
5
5
|
class RelatedResource < Struct
|
6
6
|
# The relationship of the related resource to the described resource.
|
7
7
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
8
|
+
# Status of the related resource relative to other related resources.
|
9
|
+
attribute :status, Types::Strict::String.meta(omittable: true)
|
10
|
+
# The preferred display label to use for the related resource in access systems.
|
11
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
8
12
|
attribute :title, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
9
13
|
attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
|
10
14
|
attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
|
@@ -12,10 +16,13 @@ module Cocina
|
|
12
16
|
attribute :language, Types::Strict::Array.of(Language).meta(omittable: true)
|
13
17
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
18
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
19
|
+
attribute :standard, Standard.optional.meta(omittable: true)
|
15
20
|
attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
16
21
|
# Stanford persistent URL associated with the related resource.
|
17
22
|
attribute :purl, Types::Strict::String.meta(omittable: true)
|
18
23
|
attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
|
24
|
+
# The version of the related resource.
|
25
|
+
attribute :version, Types::Strict::String.meta(omittable: true)
|
19
26
|
end
|
20
27
|
end
|
21
28
|
end
|
data/lib/cocina/models/source.rb
CHANGED
@@ -10,6 +10,8 @@ module Cocina
|
|
10
10
|
# String describing the value source.
|
11
11
|
attribute :value, Types::Strict::String.meta(omittable: true)
|
12
12
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
|
+
# The version of the value source.
|
14
|
+
attribute :version, Types::Strict::String.meta(omittable: true)
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -10,6 +10,8 @@ module Cocina
|
|
10
10
|
# String describing the standard or encoding.
|
11
11
|
attribute :value, Types::Strict::String.meta(omittable: true)
|
12
12
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
|
+
# The version of the standard or encoding.
|
14
|
+
attribute :version, Types::Strict::String.meta(omittable: true)
|
13
15
|
attribute :source, Source.optional.meta(omittable: true)
|
14
16
|
end
|
15
17
|
end
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
|
-
class
|
5
|
+
class Title < 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.
|
@@ -17,12 +17,14 @@ module Cocina
|
|
17
17
|
attribute :uri, Types::Strict::String.meta(omittable: true)
|
18
18
|
attribute :standard, Standard.optional.meta(omittable: true)
|
19
19
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
20
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
20
21
|
attribute :source, Source.optional.meta(omittable: true)
|
21
22
|
# The preferred display label to use for the descriptive element in access systems.
|
22
23
|
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
23
24
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
24
25
|
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
25
26
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
27
|
+
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
26
28
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
27
29
|
end
|
28
30
|
end
|
data/openapi.yml
CHANGED
@@ -108,15 +108,6 @@ components:
|
|
108
108
|
- 'citation-only'
|
109
109
|
- 'dark'
|
110
110
|
default: 'dark'
|
111
|
-
download:
|
112
|
-
description: Download access level for a file
|
113
|
-
type: string
|
114
|
-
enum:
|
115
|
-
- 'world'
|
116
|
-
- 'stanford'
|
117
|
-
- 'location-based'
|
118
|
-
- 'none'
|
119
|
-
default: 'none'
|
120
111
|
readLocation:
|
121
112
|
description: If access is "location-based", which location should have access.
|
122
113
|
type: string
|
@@ -270,6 +261,7 @@ components:
|
|
270
261
|
description: Status of the contributor relative to other parallel contributors
|
271
262
|
(e.g. the primary author among a group of contributors).
|
272
263
|
type: string
|
264
|
+
# type: integer (uncomment when issue #154 resolved)
|
273
265
|
role:
|
274
266
|
description: Relationships of the contributor to the resource or to an event
|
275
267
|
in its history.
|
@@ -295,7 +287,7 @@ components:
|
|
295
287
|
type: array
|
296
288
|
minItems: 1
|
297
289
|
items:
|
298
|
-
$ref: "#/components/schemas/
|
290
|
+
$ref: "#/components/schemas/Title"
|
299
291
|
contributor:
|
300
292
|
description: Agents contributing in some way to the creation and history of the
|
301
293
|
resource.
|
@@ -309,10 +301,15 @@ components:
|
|
309
301
|
$ref: "#/components/schemas/Event"
|
310
302
|
form:
|
311
303
|
description: Characteristics of the resource's physical, digital, and intellectual
|
312
|
-
form and genre.
|
304
|
+
form and genre, and of its process of creation.
|
313
305
|
type: array
|
314
306
|
items:
|
315
307
|
$ref: "#/components/schemas/DescriptiveValue"
|
308
|
+
geographic:
|
309
|
+
description: Geographic description for items with coordinates or bounding boxes.
|
310
|
+
type: array
|
311
|
+
items:
|
312
|
+
$ref: "#/components/schemas/DescriptiveGeographicMetadata"
|
316
313
|
language:
|
317
314
|
description: Languages, scripts, symbolic systems, and notations used in all or
|
318
315
|
part of a resource.
|
@@ -433,7 +430,10 @@ components:
|
|
433
430
|
description: String or integer value of the descriptive element.
|
434
431
|
oneOf:
|
435
432
|
- type: string
|
436
|
-
|
433
|
+
# Title note (nonsorting character count) was supposed to be able to accept an integer value,
|
434
|
+
# but this triggered a bug in committee:
|
435
|
+
# https://github.com/interagent/committee/issues/286
|
436
|
+
# - type: integer
|
437
437
|
type:
|
438
438
|
description: Type of value provided by the descriptive element.
|
439
439
|
type: string
|
@@ -441,6 +441,7 @@ components:
|
|
441
441
|
description: Status of the descriptive element value relative to other instances
|
442
442
|
of the element.
|
443
443
|
type: string
|
444
|
+
# type: integer (uncomment when issue #154 is resolved)
|
444
445
|
code:
|
445
446
|
description: Code value of the descriptive element.
|
446
447
|
type: string
|
@@ -454,6 +455,11 @@ components:
|
|
454
455
|
encoding:
|
455
456
|
# description: Encoding schema, standard, or syntax to which the value conforms.
|
456
457
|
$ref: "#/components/schemas/Standard"
|
458
|
+
identifier:
|
459
|
+
description: Identifiers and URIs associated with the descriptive element.
|
460
|
+
type: array
|
461
|
+
items:
|
462
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
457
463
|
source:
|
458
464
|
$ref: "#/components/schemas/Source"
|
459
465
|
displayLabel:
|
@@ -467,6 +473,22 @@ components:
|
|
467
473
|
type: array
|
468
474
|
items:
|
469
475
|
$ref: "#/components/schemas/DescriptiveValue"
|
476
|
+
valueLanguage:
|
477
|
+
$ref: "#/components/schemas/DescriptiveValueLanguage"
|
478
|
+
DescriptiveGeographicMetadata:
|
479
|
+
description: Value model for mods geographic extension metadata
|
480
|
+
type: object
|
481
|
+
additionalProperties: false
|
482
|
+
properties:
|
483
|
+
form:
|
484
|
+
type: array
|
485
|
+
items:
|
486
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
487
|
+
subject:
|
488
|
+
description: Terms associated with the intellectual content of the related resource.
|
489
|
+
type: array
|
490
|
+
items:
|
491
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
470
492
|
DescriptiveParallelValue:
|
471
493
|
description: Value model for multiple representations of the same information (e.g. in different languages).
|
472
494
|
type: object
|
@@ -492,7 +514,19 @@ components:
|
|
492
514
|
allOf:
|
493
515
|
- $ref: "#/components/schemas/DescriptiveBasicValue"
|
494
516
|
- $ref: "#/components/schemas/AppliesTo"
|
495
|
-
|
517
|
+
DescriptiveValueLanguage:
|
518
|
+
description: Language of the descriptive element value
|
519
|
+
type: object
|
520
|
+
additionalProperties: false
|
521
|
+
allOf:
|
522
|
+
- $ref: "#/components/schemas/Standard"
|
523
|
+
- type: object
|
524
|
+
properties:
|
525
|
+
valueScript:
|
526
|
+
$ref: '#/components/schemas/Standard'
|
527
|
+
# description: An alphabet or other notation used to represent a
|
528
|
+
# language or other symbolic system of the descriptive element value.
|
529
|
+
Title:
|
496
530
|
type: object
|
497
531
|
additionalProperties: false
|
498
532
|
allOf:
|
@@ -504,6 +538,9 @@ components:
|
|
504
538
|
- type: object
|
505
539
|
required:
|
506
540
|
- structuredValue
|
541
|
+
- type: object
|
542
|
+
required:
|
543
|
+
- parallelValue
|
507
544
|
DRO:
|
508
545
|
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.
|
509
546
|
type: object
|
@@ -674,6 +711,9 @@ components:
|
|
674
711
|
type:
|
675
712
|
description: Description of the event (creation, publication, etc.).
|
676
713
|
type: string
|
714
|
+
displayLabel:
|
715
|
+
description: The preferred display label to use for the event in access systems.
|
716
|
+
type: string
|
677
717
|
date:
|
678
718
|
description: Dates associated with the event.
|
679
719
|
type: array
|
@@ -689,6 +729,11 @@ components:
|
|
689
729
|
type: array
|
690
730
|
items:
|
691
731
|
$ref: "#/components/schemas/DescriptiveValue"
|
732
|
+
identifier:
|
733
|
+
description: Identifiers and URIs associated with the event.
|
734
|
+
type: array
|
735
|
+
items:
|
736
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
692
737
|
note:
|
693
738
|
description: Other information about the event.
|
694
739
|
type: array
|
@@ -851,20 +896,66 @@ components:
|
|
851
896
|
$ref: '#/components/schemas/CatalogLink'
|
852
897
|
Language:
|
853
898
|
description: Languages, scripts, symbolic systems, and notations used in all
|
854
|
-
or part of a resource.
|
899
|
+
or part of a resource or its descriptive metadata.
|
855
900
|
type: object
|
856
901
|
additionalProperties: false
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
902
|
+
properties:
|
903
|
+
appliesTo:
|
904
|
+
type: array
|
905
|
+
items:
|
906
|
+
$ref: "#/components/schemas/DescriptiveBasicValue"
|
907
|
+
code:
|
908
|
+
description: Code value of the descriptive element.
|
909
|
+
type: string
|
910
|
+
displayLabel:
|
911
|
+
description: The preferred display label to use for the descriptive element in access systems.
|
912
|
+
type: string
|
913
|
+
encoding:
|
914
|
+
# description: present for mapping to additional schemas in the future and for consistency but not otherwise used
|
915
|
+
$ref: "#/components/schemas/Standard"
|
916
|
+
note:
|
917
|
+
description: present for mapping to additional schemas in the future and for consistency but not otherwise used
|
918
|
+
type: array
|
919
|
+
items:
|
920
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
921
|
+
parallelValue:
|
922
|
+
description: present for mapping to additional schemas in the future and for consistency but not otherwise used
|
923
|
+
type: array
|
924
|
+
items:
|
925
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
926
|
+
qualifier:
|
927
|
+
type: string
|
928
|
+
description: present for mapping to additional schemas in the future and for consistency but not otherwise used
|
929
|
+
script:
|
930
|
+
$ref: '#/components/schemas/DescriptiveValue'
|
931
|
+
# description: An alphabet or other notation used to represent a
|
932
|
+
# language or other symbolic system associated with the resource.
|
933
|
+
source:
|
934
|
+
$ref: "#/components/schemas/Source"
|
935
|
+
status:
|
936
|
+
description: Status of the language relative to other parallel language elements (e.g. the primary language)
|
937
|
+
(e.g. the primary author among a group of contributors).
|
938
|
+
type: string
|
939
|
+
enum:
|
940
|
+
- primary
|
941
|
+
standard:
|
942
|
+
# description: present for mapping to additional schemas in the future and for consistency but not otherwise used
|
943
|
+
$ref: "#/components/schemas/Standard"
|
944
|
+
structuredValue:
|
945
|
+
description: present for mapping to additional schemas in the future and for consistency but not otherwise used
|
946
|
+
type: array
|
947
|
+
items:
|
948
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
949
|
+
uri:
|
950
|
+
description: URI value of the descriptive element.
|
951
|
+
type: string
|
952
|
+
format: uri
|
953
|
+
value:
|
954
|
+
description: Value of the descriptive element.
|
955
|
+
type: string
|
956
|
+
valueLanguage:
|
957
|
+
# description: present for mapping to additional schemas in the future and for consistency but not otherwise used
|
958
|
+
$ref: "#/components/schemas/DescriptiveValueLanguage"
|
868
959
|
MessageDigest:
|
869
960
|
description: The output of the message digest algorithm.
|
870
961
|
type: object
|
@@ -901,6 +992,13 @@ components:
|
|
901
992
|
type:
|
902
993
|
description: The relationship of the related resource to the described resource.
|
903
994
|
type: string
|
995
|
+
status:
|
996
|
+
description: Status of the related resource relative to other related resources.
|
997
|
+
type: string
|
998
|
+
# type: integer (uncomment when issue #154 resolved)
|
999
|
+
displayLabel:
|
1000
|
+
description: The preferred display label to use for the related resource in access systems.
|
1001
|
+
type: string
|
904
1002
|
title:
|
905
1003
|
description: Titles of the related resource.
|
906
1004
|
type: array
|
@@ -919,7 +1017,7 @@ components:
|
|
919
1017
|
$ref: "#/components/schemas/Event"
|
920
1018
|
form:
|
921
1019
|
description: Characteristics of the related resource's physical, digital, and intellectual
|
922
|
-
form and genre.
|
1020
|
+
form and genre, and of its process of creation.
|
923
1021
|
type: array
|
924
1022
|
items:
|
925
1023
|
$ref: "#/components/schemas/DescriptiveValue"
|
@@ -939,6 +1037,9 @@ components:
|
|
939
1037
|
type: array
|
940
1038
|
items:
|
941
1039
|
$ref: "#/components/schemas/DescriptiveValue"
|
1040
|
+
standard:
|
1041
|
+
# description: Descriptive or content standards to which the value conforms.
|
1042
|
+
$ref: "#/components/schemas/Standard"
|
942
1043
|
subject:
|
943
1044
|
description: Terms associated with the intellectual content of the related resource.
|
944
1045
|
type: array
|
@@ -950,6 +1051,9 @@ components:
|
|
950
1051
|
format: uri
|
951
1052
|
access:
|
952
1053
|
$ref: "#/components/schemas/DescriptiveAccessMetadata"
|
1054
|
+
version:
|
1055
|
+
description: The version of the related resource.
|
1056
|
+
type: string
|
953
1057
|
ReleaseTag:
|
954
1058
|
description: A tag that indicates the item or collection should be released.
|
955
1059
|
type: object
|
@@ -1217,9 +1321,23 @@ components:
|
|
1217
1321
|
type: array
|
1218
1322
|
items:
|
1219
1323
|
$ref: "#/components/schemas/DescriptiveValue"
|
1324
|
+
version:
|
1325
|
+
description: The version of the value source.
|
1326
|
+
type: string
|
1327
|
+
SourceId:
|
1328
|
+
type: string
|
1329
|
+
pattern: '^.+:.+$'
|
1330
|
+
description: >
|
1331
|
+
Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
|
1332
|
+
historically and currently, are representations of objects that are also represented in other systems.
|
1333
|
+
For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
|
1334
|
+
in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
|
1335
|
+
and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
|
1336
|
+
look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
|
1337
|
+
example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
|
1220
1338
|
Standard:
|
1221
1339
|
description: Property model for indicating the encoding, standard, or syntax
|
1222
|
-
to which a value conforms.
|
1340
|
+
to which a value conforms (e.g. RDA).
|
1223
1341
|
type: object
|
1224
1342
|
additionalProperties: false
|
1225
1343
|
properties:
|
@@ -1238,16 +1356,8 @@ components:
|
|
1238
1356
|
type: array
|
1239
1357
|
items:
|
1240
1358
|
$ref: "#/components/schemas/DescriptiveValue"
|
1359
|
+
version:
|
1360
|
+
description: The version of the standard or encoding.
|
1361
|
+
type: string
|
1241
1362
|
source:
|
1242
1363
|
$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.42.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -267,10 +267,11 @@ files:
|
|
267
267
|
- lib/cocina/models/descriptive_access_metadata.rb
|
268
268
|
- lib/cocina/models/descriptive_admin_metadata.rb
|
269
269
|
- lib/cocina/models/descriptive_basic_value.rb
|
270
|
+
- lib/cocina/models/descriptive_geographic_metadata.rb
|
270
271
|
- lib/cocina/models/descriptive_parallel_value.rb
|
271
272
|
- lib/cocina/models/descriptive_structured_value.rb
|
272
273
|
- lib/cocina/models/descriptive_value.rb
|
273
|
-
- lib/cocina/models/
|
274
|
+
- lib/cocina/models/descriptive_value_language.rb
|
274
275
|
- lib/cocina/models/dro.rb
|
275
276
|
- lib/cocina/models/dro_access.rb
|
276
277
|
- lib/cocina/models/dro_structural.rb
|
@@ -301,6 +302,7 @@ files:
|
|
301
302
|
- lib/cocina/models/source.rb
|
302
303
|
- lib/cocina/models/source_id.rb
|
303
304
|
- lib/cocina/models/standard.rb
|
305
|
+
- lib/cocina/models/title.rb
|
304
306
|
- lib/cocina/models/validator.rb
|
305
307
|
- lib/cocina/models/version.rb
|
306
308
|
- lib/cocina/models/vocab.rb
|
@@ -323,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
323
325
|
- !ruby/object:Gem::Version
|
324
326
|
version: '0'
|
325
327
|
requirements: []
|
326
|
-
rubygems_version: 3.
|
328
|
+
rubygems_version: 3.0.3
|
327
329
|
signing_key:
|
328
330
|
specification_version: 4
|
329
331
|
summary: Data models for the SDR
|