cocina-models 0.114.0 → 0.115.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: 2b8514cca9a06bbf3e7c36d84a1f27d093e16a263e8ac1cb92289b6640d28bec
4
- data.tar.gz: '09f25bf203314c534eba5e21a16b163f56b21ac2e858cf9a5a25f309086efa12'
3
+ metadata.gz: 4d9e710c098333b0b95f15f1f624a365b7067e3ef638d48e7f04bcbc72f2b038
4
+ data.tar.gz: 2bcb210b1f563ddc1916fe8a718f326184c75eb077f3c931372083ad1bf8c179
5
5
  SHA512:
6
- metadata.gz: 2dce9b0cc4eb70cc6a2ddbc2dda88e5249b9ac58a0ec96523ec9c3e23ebe82108d87eb1e36b70e8e44a0d8c0abf75682c6f284dbda26e4cefe469b4acf5bf715
7
- data.tar.gz: 795ba280b81c888fd005cc5af39d671b942f3d5b718b61b44e902581d476958654f28485aec4f8d18de4d725a6b9338c84c8a0acc4a7c315b04e5cd2ec22c9a8
6
+ metadata.gz: ec2b6a2e5a92c4cc712e09e2edc23a6975c37eb71f13133e1400d21d999880f1a79a8962624bdd339cffaa08e88a0fffd4395c716b1ed49360c5045a43edf666
7
+ data.tar.gz: 69f0f8869d2536477765b033c39387ef4693f648e50747fa49e15d1cb1cd27be7bc830dec49bf5beb06a1a04472ddf78750201c60c31d002f47006ed72c99751
data/.rubocop.yml CHANGED
@@ -540,7 +540,6 @@ Style/RedundantArrayFlatten: # new in 1.76
540
540
  Enabled: true
541
541
  Style/ArrayIntersectWithSingleElement: # new in 1.81
542
542
  Enabled: true
543
-
544
543
  Style/EmptyClassDefinition: # new in 1.83
545
544
  Enabled: true
546
545
  Style/ModuleMemberExistenceCheck: # new in 1.82
@@ -552,4 +551,30 @@ Style/ReverseFind: # new in 1.83
552
551
  RSpec/LeakyLocalVariable: # new in 3.8
553
552
  Enabled: true
554
553
  RSpec/Output: # new in 3.9
555
- Enabled: true
554
+ Enabled: true
555
+ Lint/DataDefineOverride: # new in 1.85
556
+ Enabled: true
557
+ Lint/UnreachablePatternBranch: # new in 1.85
558
+ Enabled: true
559
+ Style/FileOpen: # new in 1.85
560
+ Enabled: true
561
+ Style/MapJoin: # new in 1.85
562
+ Enabled: true
563
+ Style/OneClassPerFile: # new in 1.85
564
+ Enabled: true
565
+ Style/PartitionInsteadOfDoubleSelect: # new in 1.85
566
+ Enabled: true
567
+ Style/PredicateWithKind: # new in 1.85
568
+ Enabled: true
569
+ Style/ReduceToHash: # new in 1.85
570
+ Enabled: true
571
+ Style/RedundantMinMaxBy: # new in 1.85
572
+ Enabled: true
573
+ Style/RedundantStructKeywordInit: # new in 1.85
574
+ Enabled: true
575
+ Style/SelectByKind: # new in 1.85
576
+ Enabled: true
577
+ Style/SelectByRange: # new in 1.85
578
+ Enabled: true
579
+ Style/TallyMethod: # new in 1.85
580
+ Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocina-models (0.114.0)
4
+ cocina-models (0.115.0)
5
5
  activesupport
6
6
  deprecation
7
7
  dry-struct (~> 1.0)
@@ -162,7 +162,7 @@ GEM
162
162
  rubocop-ast (>= 1.49.0, < 2.0)
163
163
  ruby-progressbar (~> 1.7)
164
164
  unicode-display_width (>= 2.4.0, < 4.0)
165
- rubocop-ast (1.49.0)
165
+ rubocop-ast (1.49.1)
166
166
  parser (>= 3.3.7.2)
167
167
  prism (~> 1.7)
168
168
  rubocop-rake (0.7.1)
@@ -219,7 +219,7 @@ CHECKSUMS
219
219
  attr_extras (7.1.0) sha256=d96fc9a9dd5d85ba2d37762440a816f840093959ae26bb90da994c2d9f1fc827
220
220
  base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
221
221
  bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
222
- cocina-models (0.114.0)
222
+ cocina-models (0.115.0)
223
223
  concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
224
224
  connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
225
225
  date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
@@ -275,7 +275,7 @@ CHECKSUMS
275
275
  rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
276
276
  rspec_junit_formatter (0.6.0) sha256=40dde674e6ae4e6cc0ff560da25497677e34fefd2338cc467a8972f602b62b15
277
277
  rubocop (1.85.1) sha256=3dbcf9e961baa4c376eeeb2a03913dca5e3987033b04d38fa538aa1e7406cc77
278
- rubocop-ast (1.49.0) sha256=49c3676d3123a0923d333e20c6c2dbaaae2d2287b475273fddee0c61da9f71fd
278
+ rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035
279
279
  rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
280
280
  rubocop-rspec (3.9.0) sha256=8fa70a3619408237d789aeecfb9beef40576acc855173e60939d63332fdb55e2
281
281
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
@@ -295,4 +295,4 @@ CHECKSUMS
295
295
  zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd
296
296
 
297
297
  BUNDLED WITH
298
- 4.0.7
298
+ 4.0.8
data/README.md CHANGED
@@ -55,7 +55,7 @@ Beyond what is necessary to test the generator, the Cocina model classes are not
55
55
 
56
56
  ## Testing validation changes
57
57
 
58
- If there is a possibility that a model, mapping, or validation change will conflict with some existing objects then `bin/validate-data` should be used for testing. This operates on a sample of objects from the repository and reports any validation errors. You may get the sample by running the script [bin/export-cocina-head-versions](https://github.com/sul-dlss/dor-services-app/pull/5854) and downloading the data file to your computer.
58
+ If there is a possibility that a model, mapping, or validation change will conflict with some existing objects then `bin/validate-data` should be used for testing. This operates on a sample of objects from the repository and reports any validation errors. You may get the sample by running the script [bin/export-cocina-head-versions](https://github.com/sul-dlss/dor-services-app?tab=readme-ov-file#export-data) and downloading the data file to your computer. Running a full validation takes about 2 hours.
59
59
 
60
60
 
61
61
  Alternatively, you can use [validate-cocina](https://github.com/sul-dlss/dor-services-app/blob/main/bin/validate-cocina) for testing. This must be run on the `sdr-infra` VM since it requires deploying a branch of cocina-models. It is slower than using `bin/validate-data`, but all of the data is completely up to date.
data/bin/validate-data CHANGED
@@ -103,7 +103,7 @@ def worker_process(reader) # rubocop:disable Metrics/MethodLength
103
103
  rescue JSON::ParserError => e
104
104
  errors << { line: line_num, error: "JSON Parse Error: #{e.message}" }
105
105
  rescue Cocina::Models::ValidationError => e
106
- errors << { line: line_num, error: "Validation Error: #{e.message}" }
106
+ errors << { line: line_num, error: "Validation Error: #{json['externalIdentifier']} - #{e.message}" }
107
107
  rescue Cocina::Models::UnknownTypeError => e
108
108
  errors << { line: line_num, error: "Unknown Type Error: #{e.message}" }
109
109
  rescue StandardError => e
@@ -125,6 +125,11 @@ def spawn_workers(num_processes) # rubocop:disable Metrics/MethodLength
125
125
 
126
126
  pid = fork do
127
127
  # Child process
128
+
129
+ # Close all writer pipes inherited from the parent for OTHER workers.
130
+ workers.each { |w| w[:writer].close }
131
+
132
+ # Now, close the handles for this specific worker that the child doesn't need.
128
133
  work_writer.close
129
134
  result_reader.close
130
135
 
@@ -23,9 +23,6 @@ module Cocina
23
23
  attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
24
24
  # URL or other pointer to the location of the contributor information.
25
25
  attribute? :valueAt, Types::Strict::String
26
- # For multiple representations of information about the same contributor (e.g. in different
27
- # languages).
28
- attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).default([].freeze)
29
26
  end
30
27
  end
31
28
  end
@@ -73,7 +73,7 @@ module Cocina
73
73
  # Some part of the path are ignored for the purpose of matching.
74
74
  def clean_path(path)
75
75
  new_path = path.reject do |part|
76
- part.is_a?(Integer) || %i[parallelValue parallelContributor parallelEvent].include?(part.to_sym)
76
+ part.is_a?(Integer) || %i[parallelValue parallelEvent].include?(part.to_sym)
77
77
  end.map(&:to_sym)
78
78
  # This needs to happen after parallelValue is removed
79
79
  # to handle structuredValue > parallelValue > structuredValue
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.114.0'
5
+ VERSION = '0.115.0'
6
6
  end
7
7
  end
data/lib/cocina/models.rb CHANGED
@@ -43,7 +43,7 @@ loader.ignore("#{__dir__}/rspec.rb")
43
43
  loader.ignore("#{__dir__}/rspec")
44
44
  loader.setup
45
45
 
46
- module Cocina
46
+ module Cocina # rubocop:disable Style/OneClassPerFile
47
47
  # Provides Ruby objects for the repository and serializing them to/from JSON.
48
48
  module Models
49
49
  class Error < StandardError; end
data/schema.json CHANGED
@@ -444,13 +444,6 @@
444
444
  "valueAt": {
445
445
  "description": "URL or other pointer to the location of the contributor information.",
446
446
  "type": "string"
447
- },
448
- "parallelContributor": {
449
- "description": "For multiple representations of information about the same contributor (e.g. in different languages).",
450
- "type": "array",
451
- "items": {
452
- "$ref": "#/$defs/DescriptiveParallelContributor"
453
- }
454
447
  }
455
448
  }
456
449
  },
@@ -903,56 +896,6 @@
903
896
  }
904
897
  }
905
898
  },
906
- "DescriptiveParallelContributor": {
907
- "description": "Value model for multiple representations of information about the same contributor (e.g. in different languages).",
908
- "deprecated": true,
909
- "type": "object",
910
- "properties": {
911
- "name": {
912
- "description": "Names associated with a contributor.",
913
- "type": "array",
914
- "items": {
915
- "$ref": "#/$defs/DescriptiveValue"
916
- }
917
- },
918
- "type": {
919
- "description": "Entity type of the contributor (person, organization, etc.). See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md for valid types.",
920
- "type": "string"
921
- },
922
- "status": {
923
- "description": "Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).",
924
- "type": "string"
925
- },
926
- "role": {
927
- "description": "Relationships of the contributor to the resource or to an event in its history.",
928
- "type": "array",
929
- "items": {
930
- "$ref": "#/$defs/DescriptiveValue"
931
- }
932
- },
933
- "identifier": {
934
- "description": "Identifiers and URIs associated with the contributor entity.",
935
- "type": "array",
936
- "items": {
937
- "$ref": "#/$defs/DescriptiveValue"
938
- }
939
- },
940
- "note": {
941
- "description": "Other information associated with the contributor.",
942
- "type": "array",
943
- "items": {
944
- "$ref": "#/$defs/DescriptiveValue"
945
- }
946
- },
947
- "valueAt": {
948
- "description": "URL or other pointer to the location of the contributor information.",
949
- "type": "string"
950
- },
951
- "valueLanguage": {
952
- "$ref": "#/$defs/DescriptiveValueLanguage"
953
- }
954
- }
955
- },
956
899
  "DescriptiveParallelEvent": {
957
900
  "description": "Value model for multiple representations of information about the same event (e.g. in different languages).",
958
901
  "type": "object",
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.114.0
4
+ version: 0.115.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-03-13 00:00:00.000000000 Z
10
+ date: 2026-03-19 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport
@@ -372,7 +372,6 @@ files:
372
372
  - lib/cocina/models/descriptive_basic_value.rb
373
373
  - lib/cocina/models/descriptive_geographic_metadata.rb
374
374
  - lib/cocina/models/descriptive_grouped_value.rb
375
- - lib/cocina/models/descriptive_parallel_contributor.rb
376
375
  - lib/cocina/models/descriptive_parallel_event.rb
377
376
  - lib/cocina/models/descriptive_parallel_value.rb
378
377
  - lib/cocina/models/descriptive_structured_value.rb
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Cocina
4
- module Models
5
- # DEPRECATED
6
- # Value model for multiple representations of information about the same contributor
7
- # (e.g. in different languages).
8
- class DescriptiveParallelContributor < Struct
9
- # Names associated with a contributor.
10
- attribute :name, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
11
- # Entity type of the contributor (person, organization, etc.). See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md
12
- # for valid types.
13
- attribute? :type, Types::Strict::String
14
- # Status of the contributor relative to other parallel contributors (e.g. the primary
15
- # author among a group of contributors).
16
- attribute? :status, Types::Strict::String
17
- # Relationships of the contributor to the resource or to an event in its history.
18
- attribute :role, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
19
- # Identifiers and URIs associated with the contributor entity.
20
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
21
- # Other information associated with the contributor.
22
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
23
- # URL or other pointer to the location of the contributor information.
24
- attribute? :valueAt, Types::Strict::String
25
- # Language of the descriptive element value
26
- attribute? :valueLanguage, DescriptiveValueLanguage.optional
27
- end
28
- end
29
- end