cocina-models 0.99.4 → 0.101.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: 41bd326d5fc785d050467a40c155db810ff7b9d639d314654ccab38d4496eb4f
4
- data.tar.gz: 7af9ccf5082bb028c3af2b7a11e3a1bffc60e17d79d4ef7c296497c3fc3f8723
3
+ metadata.gz: 2198f8b258a6cae8fe0a3569eb5e36a400964d9ea0d05c6ec7bb19a761071e42
4
+ data.tar.gz: 31b0657ba52c6f143b7cbceadb585f8710ff8f8d24410101a2daa22a7ad5ce56
5
5
  SHA512:
6
- metadata.gz: f30cf1b9d9ebbbe8e98bcc489248841689518badbd047ba5647115d706a9c7716ed596dee81ebc8579843f89b2ffa513e98e2b82ca8e4d5d45781bbdc5f96574
7
- data.tar.gz: 76d24ee0f27114027027cefaff3a2ff4ddc96b580da7979c873c6bce8a7d3f881b0c71515ae74dde98957136fa298feec2aab9f978cf0c9b128f5afc38e06c9a
6
+ metadata.gz: 532777c074a4edcd3116bc6df43bf189b554e8b10bd63531940e9bf2019262989ae925a02582b2a51dac96dcb5f275edd686728d11f28ec33a2e8d95350d095c
7
+ data.tar.gz: aa06744ae066e38d1f4c1cc8094c0bd39ef789008971ff51c0d0eb0315333cf65117a1f539b241fd91c82313d3299b4a73bd286f1d89f9f0b388b98f31aaa829
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@4.4.0
3
+ ruby-rails: sul-dlss/ruby-rails@4.6.0
4
4
  workflows:
5
5
  build:
6
6
  jobs:
@@ -11,4 +11,3 @@ workflows:
11
11
  - ruby-rails/test-gem:
12
12
  name: test
13
13
  context: dlss
14
- use-codecov: true
data/.rubocop.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  # This is the configuration used to check the rubocop source code.
2
2
 
3
3
  inherit_from: .rubocop_todo.yml
4
- require:
5
- - rubocop-rspec
4
+ plugins:
6
5
  - rubocop-rake
6
+ - rubocop-rspec
7
7
 
8
8
  AllCops:
9
9
  TargetRubyVersion: 3.0
@@ -301,10 +301,6 @@ RSpec/IdenticalEqualityAssertion: # new in 2.4
301
301
  Enabled: true
302
302
  RSpec/SubjectDeclaration: # new in 2.5
303
303
  Enabled: true
304
- FactoryBot/SyntaxMethods: # new in 2.7
305
- Enabled: true
306
- RSpecRails/AvoidSetupHook: # new in 2.4
307
- Enabled: true
308
304
  Style/NestedFileDirname: # new in 1.26
309
305
  Enabled: true
310
306
 
@@ -341,17 +337,10 @@ Style/MapCompactWithConditionalBlock: # new in 1.30
341
337
  Enabled: true
342
338
  RSpec/ChangeByZero: # new in 2.11.0
343
339
  Enabled: true
344
- Capybara/SpecificMatcher: # new in 2.12
345
- Enabled: false
346
- RSpecRails/HaveHttpStatus: # new in 2.12
347
- Enabled: false
348
-
349
340
  RSpec/ClassCheck: # new in 2.13
350
341
  Enabled: true
351
342
  RSpec/NoExpectationExample: # new in 2.13
352
343
  Enabled: true
353
- Capybara/SpecificFinders: # new in 2.13
354
- Enabled: true
355
344
  Gemspec/DevelopmentDependencies: # new in 1.44
356
345
  Enabled: true
357
346
  Lint/DuplicateMagicComment: # new in 1.37
@@ -378,29 +367,14 @@ Style/RedundantEach: # new in 1.38
378
367
  Enabled: true
379
368
  Style/RedundantStringEscape: # new in 1.37
380
369
  Enabled: true
381
- Capybara/MatchStyle: # new in <<next>>
382
- Enabled: true
383
- Capybara/NegationMatcher: # new in 2.14
384
- Enabled: true
385
- Capybara/SpecificActions: # new in 2.14
386
- Enabled: true
387
370
  RSpec/DuplicatedMetadata: # new in 2.16
388
371
  Enabled: true
389
372
  RSpec/PendingWithoutReason: # new in 2.16
390
373
  Enabled: true
391
374
  RSpec/SortMetadata: # new in 2.14
392
375
  Enabled: true
393
- FactoryBot/ConsistentParenthesesStyle: # new in 2.14
394
- Enabled: true
395
- FactoryBot/FactoryNameStyle: # new in 2.16
396
- Enabled: true
397
- RSpecRails/InferredSpecType: # new in 2.14
398
- Enabled: true
399
- RSpecRails/MinitestAssertions: # new in 2.17
400
- Enabled: true
401
376
  Style/RedundantHeredocDelimiterQuotes: # new in 1.45
402
377
  Enabled: true
403
-
404
378
  Metrics/CollectionLiteralLength: # new in 1.47
405
379
  Enabled: true
406
380
  Style/DirEmpty: # new in 1.48
@@ -411,9 +385,6 @@ RSpec/RedundantAround: # new in 2.19
411
385
  Enabled: true
412
386
  RSpec/SkipBlockInsideExample: # new in 2.19
413
387
  Enabled: true
414
- RSpecRails/TravelAround: # new in 2.19
415
- Enabled: true
416
-
417
388
  Lint/DuplicateMatchPattern: # new in 1.50
418
389
  Enabled: true
419
390
  Style/DataInheritance: # new in 1.49
@@ -428,12 +399,6 @@ Style/RedundantLineContinuation: # new in 1.49
428
399
  Enabled: true
429
400
  Style/RedundantRegexpConstructor: # new in 1.52
430
401
  Enabled: true
431
- FactoryBot/AssociationStyle: # new in 2.23
432
- Enabled: true
433
- FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
434
- Enabled: true
435
- FactoryBot/RedundantFactoryOption: # new in 2.23
436
- Enabled: true
437
402
  RSpec/BeEmpty: # new in 2.20
438
403
  Enabled: true
439
404
  RSpec/ContainExactly: # new in 2.19
@@ -457,9 +422,6 @@ Style/YAMLFileRead: # new in 1.53
457
422
  Enabled: true
458
423
  RSpec/ReceiveMessages: # new in 2.23
459
424
  Enabled: true
460
- RSpecRails/NegationBeValid: # new in 2.23
461
- Enabled: true
462
-
463
425
  Lint/ItWithoutArgumentsInBlock: # new in 1.59
464
426
  Enabled: true
465
427
  Lint/LiteralAssignmentInCondition: # new in 1.58
@@ -468,18 +430,6 @@ Style/SingleLineDoEndBlock: # new in 1.57
468
430
  Enabled: true
469
431
  Style/SuperWithArgsParentheses: # new in 1.58
470
432
  Enabled: true
471
- Capybara/ClickLinkOrButtonStyle: # new in 2.19
472
- Enabled: true
473
- Capybara/RedundantWithinFind: # new in 2.20
474
- Enabled: true
475
- Capybara/RSpec/HaveSelector: # new in 2.19
476
- Enabled: true
477
- Capybara/RSpec/PredicateMatcher: # new in 2.19
478
- Enabled: true
479
- FactoryBot/ExcessiveCreateList: # new in 2.25
480
- Enabled: true
481
- FactoryBot/IdSequence: # new in 2.24
482
- Enabled: true
483
433
  RSpec/EmptyMetadata: # new in 2.24
484
434
  Enabled: true
485
435
  RSpec/Eq: # new in 2.24
@@ -498,7 +448,6 @@ RSpec/IsExpectedSpecify: # new in 2.27
498
448
  Enabled: true
499
449
  RSpec/RepeatedSubjectCall: # new in 2.27
500
450
  Enabled: true
501
-
502
451
  Style/MapIntoArray: # new in 1.63
503
452
  Enabled: true
504
453
  Style/SendWithLiteralMethodName: # new in 1.64
@@ -511,7 +460,6 @@ RSpec/ExpectInLet: # new in 2.30
511
460
  Enabled: true
512
461
  RSpec/UndescriptiveLiteralsDescription: # new in 2.29
513
462
  Enabled: true
514
-
515
463
  Gemspec/AddRuntimeDependency: # new in 1.65
516
464
  Enabled: true
517
465
  Lint/DuplicateSetElement: # new in 1.67
@@ -532,3 +480,35 @@ Style/RedundantInterpolationUnfreeze: # new in 1.66
532
480
  Enabled: true
533
481
  Style/SafeNavigationChainLength: # new in 1.68
534
482
  Enabled: false
483
+ Lint/ArrayLiteralInRegexp: # new in 1.71
484
+ Enabled: true
485
+ Lint/ConstantReassignment: # new in 1.70
486
+ Enabled: true
487
+ Lint/CopDirectiveSyntax: # new in 1.72
488
+ Enabled: true
489
+ Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
490
+ Enabled: true
491
+ Lint/NumericOperationWithConstantResult: # new in 1.69
492
+ Enabled: true
493
+ Lint/RedundantTypeConversion: # new in 1.72
494
+ Enabled: true
495
+ Lint/SharedMutableDefault: # new in 1.70
496
+ Enabled: true
497
+ Lint/SuppressedExceptionInNumberConversion: # new in 1.72
498
+ Enabled: true
499
+ Lint/UselessConstantScoping: # new in 1.72
500
+ Enabled: true
501
+ Lint/UselessDefined: # new in 1.69
502
+ Enabled: true
503
+ Style/DigChain: # new in 1.69
504
+ Enabled: true
505
+ Style/FileNull: # new in 1.69
506
+ Enabled: true
507
+ Style/FileTouch: # new in 1.69
508
+ Enabled: true
509
+ Style/HashSlice: # new in 1.71
510
+ Enabled: true
511
+ Style/ItAssignment: # new in 1.70
512
+ Enabled: true
513
+ Style/RedundantFormat: # new in 1.72
514
+ Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocina-models (0.99.4)
4
+ cocina-models (0.101.0)
5
5
  activesupport
6
6
  deprecation
7
7
  dry-struct (~> 1.0)
@@ -19,7 +19,7 @@ PATH
19
19
  GEM
20
20
  remote: https://rubygems.org/
21
21
  specs:
22
- activesupport (8.0.1)
22
+ activesupport (8.0.2)
23
23
  base64
24
24
  benchmark (>= 0.3)
25
25
  bigdecimal
@@ -32,12 +32,12 @@ GEM
32
32
  securerandom (>= 0.3)
33
33
  tzinfo (~> 2.0, >= 2.0.5)
34
34
  uri (>= 0.13.1)
35
- ast (2.4.2)
35
+ ast (2.4.3)
36
36
  attr_extras (7.1.0)
37
37
  base64 (0.2.0)
38
38
  benchmark (0.4.0)
39
39
  bigdecimal (3.1.9)
40
- byebug (11.1.3)
40
+ byebug (12.0.0)
41
41
  committee (5.0.0)
42
42
  json_schema (~> 0.14, >= 0.14.3)
43
43
  openapi_parser (~> 1.0)
@@ -46,7 +46,7 @@ GEM
46
46
  connection_pool (2.5.0)
47
47
  deprecation (1.1.0)
48
48
  activesupport
49
- diff-lcs (1.5.1)
49
+ diff-lcs (1.6.1)
50
50
  docile (1.4.1)
51
51
  drb (2.2.1)
52
52
  dry-core (1.1.0)
@@ -59,7 +59,7 @@ GEM
59
59
  concurrent-ruby (~> 1.0)
60
60
  dry-core (~> 1.1)
61
61
  zeitwerk (~> 2.6)
62
- dry-struct (1.7.1)
62
+ dry-struct (1.8.0)
63
63
  dry-core (~> 1.1)
64
64
  dry-types (~> 1.8, >= 1.8.2)
65
65
  ice_nine (~> 0.11)
@@ -78,28 +78,30 @@ GEM
78
78
  i18n (1.14.7)
79
79
  concurrent-ruby (~> 1.0)
80
80
  ice_nine (0.11.2)
81
- json (2.9.1)
81
+ json (2.10.2)
82
82
  json_schema (0.21.0)
83
83
  jsonpath (1.1.5)
84
84
  multi_json
85
85
  language_server-protocol (3.17.0.4)
86
- logger (1.6.5)
86
+ lint_roller (1.1.0)
87
+ logger (1.7.0)
87
88
  mini_portile2 (2.8.8)
88
- minitest (5.25.4)
89
+ minitest (5.25.5)
89
90
  multi_json (1.15.0)
90
- nokogiri (1.18.2)
91
+ nokogiri (1.18.7)
91
92
  mini_portile2 (~> 2.8.2)
92
93
  racc (~> 1.4)
93
94
  openapi_parser (1.0.0)
94
- optimist (3.2.0)
95
+ optimist (3.2.1)
95
96
  parallel (1.26.3)
96
- parser (3.3.7.0)
97
+ parser (3.3.8.0)
97
98
  ast (~> 2.4.1)
98
99
  racc
99
100
  patience_diff (1.2.0)
100
101
  optimist (~> 3.0)
102
+ prism (1.4.0)
101
103
  racc (1.8.1)
102
- rack (3.1.9)
104
+ rack (3.1.13)
103
105
  rainbow (3.1.1)
104
106
  rake (13.2.1)
105
107
  regexp_parser (2.10.0)
@@ -107,7 +109,7 @@ GEM
107
109
  rspec-core (~> 3.13.0)
108
110
  rspec-expectations (~> 3.13.0)
109
111
  rspec-mocks (~> 3.13.0)
110
- rspec-core (3.13.2)
112
+ rspec-core (3.13.3)
111
113
  rspec-support (~> 3.13.0)
112
114
  rspec-expectations (3.13.3)
113
115
  diff-lcs (>= 1.2.0, < 2.0)
@@ -118,31 +120,26 @@ GEM
118
120
  rspec-support (3.13.2)
119
121
  rspec_junit_formatter (0.6.0)
120
122
  rspec-core (>= 2, < 4, != 2.12.0)
121
- rubocop (1.71.1)
123
+ rubocop (1.75.2)
122
124
  json (~> 2.3)
123
- language_server-protocol (>= 3.17.0)
125
+ language_server-protocol (~> 3.17.0.2)
126
+ lint_roller (~> 1.1.0)
124
127
  parallel (~> 1.10)
125
128
  parser (>= 3.3.0.2)
126
129
  rainbow (>= 2.2.2, < 4.0)
127
130
  regexp_parser (>= 2.9.3, < 3.0)
128
- rubocop-ast (>= 1.38.0, < 2.0)
131
+ rubocop-ast (>= 1.44.0, < 2.0)
129
132
  ruby-progressbar (~> 1.7)
130
133
  unicode-display_width (>= 2.4.0, < 4.0)
131
- rubocop-ast (1.38.0)
132
- parser (>= 3.3.1.0)
133
- rubocop-capybara (2.21.0)
134
- rubocop (~> 1.41)
135
- rubocop-factory_bot (2.26.1)
136
- rubocop (~> 1.61)
137
- rubocop-rake (0.6.0)
138
- rubocop (~> 1.0)
139
- rubocop-rspec (2.31.0)
140
- rubocop (~> 1.40)
141
- rubocop-capybara (~> 2.17)
142
- rubocop-factory_bot (~> 2.22)
143
- rubocop-rspec_rails (~> 2.28)
144
- rubocop-rspec_rails (2.29.1)
145
- rubocop (~> 1.61)
134
+ rubocop-ast (1.44.1)
135
+ parser (>= 3.3.7.2)
136
+ prism (~> 1.4)
137
+ rubocop-rake (0.7.1)
138
+ lint_roller (~> 1.1)
139
+ rubocop (>= 1.72.1)
140
+ rubocop-rspec (3.5.0)
141
+ lint_roller (~> 1.1)
142
+ rubocop (~> 1.72, >= 1.72.1)
146
143
  ruby-progressbar (1.13.0)
147
144
  securerandom (0.4.1)
148
145
  simplecov (0.22.0)
@@ -161,8 +158,8 @@ GEM
161
158
  unicode-display_width (3.1.4)
162
159
  unicode-emoji (~> 4.0, >= 4.0.4)
163
160
  unicode-emoji (4.0.4)
164
- uri (1.0.2)
165
- zeitwerk (2.7.1)
161
+ uri (1.0.3)
162
+ zeitwerk (2.7.2)
166
163
 
167
164
  PLATFORMS
168
165
  ruby
@@ -177,8 +174,8 @@ DEPENDENCIES
177
174
  rspec_junit_formatter
178
175
  rubocop (~> 1.24)
179
176
  rubocop-rake
180
- rubocop-rspec (~> 2.1)
177
+ rubocop-rspec
181
178
  simplecov
182
179
 
183
180
  BUNDLED WITH
184
- 2.4.13
181
+ 2.6.8
@@ -46,7 +46,7 @@ Gem::Specification.new do |spec|
46
46
  spec.add_development_dependency 'rspec', '~> 3.0'
47
47
  spec.add_development_dependency 'rubocop', '~> 1.24'
48
48
  spec.add_development_dependency 'rubocop-rake'
49
- spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
49
+ spec.add_development_dependency 'rubocop-rspec'
50
50
  spec.add_development_dependency 'simplecov'
51
51
  spec.metadata['rubygems_mfa_required'] = 'true'
52
52
  end
@@ -601,6 +601,8 @@ note.groupedValue:
601
601
  - value: title
602
602
  - value: text
603
603
  relatedResource:
604
+ - value: derived from
605
+ description: The source from which the resource was derived, such as a raw data set before processing.
604
606
  - value: has original version
605
607
  description: An initial form of the resource.
606
608
  - value: has other format
@@ -609,6 +611,8 @@ relatedResource:
609
611
  description: A constituent unit of the resource.
610
612
  - value: has version
611
613
  description: A version of the resource with different intellectual content.
614
+ - value: identical to
615
+ description: A version of the resource with the same content and format.
612
616
  - value: in series
613
617
  description: The name of a series of publications to which the resource belongs.
614
618
  - value: other relation type
@@ -625,8 +629,16 @@ relatedResource:
625
629
  description: A generically related resource.
626
630
  - value: reviewed by
627
631
  description: A review of the resource.
632
+ - value: source of
633
+ description: Additional materials derived from the resource, such as a processed data set.
628
634
  - value: succeeded by
629
635
  description: A successor to the resource, such as a subsequent journal title.
636
+ - value: supplemented by
637
+ description: An auxiliary supplement to the resource.
638
+ - value: supplement to
639
+ description: The primary object which the resource supplements.
640
+ - value: version of record
641
+ description: The version of the resource that is preferred for citation and reference.
630
642
  subject:
631
643
  - value: classification
632
644
  description: A coded reference to the main subjects of the resource according to a larger system.
@@ -55,6 +55,7 @@ _Path: contributor.type_
55
55
  _Path: contributor.identifier.type_
56
56
  * ORCID
57
57
  * Identifier from orcid.org.
58
+ * ROR
58
59
  * Wikidata
59
60
  * Identifier from wikidata.org.
60
61
  ## Contributor name types
@@ -576,6 +577,8 @@ _Path: note.groupedValue.type_
576
577
  * text
577
578
  # RelatedResource types
578
579
  _Path: relatedResource.type_
580
+ * derived from
581
+ * The source from which the resource was derived, such as a raw data set before processing.
579
582
  * has original version
580
583
  * An initial form of the resource.
581
584
  * has other format
@@ -584,6 +587,8 @@ _Path: relatedResource.type_
584
587
  * A constituent unit of the resource.
585
588
  * has version
586
589
  * A version of the resource with different intellectual content.
590
+ * identical to
591
+ * A version of the resource with the same content and format.
587
592
  * in series
588
593
  * The name of a series of publications to which the resource belongs.
589
594
  * other relation type
@@ -600,8 +605,16 @@ _Path: relatedResource.type_
600
605
  * A generically related resource.
601
606
  * reviewed by
602
607
  * A review of the resource.
608
+ * source of
609
+ * Additional materials derived from the resource, such as a processed data set.
603
610
  * succeeded by
604
611
  * A successor to the resource, such as a subsequent journal title.
612
+ * supplemented by
613
+ * An auxiliary supplement to the resource.
614
+ * supplement to
615
+ * The primary object which the resource supplements.
616
+ * version of record
617
+ * The version of the resource that is preferred for citation and reference.
605
618
  # Subject types
606
619
  _Path: subject.type_
607
620
  * classification
@@ -136,6 +136,7 @@ module Cocina
136
136
  version.rb
137
137
  vocabulary.rb
138
138
  ].freeze
139
+ private_constant :NO_CLEAN
139
140
 
140
141
  def clean_output
141
142
  FileUtils.mkdir_p(options[:output])
@@ -49,6 +49,7 @@ module Cocina
49
49
  'ObjectType' => BASE,
50
50
  'FileSetType' => "#{BASE}resources/"
51
51
  }.freeze
52
+ private_constant :BASE, :URIS
52
53
 
53
54
  def vocabs
54
55
  type_properties = schemas.values.map { |schema| schema.properties&.[]('type') }.compact
@@ -11,6 +11,10 @@ module Cocina
11
11
  attribute :refresh, Types::Strict::Bool.default(false)
12
12
  # Record identifier that is unique within the context of the linked record's catalog.
13
13
  attribute :catalogRecordId, MigratedFromSymphonyIdentifier | MigratedFromVoyagerIdentifier | CreatedInFolioIdentifier
14
+ # Label for use in display of serials via Folio record
15
+ attribute? :partLabel, Types::Strict::String
16
+ # Sorting information for use in display of serials via Folio record
17
+ attribute? :sortKey, Types::Strict::String
14
18
  end
15
19
  end
16
20
  end
@@ -178,6 +178,7 @@ module Cocina
178
178
  end
179
179
 
180
180
  XPATH_HAS_CONTENT_PREDICATE = '[string-length(normalize-space()) > 0]'
181
+ private_constant :XPATH_HAS_CONTENT_PREDICATE
181
182
 
182
183
  def build_copyright_notice_event(origin_info_node)
183
184
  date_nodes = origin_info_node.xpath("mods:copyrightDate#{XPATH_HAS_CONTENT_PREDICATE}",
@@ -51,14 +51,18 @@ module Cocina
51
51
  item[:displayLabel] = related_item['displayLabel']
52
52
  if related_item['type']
53
53
  item[:type] = normalized_type_for(related_item['type'])
54
- elsif related_item['otherType']
55
- item[:type] = 'related to'
56
- item[:note] ||= []
57
- item[:note] <<
58
- { type: 'other relation type', value: related_item['otherType'] }.tap do |note|
59
- note[:uri] = related_item['otherTypeURI'] if related_item['otherTypeURI']
60
- note[:source] = { value: related_item['otherTypeAuth'] } if related_item['otherTypeAuth']
61
- end
54
+ elsif (other_type = related_item['otherType'])
55
+ if Cocina::Models::Mapping::ToMods::RelatedResource::OTHER_TYPES.include?(other_type)
56
+ item[:type] = other_type
57
+ else
58
+ item[:type] = 'related to'
59
+ item[:note] ||= []
60
+ item[:note] <<
61
+ { type: 'other relation type', value: related_item['otherType'] }.tap do |note|
62
+ note[:uri] = related_item['otherTypeURI'] if related_item['otherTypeURI']
63
+ note[:source] = { value: related_item['otherTypeAuth'] } if related_item['otherTypeAuth']
64
+ end
65
+ end
62
66
  end
63
67
  end.compact
64
68
  end
@@ -56,6 +56,7 @@ module Cocina
56
56
  end
57
57
 
58
58
  LEGACY_EVENT_TYPES_2_TYPE = Cocina::Models::Mapping::FromMods::Event::LEGACY_EVENT_TYPES_2_TYPE
59
+ private_constant :LEGACY_EVENT_TYPES_2_TYPE
59
60
 
60
61
  # because eventType is a relatively new addition to the MODS schema, records converted from MARC to MODS prior
61
62
  # to its introduction used displayLabel as a stopgap measure, with certain values
@@ -22,6 +22,15 @@ module Cocina
22
22
  'succeeded by' => 'succeeding'
23
23
  }.freeze
24
24
 
25
+ OTHER_TYPES = [
26
+ 'supplement to',
27
+ 'supplemented by',
28
+ 'derived from',
29
+ 'source of',
30
+ 'version of record',
31
+ 'identical to'
32
+ ].freeze
33
+
25
34
  DETAIL_TYPES = {
26
35
  'location within source' => 'part',
27
36
  'volume' => 'volume',
@@ -85,7 +94,13 @@ module Cocina
85
94
 
86
95
  def attributes_for(related, other_type_note)
87
96
  {}.tap do |attrs|
88
- attrs[:type] = TYPES.fetch(related.type) if related.type
97
+ if related.type
98
+ if (mapped_type = TYPES[related.type])
99
+ attrs[:type] = mapped_type
100
+ elsif OTHER_TYPES.include?(related.type)
101
+ attrs[:otherType] = related.type
102
+ end
103
+ end
89
104
  attrs[:displayLabel] = related.displayLabel
90
105
 
91
106
  if other_type_note
@@ -21,6 +21,7 @@ module Cocina
21
21
 
22
22
  validate_catalog('symphony')
23
23
  validate_catalog('folio')
24
+ validate_sort_key
24
25
  end
25
26
 
26
27
  private
@@ -36,6 +37,17 @@ module Cocina
36
37
  "(only one allowed) #{refresh_catalog_links}"
37
38
  end
38
39
 
40
+ def validate_sort_key
41
+ # TODO: remove this validation once we upgrade to OpenAPI 3.1 and can use dependentRequired in openapi.yml
42
+ serials_links = catalog_links.select { |catalog_link| catalog_link[:catalog] == 'folio' && catalog_link[:sortKey].present? }
43
+ serials_links.each do |catalog_link|
44
+ # If partLabel is present, catalog_link is valid
45
+ next if catalog_link[:partLabel].present?
46
+
47
+ raise ValidationError, "partLabel must also be present if a sortKey is used in catalog link #{catalog_link}"
48
+ end
49
+ end
50
+
39
51
  def catalog_links
40
52
  @catalog_links ||= Array(attributes.dig(:identification, :catalogLinks))
41
53
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.99.4'
5
+ VERSION = '0.101.0'
6
6
  end
7
7
  end
data/openapi.yml CHANGED
@@ -1174,6 +1174,12 @@ components:
1174
1174
  - $ref: '#/components/schemas/MigratedFromSymphonyIdentifier'
1175
1175
  - $ref: '#/components/schemas/MigratedFromVoyagerIdentifier'
1176
1176
  - $ref: '#/components/schemas/CreatedInFolioIdentifier'
1177
+ partLabel:
1178
+ description: Label for use in display of serials via Folio record
1179
+ type: string
1180
+ sortKey:
1181
+ description: Sorting information for use in display of serials via Folio record
1182
+ type: string
1177
1183
  required:
1178
1184
  - catalog
1179
1185
  - catalogRecordId
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.99.4
4
+ version: 0.101.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-02-03 00:00:00.000000000 Z
10
+ date: 2025-04-15 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -280,16 +279,16 @@ dependencies:
280
279
  name: rubocop-rspec
281
280
  requirement: !ruby/object:Gem::Requirement
282
281
  requirements:
283
- - - "~>"
282
+ - - ">="
284
283
  - !ruby/object:Gem::Version
285
- version: '2.1'
284
+ version: '0'
286
285
  type: :development
287
286
  prerelease: false
288
287
  version_requirements: !ruby/object:Gem::Requirement
289
288
  requirements:
290
- - - "~>"
289
+ - - ">="
291
290
  - !ruby/object:Gem::Version
292
- version: '2.1'
291
+ version: '0'
293
292
  - !ruby/object:Gem::Dependency
294
293
  name: simplecov
295
294
  requirement: !ruby/object:Gem::Requirement
@@ -313,7 +312,6 @@ extensions: []
313
312
  extra_rdoc_files: []
314
313
  files:
315
314
  - ".circleci/config.yml"
316
- - ".codecov.yml"
317
315
  - ".github/pull_request_template.md"
318
316
  - ".gitignore"
319
317
  - ".rspec"
@@ -522,7 +520,6 @@ homepage: https://github.com/sul-dlss/cocina-models
522
520
  licenses: []
523
521
  metadata:
524
522
  rubygems_mfa_required: 'true'
525
- post_install_message:
526
523
  rdoc_options: []
527
524
  require_paths:
528
525
  - lib
@@ -537,8 +534,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
537
534
  - !ruby/object:Gem::Version
538
535
  version: '0'
539
536
  requirements: []
540
- rubygems_version: 3.5.11
541
- signing_key:
537
+ rubygems_version: 3.6.2
542
538
  specification_version: 4
543
539
  summary: Data models for the SDR
544
540
  test_files: []
data/.codecov.yml DELETED
@@ -1,4 +0,0 @@
1
- comment: false
2
- coverage:
3
- status:
4
- project: true