cocina-models 0.104.1 → 0.105.0
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 +4 -4
- data/lib/cocina/models/contributor.rb +1 -0
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4212bb17cb4acb8f0c53d3fe1261d92db13e5a85c53126e05f05dc01073124c1
|
4
|
+
data.tar.gz: e2573a32a29b15ed9ed9dc6f097174cca792777f1c0bfcfba070ea158c8bbacd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7ad0cd6c969cded866c97ece359b5049ee1fbc0a6c0a70dceda3d8a53458370f28019262ffcacf689bf5d66e6598e662b4c2663b66d635ae028745a602c2c98
|
7
|
+
data.tar.gz: fbfb1bc4b547225702d52bdeed7ac32490ee0348572238ddc69e1d1d92bcd5a5bcf911bf1be360db3c4e918238f0440082da13575cff344f3a9888bd749c04a6
|
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.0)
|
5
5
|
activesupport
|
6
6
|
deprecation
|
7
7
|
dry-struct (~> 1.0)
|
@@ -87,7 +87,7 @@ GEM
|
|
87
87
|
logger (1.7.0)
|
88
88
|
mini_portile2 (2.8.9)
|
89
89
|
minitest (5.25.5)
|
90
|
-
multi_json (1.
|
90
|
+
multi_json (1.16.0)
|
91
91
|
nokogiri (1.18.8)
|
92
92
|
mini_portile2 (~> 2.8.2)
|
93
93
|
racc (~> 1.4)
|
@@ -109,7 +109,7 @@ GEM
|
|
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.78.0)
|
124
124
|
json (~> 2.3)
|
125
125
|
language_server-protocol (~> 3.17.0.2)
|
126
126
|
lint_roller (~> 1.1.0)
|
@@ -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
|
@@ -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.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-07-18 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activesupport
|