cocina-models 0.129.0 → 0.130.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e825fe93a987da1a8c23ce57093eb0ee376229a605d4e7bb548e56cabb03fc86
4
- data.tar.gz: 542a860bd40cd64f31232cd4dfd0b65e2b8ae53dddc1f86597a0b86951d0327a
3
+ metadata.gz: f094501e516f4a68db47da8fa1d78685b3f9d8b43cfabad11deaf1a8929e5601
4
+ data.tar.gz: 41a9862bc8297a71d1588705cf1e34296ef65af73225c166688085b87fc032b7
5
5
  SHA512:
6
- metadata.gz: 0a31ff1218930150d45c3457bd8f7915934416fae3ba9b37abbbc7acfea177e38943b9493d00335933ae9d7cde8a02def61a37780d805762fd9ac0f65fb6a46c
7
- data.tar.gz: bf0406a3f1d6267a40de10d1e747ac90bd9b57d75f11eeb33826b5161b7a7c46fcd84447f74e57b5b6e2e33c8313c7d493f5e0da682799a7bcf784bbc2c458e7
6
+ metadata.gz: 610982303cca76efa71946ae82436290a2df7611e8933311f96e8532c82093785470ec109c914b241a199781e58b0e0c9462d0c5f11c1f614975ccce8f0830e6
7
+ data.tar.gz: ba4ccb6d865668f67e3a163a16c21bf2f4b190bca8cf7b91adf1931a976ef3dd8a17609f95afce59eaa6522d694e3a77eb9d8b006c7bced789406c8dee44bd3c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocina-models (0.129.0)
4
+ cocina-models (0.130.0)
5
5
  activesupport
6
6
  cocina_display
7
7
  deprecation
@@ -45,7 +45,7 @@ GEM
45
45
  iso8601 (~> 0.13.0)
46
46
  janeway-jsonpath (>= 0.6, < 2)
47
47
  zeitwerk (~> 2.7)
48
- concurrent-ruby (1.3.7)
48
+ concurrent-ruby (1.3.8)
49
49
  connection_pool (3.0.2)
50
50
  csv (3.3.5)
51
51
  debug (1.11.1)
@@ -81,7 +81,7 @@ GEM
81
81
  activesupport (>= 3.0, < 9.0)
82
82
  equivalent-xml (0.6.0)
83
83
  nokogiri (>= 1.4.3)
84
- erb (6.0.4)
84
+ erb (6.0.6)
85
85
  faraday (2.14.3)
86
86
  faraday-net_http (>= 2.0, < 3.5)
87
87
  json
@@ -101,9 +101,9 @@ GEM
101
101
  iso8601 (0.13.0)
102
102
  janeway-jsonpath (1.0.0)
103
103
  json (2.21.1)
104
- jsonschema_rs (0.47.0-arm64-darwin)
104
+ jsonschema_rs (0.48.1-arm64-darwin)
105
105
  bigdecimal (>= 3.1, < 5)
106
- jsonschema_rs (0.47.0-x86_64-linux)
106
+ jsonschema_rs (0.48.1-x86_64-linux)
107
107
  bigdecimal (>= 3.1, < 5)
108
108
  language_server-protocol (3.17.0.6)
109
109
  lint_roller (1.1.0)
@@ -119,7 +119,7 @@ GEM
119
119
  racc (~> 1.4)
120
120
  optimist (3.2.1)
121
121
  parallel (2.1.0)
122
- parser (3.3.11.1)
122
+ parser (3.3.12.0)
123
123
  ast (~> 2.4.1)
124
124
  racc
125
125
  patience_diff (1.2.0)
@@ -184,7 +184,7 @@ GEM
184
184
  rubocop (~> 1.86, >= 1.86.2)
185
185
  ruby-progressbar (1.13.0)
186
186
  securerandom (0.4.1)
187
- simplecov (1.0.0)
187
+ simplecov (1.0.2)
188
188
  super_diff (0.19.0)
189
189
  attr_extras (>= 6.2.4, < 8)
190
190
  diff-lcs (~> 1.5)
@@ -226,9 +226,9 @@ CHECKSUMS
226
226
  bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
227
227
  builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
228
228
  bundler (4.0.16) sha256=d6ca5dd440c24f9abce9844cf44cc8e18c6a553de65a47efb4544137af92c47d
229
- cocina-models (0.129.0)
229
+ cocina-models (0.130.0)
230
230
  cocina_display (2.9.0) sha256=00e97cf826dafd5c547ca87b58e55f1d3bfa68fa4ddcddbbe25b4d9d9ed05d8f
231
- concurrent-ruby (1.3.7) sha256=4412caec3a5ea2e5fdc52076724c071a81f2c0593d83b2ac8cbb8ca63b3151b0
231
+ concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1
232
232
  connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
233
233
  csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f
234
234
  debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6
@@ -242,7 +242,7 @@ CHECKSUMS
242
242
  dry-types (1.9.1) sha256=baebeecdb9f8395d6c9d227b62011279440943e3ef2468fe8ccc1ba11467f178
243
243
  edtf (3.3.0) sha256=0ce2b80f5cf222870e5a3df130701f4d24b75c29e23e5bf3130f574d75073487
244
244
  equivalent-xml (0.6.0) sha256=8919761efa848ad0846369ff8be1f646b17e5061698c4867b09829000cc3f487
245
- erb (6.0.4) sha256=38e3803694be357fe2bfe312487c74beaf9fb4e5beb3e22498952fe1645b95d9
245
+ erb (6.0.6) sha256=a9b24986700f5bf127c4f297c5403c3ca41b83b0a316c0cd09a096b56e644ae5
246
246
  faraday (2.14.3) sha256=1882247e6766615c8220b4392bf1d27f6ebb63d8e28267587cef1fb0bf37f278
247
247
  faraday-net_http (3.4.4) sha256=0e78af151747ed1b00f33e25973b4bc220d7f16c00c39676817c8b12331eb588
248
248
  geo_coord (0.2.0) sha256=ae4e2dc5799deafa4db9138f3d7e85cf5e7dbd00b3b8395f1e1dbd34e007d7e8
@@ -253,8 +253,8 @@ CHECKSUMS
253
253
  iso8601 (0.13.0) sha256=298c2b15b7be5fa95a1372813d36a2257656cd8e906dfbc1f5cb409851425aa2
254
254
  janeway-jsonpath (1.0.0) sha256=c8293f009f2aea9487ddee3067ca735a1f758eb1c8834ff4fab3ffd06c56d0a3
255
255
  json (2.21.1) sha256=13a43df75d95641443f5702dff350f237164a9d811ff0f2c2800d4d980220583
256
- jsonschema_rs (0.47.0-arm64-darwin) sha256=ab3aae9da5796999d2686dfacaa2b4c9a5510b9194b4e4b73a6aa8767a78ac8a
257
- jsonschema_rs (0.47.0-x86_64-linux) sha256=5dfc5c14362cf5efee24242be23feb4342665f489b63e1eba4c256aac8c96047
256
+ jsonschema_rs (0.48.1-arm64-darwin) sha256=9159986e47c5fe4a169060c46adb0addfc5229bfcb44052d9f0b90071d1ab28b
257
+ jsonschema_rs (0.48.1-x86_64-linux) sha256=efbc173c13f982ba1a2396ee9c781016837c5797338ac1e0f8e765a23bf8ab58
258
258
  language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
259
259
  lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
260
260
  logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
@@ -264,7 +264,7 @@ CHECKSUMS
264
264
  nokogiri (1.19.4-x86_64-linux-gnu) sha256=379fae440b28915e3f19d752ce2dcf8465ed2b2fbefd2a7ca0dd497bc981a06a
265
265
  optimist (3.2.1) sha256=8cf8a0fd69f3aa24ab48885d3a666717c27bc3d9edd6e976e18b9d771e72e34e
266
266
  parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356
267
- parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54
267
+ parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
268
268
  patience_diff (1.2.0) sha256=f492094486af02fff4a80070fa6b4d0ebbcf4d42fb38bba29d095eef43f6822c
269
269
  pp (0.6.4) sha256=dfcb0fce700c41456265922884f9fe195d7fbb0674a3578e6c0f69588e82b570
270
270
  prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
@@ -289,7 +289,7 @@ CHECKSUMS
289
289
  rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2
290
290
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
291
291
  securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
292
- simplecov (1.0.0) sha256=bdc50b41fa4a8b3c860da4bf5d61ba4704479c51d08a8f53cbd56ae50778dca8
292
+ simplecov (1.0.2) sha256=c6459434efe4b948b46477cc2df2faa73ab365f83a33c7c17f81262f4f7f1244
293
293
  super_diff (0.19.0) sha256=c35fc1c0daa223d67b203fe3fb49a6cfd67850a53920319565c3c654e03ec902
294
294
  thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
295
295
  tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
@@ -21,9 +21,6 @@ module Cocina
21
21
  attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
22
22
  # Language of the descriptive element value
23
23
  attribute? :valueLanguage, DescriptiveValueLanguage.optional
24
- # For multiple representations of information about the same event (e.g. in different
25
- # languages)
26
- attribute :parallelEvent, Types::Strict::Array.of(DescriptiveParallelEvent).default([].freeze)
27
24
  end
28
25
  end
29
26
  end
@@ -104,58 +104,9 @@ module Cocina
104
104
  end
105
105
 
106
106
  def build_grouped_origin_infos(grouped_origin_infos)
107
- grouped_origin_infos.map do |origin_info_nodes|
108
- common_event_type = event_type_in_common(origin_info_nodes)
109
- common_display_label = display_label_in_common(origin_info_nodes)
110
-
111
- parallel_event = {
112
- type: common_event_type,
113
- displayLabel: common_display_label,
114
- parallelEvent: build_parallel_origin_infos(origin_info_nodes, common_event_type,
115
- common_display_label)
116
- }
117
-
118
- parallel_event.compact
119
- end.flatten
120
- end
121
-
122
- # For parallelEvent items, the valueLanguage construct is at the same level as the rest
123
- # of the event attributes, rather than inside each event attribute
124
- def build_parallel_origin_infos(origin_infos, common_event_type, common_display_label)
125
- origin_infos.flat_map do |origin_info|
126
- event = build_event_for_parallel_origin_info(origin_info)
127
- event[:valueLanguage] = LanguageScript.build(node: origin_info)
128
- event[:type] = display_label(origin_info) if common_event_type.blank?
129
- event[:displayLabel] = display_label(origin_info) if common_display_label.blank?
130
-
131
- event.compact
132
- end.compact
133
- end
134
-
135
- def build_event_for_parallel_origin_info(origin_info_node)
136
- return build_copyright_notice_event(origin_info_node) if origin_info_node['eventType'] == 'copyright notice'
137
-
138
- event = {}
139
- add_info_to_event(event, origin_info_node)
140
- event.compact
141
- end
142
-
143
- # @return String type for the cocina event if it is the same for all the origin_info_nodes, o.w. nil
144
- def event_type_in_common(origin_info_nodes)
145
- raw_type = origin_info_nodes.first['eventType']
146
- return if raw_type.blank?
147
-
148
- first_event_type = event_type(origin_info_nodes.first)
149
- first_event_type if origin_info_nodes.all? { |node| event_type(node) == first_event_type }
150
- end
151
-
152
- # @return String displayLabel for the cocina event if it is the same for all the origin_info_nodes, o.w. nil
153
- def display_label_in_common(origin_info_nodes)
154
- raw_label = origin_info_nodes.first['displayLabel']
155
- return if raw_label.blank?
156
-
157
- first_label = display_label(origin_info_nodes.first)
158
- first_label if origin_info_nodes.all? { |node| display_label(node) == first_label }
107
+ grouped_origin_infos.flat_map do |origin_info_nodes|
108
+ origin_info_nodes.map { |origin_info| build_event_for_origin_info(origin_info) }
109
+ end
159
110
  end
160
111
 
161
112
  def add_info_to_event(event, origin_info_node)
@@ -41,7 +41,7 @@ module Cocina
41
41
  # Some part of the path are ignored for the purpose of matching.
42
42
  def clean_path(path)
43
43
  new_path = path.reject do |part|
44
- part.is_a?(Integer) || %i[parallelValue parallelEvent].include?(part.to_sym)
44
+ part.is_a?(Integer) || %i[parallelValue].include?(part.to_sym)
45
45
  end.map(&:to_sym)
46
46
  # This needs to happen after parallelValue is removed
47
47
  # to handle structuredValue > parallelValue > structuredValue
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.129.0'
5
+ VERSION = '0.130.0'
6
6
  end
7
7
  end
data/schema.json CHANGED
@@ -1270,70 +1270,6 @@
1270
1270
  }
1271
1271
  }
1272
1272
  },
1273
- "DescriptiveParallelEvent": {
1274
- "description": "Value model for multiple representations of information about the same event (e.g. in different languages).",
1275
- "type": "object",
1276
- "allOf": [
1277
- {
1278
- "$ref": "#/$defs/DescriptiveStructuredValue"
1279
- },
1280
- {
1281
- "type": "object",
1282
- "properties": {
1283
- "type": {
1284
- "description": "Description of the event (creation, publication, etc.).",
1285
- "type": "string"
1286
- },
1287
- "displayLabel": {
1288
- "description": "The preferred display label to use for the event in access systems.",
1289
- "type": [
1290
- "string",
1291
- "null"
1292
- ]
1293
- },
1294
- "date": {
1295
- "description": "Dates associated with the event.",
1296
- "type": "array",
1297
- "items": {
1298
- "$ref": "#/$defs/DescriptiveValue"
1299
- }
1300
- },
1301
- "contributor": {
1302
- "description": "Contributors associated with the event.",
1303
- "type": "array",
1304
- "items": {
1305
- "$ref": "#/$defs/Contributor"
1306
- }
1307
- },
1308
- "location": {
1309
- "description": "Locations associated with the event.",
1310
- "type": "array",
1311
- "items": {
1312
- "$ref": "#/$defs/DescriptiveValue"
1313
- }
1314
- },
1315
- "identifier": {
1316
- "description": "Identifiers and URIs associated with the event.",
1317
- "type": "array",
1318
- "items": {
1319
- "$ref": "#/$defs/DescriptiveIdentifier"
1320
- }
1321
- },
1322
- "note": {
1323
- "description": "Other information about the event.",
1324
- "type": "array",
1325
- "items": {
1326
- "$ref": "#/$defs/DescriptiveValue"
1327
- }
1328
- },
1329
- "valueLanguage": {
1330
- "$ref": "#/$defs/DescriptiveValueLanguage"
1331
- }
1332
- }
1333
- }
1334
- ],
1335
- "unevaluatedProperties": false
1336
- },
1337
1273
  "DescriptiveParallelValue": {
1338
1274
  "description": "Value model for multiple representations of the same information (e.g. in different languages).",
1339
1275
  "type": "object",
@@ -1529,13 +1465,6 @@
1529
1465
  },
1530
1466
  "valueLanguage": {
1531
1467
  "$ref": "#/$defs/DescriptiveValueLanguage"
1532
- },
1533
- "parallelEvent": {
1534
- "description": "For multiple representations of information about the same event (e.g. in different languages)",
1535
- "type": "array",
1536
- "items": {
1537
- "$ref": "#/$defs/DescriptiveParallelEvent"
1538
- }
1539
1468
  }
1540
1469
  }
1541
1470
  }
@@ -1589,14 +1518,6 @@
1589
1518
  "minItems": 1
1590
1519
  }
1591
1520
  }
1592
- },
1593
- {
1594
- "required": ["parallelEvent"],
1595
- "properties": {
1596
- "parallelEvent": {
1597
- "minItems": 1
1598
- }
1599
- }
1600
1521
  }
1601
1522
  ]
1602
1523
  },
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.129.0
4
+ version: 0.130.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -382,7 +382,6 @@ files:
382
382
  - lib/cocina/models/descriptive_geographic_metadata.rb
383
383
  - lib/cocina/models/descriptive_grouped_value.rb
384
384
  - lib/cocina/models/descriptive_identifier.rb
385
- - lib/cocina/models/descriptive_parallel_event.rb
386
385
  - lib/cocina/models/descriptive_parallel_value.rb
387
386
  - lib/cocina/models/descriptive_structured_value.rb
388
387
  - lib/cocina/models/descriptive_value.rb
@@ -538,7 +537,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
538
537
  - !ruby/object:Gem::Version
539
538
  version: '0'
540
539
  requirements: []
541
- rubygems_version: 3.6.9
540
+ rubygems_version: 4.0.6
542
541
  specification_version: 4
543
542
  summary: Data models for the SDR
544
543
  test_files: []
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Cocina
4
- module Models
5
- # Value model for multiple representations of information about the same event (e.g.
6
- # in different languages).
7
- class DescriptiveParallelEvent < Struct
8
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
9
- # Description of the event (creation, publication, etc.).
10
- attribute? :type, Types::Strict::String
11
- # The preferred display label to use for the event in access systems.
12
- attribute? :displayLabel, Types::Strict::String.optional
13
- # Dates associated with the event.
14
- attribute :date, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
15
- # Contributors associated with the event.
16
- attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
17
- # Locations associated with the event.
18
- attribute :location, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
19
- # Identifiers and URIs associated with the event.
20
- attribute :identifier, Types::Strict::Array.of(DescriptiveIdentifier).default([].freeze)
21
- # Other information about the event.
22
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
23
- # Language of the descriptive element value
24
- attribute? :valueLanguage, DescriptiveValueLanguage.optional
25
- end
26
- end
27
- end