cocina-models 0.104.1 → 0.105.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +14 -14
- data/README.md +10 -0
- data/lib/cocina/models/contributor.rb +1 -0
- data/lib/cocina/models/mapping/to_mods/form.rb +8 -1
- data/lib/cocina/models/mapping/to_mods/name_writer.rb +13 -0
- data/lib/cocina/models/mapping/to_mods/title.rb +4 -0
- data/lib/cocina/models/related_resource.rb +1 -1
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad8e6d358007df9521cf0ab6a99a577fa4b8e41995ee46f9dff8429befd2253f
|
4
|
+
data.tar.gz: b4c9c7960929205624f78374dd5a373f5335cd98b9564f496d64e4d6128dd66a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ec11637cd4d26ad3f36a3d99dd7a2e66906a5ad842bc84500dc555c3843a523db54d4d0adc43714f4baa758ae0c8356b2d75c94e35e45d3364d120629c4f712
|
7
|
+
data.tar.gz: f342a814ef8115bfc814648de1330844f2db627e2bb643152f21859b76dc0f796d2ebe295788ca36a83a43f92b4785848a5eb1bc453ea798a2ab05619ee21832
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cocina-models (0.
|
4
|
+
cocina-models (0.105.1)
|
5
5
|
activesupport
|
6
6
|
deprecation
|
7
7
|
dry-struct (~> 1.0)
|
@@ -78,7 +78,7 @@ GEM
|
|
78
78
|
i18n (1.14.7)
|
79
79
|
concurrent-ruby (~> 1.0)
|
80
80
|
ice_nine (0.11.2)
|
81
|
-
json (2.
|
81
|
+
json (2.13.2)
|
82
82
|
json_schema (0.21.0)
|
83
83
|
jsonpath (1.1.5)
|
84
84
|
multi_json
|
@@ -87,29 +87,29 @@ GEM
|
|
87
87
|
logger (1.7.0)
|
88
88
|
mini_portile2 (2.8.9)
|
89
89
|
minitest (5.25.5)
|
90
|
-
multi_json (1.
|
91
|
-
nokogiri (1.18.
|
90
|
+
multi_json (1.17.0)
|
91
|
+
nokogiri (1.18.9)
|
92
92
|
mini_portile2 (~> 2.8.2)
|
93
93
|
racc (~> 1.4)
|
94
94
|
openapi_parser (1.0.0)
|
95
95
|
optimist (3.2.1)
|
96
96
|
parallel (1.27.0)
|
97
|
-
parser (3.3.
|
97
|
+
parser (3.3.9.0)
|
98
98
|
ast (~> 2.4.1)
|
99
99
|
racc
|
100
100
|
patience_diff (1.2.0)
|
101
101
|
optimist (~> 3.0)
|
102
102
|
prism (1.4.0)
|
103
103
|
racc (1.8.1)
|
104
|
-
rack (3.
|
104
|
+
rack (3.2.0)
|
105
105
|
rainbow (3.1.1)
|
106
106
|
rake (13.3.0)
|
107
|
-
regexp_parser (2.
|
107
|
+
regexp_parser (2.11.1)
|
108
108
|
rspec (3.13.1)
|
109
109
|
rspec-core (~> 3.13.0)
|
110
110
|
rspec-expectations (~> 3.13.0)
|
111
111
|
rspec-mocks (~> 3.13.0)
|
112
|
-
rspec-core (3.13.
|
112
|
+
rspec-core (3.13.5)
|
113
113
|
rspec-support (~> 3.13.0)
|
114
114
|
rspec-expectations (3.13.5)
|
115
115
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -120,7 +120,7 @@ GEM
|
|
120
120
|
rspec-support (3.13.4)
|
121
121
|
rspec_junit_formatter (0.6.0)
|
122
122
|
rspec-core (>= 2, < 4, != 2.12.0)
|
123
|
-
rubocop (1.
|
123
|
+
rubocop (1.79.2)
|
124
124
|
json (~> 2.3)
|
125
125
|
language_server-protocol (~> 3.17.0.2)
|
126
126
|
lint_roller (~> 1.1.0)
|
@@ -128,10 +128,10 @@ GEM
|
|
128
128
|
parser (>= 3.3.0.2)
|
129
129
|
rainbow (>= 2.2.2, < 4.0)
|
130
130
|
regexp_parser (>= 2.9.3, < 3.0)
|
131
|
-
rubocop-ast (>= 1.
|
131
|
+
rubocop-ast (>= 1.46.0, < 2.0)
|
132
132
|
ruby-progressbar (~> 1.7)
|
133
133
|
unicode-display_width (>= 2.4.0, < 4.0)
|
134
|
-
rubocop-ast (1.
|
134
|
+
rubocop-ast (1.46.0)
|
135
135
|
parser (>= 3.3.7.2)
|
136
136
|
prism (~> 1.4)
|
137
137
|
rubocop-rake (0.7.1)
|
@@ -146,13 +146,13 @@ GEM
|
|
146
146
|
docile (~> 1.1)
|
147
147
|
simplecov-html (~> 0.11)
|
148
148
|
simplecov_json_formatter (~> 0.1)
|
149
|
-
simplecov-html (0.13.
|
149
|
+
simplecov-html (0.13.2)
|
150
150
|
simplecov_json_formatter (0.1.4)
|
151
151
|
super_diff (0.16.0)
|
152
152
|
attr_extras (>= 6.2.4)
|
153
153
|
diff-lcs
|
154
154
|
patience_diff
|
155
|
-
thor (1.
|
155
|
+
thor (1.4.0)
|
156
156
|
tzinfo (2.0.6)
|
157
157
|
concurrent-ruby (~> 1.0)
|
158
158
|
unicode-display_width (3.1.4)
|
@@ -178,4 +178,4 @@ DEPENDENCIES
|
|
178
178
|
simplecov
|
179
179
|
|
180
180
|
BUNDLED WITH
|
181
|
-
2.
|
181
|
+
2.7.1
|
data/README.md
CHANGED
@@ -205,6 +205,14 @@ If for some reason the above method does not work, the sul-dlss/access-update-sc
|
|
205
205
|
```
|
206
206
|
REPOS_PATH=infrastructure GH_ACCESS_TOKEN=abc123 COCINA_LEVEL2= ./merge-all.rb
|
207
207
|
```
|
208
|
+
|
209
|
+
### Step 4C: Update purl-fetcher
|
210
|
+
Create a branch and update cocina-models:
|
211
|
+
```
|
212
|
+
bundle update --conservative cocina-models
|
213
|
+
```
|
214
|
+
Once merged, it will deploy to stage via CD.
|
215
|
+
|
208
216
|
### Step 5: Deploy and test
|
209
217
|
|
210
218
|
#### Step 5A: Deploy to Stage or QA
|
@@ -220,6 +228,8 @@ It is safest to ensure _all_ the integration tests run cleanly. However, patch
|
|
220
228
|
|
221
229
|
**[Turn off Google Books](https://sul-gbooks-prod.stanford.edu/features) when deploying to production.** This avoids failed deposit due to a temporary Cocina model mismatch. Unlike other applications, the deposits will fail without retry and require manual remediation.
|
222
230
|
|
231
|
+
In addition to deploying infrastructure apps via sdr-deploy, tag and cut a release of purl-fetcher. That will trigger its deploy to production.
|
232
|
+
|
223
233
|
## Usage conventions
|
224
234
|
|
225
235
|
The following are the recommended naming conventions for code using Cocina models:
|
@@ -11,6 +11,7 @@ module Cocina
|
|
11
11
|
attribute? :status, Types::Strict::String
|
12
12
|
attribute :role, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
13
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
|
+
attribute :affiliation, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
15
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
15
16
|
# URL or other pointer to the location of the contributor information.
|
16
17
|
attribute? :valueAt, Types::Strict::String
|
@@ -226,7 +226,14 @@ module Cocina
|
|
226
226
|
|
227
227
|
def datacite_resource_type
|
228
228
|
self_deposit_types = forms.find do |candidate|
|
229
|
-
candidate.source
|
229
|
+
# Why do we need to verify that `candidate.source` is non-nil
|
230
|
+
# here? Before this change, our datacite resource-type handling
|
231
|
+
# could safely assume that the descriptive form metadata was
|
232
|
+
# constrained to the H2/H3 shape. As of August 2025, we're minting
|
233
|
+
# DOIs for ETDs which have their own descriptive form metadata
|
234
|
+
# (now including datacite resource types), and this assumption no
|
235
|
+
# longer holds. One of the ETD form values includes no source.
|
236
|
+
candidate.source&.value == 'Stanford self-deposit resource types'
|
230
237
|
end
|
231
238
|
return unless self_deposit_types
|
232
239
|
|
@@ -75,6 +75,7 @@ module Cocina
|
|
75
75
|
write_name(name)
|
76
76
|
end
|
77
77
|
write_identifier(contributor) if contributor.identifier.present?
|
78
|
+
write_affiliation(contributor)
|
78
79
|
write_note(contributor)
|
79
80
|
write_roles(contributor)
|
80
81
|
xml.etal if contributor.type == 'unspecified others'
|
@@ -145,6 +146,7 @@ module Cocina
|
|
145
146
|
write_basic(parallel_name)
|
146
147
|
end
|
147
148
|
write_identifier(contributor) if contributor.identifier.present?
|
149
|
+
write_affiliation(contributor)
|
148
150
|
write_note(contributor)
|
149
151
|
write_roles(contributor)
|
150
152
|
end
|
@@ -171,6 +173,7 @@ module Cocina
|
|
171
173
|
end
|
172
174
|
write_display_form(display_type_parallel_name) if display_type_parallel_name.present?
|
173
175
|
write_identifier(contributor) if contributor.identifier.present?
|
176
|
+
write_affiliation(contributor)
|
174
177
|
write_note(contributor)
|
175
178
|
write_roles(contributor)
|
176
179
|
end
|
@@ -252,6 +255,16 @@ module Cocina
|
|
252
255
|
end
|
253
256
|
end
|
254
257
|
|
258
|
+
def write_affiliation(contributor)
|
259
|
+
Array(contributor.affiliation).each do |affiliation|
|
260
|
+
if affiliation.structuredValue.present?
|
261
|
+
xml.affiliation affiliation.structuredValue.map(&:value).join(', ')
|
262
|
+
else
|
263
|
+
xml.affiliation affiliation.value
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
255
268
|
def write_note(contributor)
|
256
269
|
Array(contributor.note).each do |note|
|
257
270
|
case note.type
|
@@ -92,6 +92,10 @@ module Cocina
|
|
92
92
|
|
93
93
|
xml.titleInfo(title_info_attrs) do
|
94
94
|
xml.title(title.value)
|
95
|
+
if title.status == 'primary' &&
|
96
|
+
(part_label = catalog_links.find { |link| link.catalog == 'folio' && link.partLabel.present? }&.partLabel)
|
97
|
+
xml.partNumber(part_label)
|
98
|
+
end
|
95
99
|
end
|
96
100
|
end
|
97
101
|
|
@@ -6,7 +6,7 @@ module Cocina
|
|
6
6
|
class RelatedResource < Struct
|
7
7
|
# The relationship of the related resource to the described resource.
|
8
8
|
attribute? :type, Types::Strict::String
|
9
|
-
# The DataCite relationType describing the relationship
|
9
|
+
# The DataCite relationType describing the relationship from the related resource to the described resource. See https://datacite-metadata-schema.readthedocs.io/en/4.6/appendices/appendix-1/relationType
|
10
10
|
attribute? :dataCiteRelationType, Types::Strict::String.enum('IsCitedBy', 'Cites', 'IsSupplementTo', 'IsSupplementedBy', 'IsContinuedBy', 'Continues', 'Describes', 'IsDescribedBy', 'HasMetadata', 'IsMetadataFor', 'HasVersion', 'IsVersionOf', 'IsNewVersionOf', 'IsPreviousVersionOf', 'IsPartOf', 'HasPart', 'IsPublishedIn', 'IsReferencedBy', 'References', 'IsDocumentedBy', 'Documents', 'IsCompiledBy', 'Compiles', 'IsVariantFormOf', 'IsOriginalFormOf', 'IsIdenticalTo', 'IsReviewedBy', 'Reviews', 'IsDerivedFrom', 'IsSourceOf', 'IsRequiredBy', 'Requires', 'Obsoletes', 'IsObsoletedBy', 'IsCollectedBy', 'Collects', 'IsTranslationOf', 'HasTranslation')
|
11
11
|
# Status of the related resource relative to other related resources.
|
12
12
|
attribute? :status, Types::Strict::String
|
data/openapi.yml
CHANGED
@@ -464,6 +464,11 @@ components:
|
|
464
464
|
type: array
|
465
465
|
items:
|
466
466
|
$ref: "#/components/schemas/DescriptiveValue"
|
467
|
+
affiliation:
|
468
|
+
description: Institutional or other affiliation associated with a contributor.
|
469
|
+
type: array
|
470
|
+
items:
|
471
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
467
472
|
note:
|
468
473
|
description: Other information associated with the contributor.
|
469
474
|
type: array
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocina-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.105.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activesupport
|
@@ -535,7 +535,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
535
535
|
- !ruby/object:Gem::Version
|
536
536
|
version: '0'
|
537
537
|
requirements: []
|
538
|
-
rubygems_version: 3.
|
538
|
+
rubygems_version: 3.7.0
|
539
539
|
specification_version: 4
|
540
540
|
summary: Data models for the SDR
|
541
541
|
test_files: []
|