cocina-models 0.99.3 → 0.100.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -1
- data/Gemfile.lock +19 -19
- data/README.md +1 -2
- data/description_types.yml +14 -0
- data/docs/description_types.md +13 -0
- data/lib/cocina/models/mapping/from_mods/related_resource.rb +12 -8
- data/lib/cocina/models/mapping/to_mods/related_resource.rb +16 -1
- data/lib/cocina/models/version.rb +1 -1
- 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: bf0adcf9839eca5b38d5ea38c28b9ee8d853e0f5cdec7b35a2c8fee57e3081fd
|
4
|
+
data.tar.gz: 8824e1540a5d8eb2fca36f8afbeeb340f4b134385075af10dac74408c7e35598
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96f4f445895f8be40633be3caf07455fc72ac83fdf592996c38510faef3367c3c32b529f0a3c865385522833802e5e02a608b6918ec2a05905911d436f6a0d4b
|
7
|
+
data.tar.gz: ef3acb51f35dea27da4f6378d625a4872a07652bb4cd1a2f4d40162adc1b6d8682d86bc4253639dff56ef66abbd4513ea6ba810fbc34b49e6a8008280c399bfc
|
data/.circleci/config.yml
CHANGED
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.100.0)
|
5
5
|
activesupport
|
6
6
|
deprecation
|
7
7
|
dry-struct (~> 1.0)
|
@@ -42,8 +42,8 @@ GEM
|
|
42
42
|
json_schema (~> 0.14, >= 0.14.3)
|
43
43
|
openapi_parser (~> 1.0)
|
44
44
|
rack (>= 1.5)
|
45
|
-
concurrent-ruby (1.3.
|
46
|
-
connection_pool (2.
|
45
|
+
concurrent-ruby (1.3.5)
|
46
|
+
connection_pool (2.5.0)
|
47
47
|
deprecation (1.1.0)
|
48
48
|
activesupport
|
49
49
|
diff-lcs (1.5.1)
|
@@ -59,12 +59,12 @@ GEM
|
|
59
59
|
concurrent-ruby (~> 1.0)
|
60
60
|
dry-core (~> 1.1)
|
61
61
|
zeitwerk (~> 2.6)
|
62
|
-
dry-struct (1.
|
63
|
-
dry-core (~> 1.
|
64
|
-
dry-types (
|
62
|
+
dry-struct (1.7.1)
|
63
|
+
dry-core (~> 1.1)
|
64
|
+
dry-types (~> 1.8, >= 1.8.2)
|
65
65
|
ice_nine (~> 0.11)
|
66
66
|
zeitwerk (~> 2.6)
|
67
|
-
dry-types (1.
|
67
|
+
dry-types (1.8.2)
|
68
68
|
bigdecimal (~> 3.0)
|
69
69
|
concurrent-ruby (~> 1.0)
|
70
70
|
dry-core (~> 1.0)
|
@@ -75,31 +75,31 @@ GEM
|
|
75
75
|
activesupport (>= 3.0, < 9.0)
|
76
76
|
equivalent-xml (0.6.0)
|
77
77
|
nokogiri (>= 1.4.3)
|
78
|
-
i18n (1.14.
|
78
|
+
i18n (1.14.7)
|
79
79
|
concurrent-ruby (~> 1.0)
|
80
80
|
ice_nine (0.11.2)
|
81
81
|
json (2.9.1)
|
82
82
|
json_schema (0.21.0)
|
83
83
|
jsonpath (1.1.5)
|
84
84
|
multi_json
|
85
|
-
language_server-protocol (3.17.0.
|
86
|
-
logger (1.6.
|
85
|
+
language_server-protocol (3.17.0.4)
|
86
|
+
logger (1.6.5)
|
87
87
|
mini_portile2 (2.8.8)
|
88
88
|
minitest (5.25.4)
|
89
89
|
multi_json (1.15.0)
|
90
|
-
nokogiri (1.18.
|
90
|
+
nokogiri (1.18.2)
|
91
91
|
mini_portile2 (~> 2.8.2)
|
92
92
|
racc (~> 1.4)
|
93
93
|
openapi_parser (1.0.0)
|
94
94
|
optimist (3.2.0)
|
95
95
|
parallel (1.26.3)
|
96
|
-
parser (3.3.
|
96
|
+
parser (3.3.7.1)
|
97
97
|
ast (~> 2.4.1)
|
98
98
|
racc
|
99
99
|
patience_diff (1.2.0)
|
100
100
|
optimist (~> 3.0)
|
101
101
|
racc (1.8.1)
|
102
|
-
rack (3.1.
|
102
|
+
rack (3.1.9)
|
103
103
|
rainbow (3.1.1)
|
104
104
|
rake (13.2.1)
|
105
105
|
regexp_parser (2.10.0)
|
@@ -107,7 +107,7 @@ GEM
|
|
107
107
|
rspec-core (~> 3.13.0)
|
108
108
|
rspec-expectations (~> 3.13.0)
|
109
109
|
rspec-mocks (~> 3.13.0)
|
110
|
-
rspec-core (3.13.
|
110
|
+
rspec-core (3.13.3)
|
111
111
|
rspec-support (~> 3.13.0)
|
112
112
|
rspec-expectations (3.13.3)
|
113
113
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -118,17 +118,17 @@ GEM
|
|
118
118
|
rspec-support (3.13.2)
|
119
119
|
rspec_junit_formatter (0.6.0)
|
120
120
|
rspec-core (>= 2, < 4, != 2.12.0)
|
121
|
-
rubocop (1.
|
121
|
+
rubocop (1.71.2)
|
122
122
|
json (~> 2.3)
|
123
123
|
language_server-protocol (>= 3.17.0)
|
124
124
|
parallel (~> 1.10)
|
125
125
|
parser (>= 3.3.0.2)
|
126
126
|
rainbow (>= 2.2.2, < 4.0)
|
127
127
|
regexp_parser (>= 2.9.3, < 3.0)
|
128
|
-
rubocop-ast (>= 1.
|
128
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
129
129
|
ruby-progressbar (~> 1.7)
|
130
130
|
unicode-display_width (>= 2.4.0, < 4.0)
|
131
|
-
rubocop-ast (1.
|
131
|
+
rubocop-ast (1.38.0)
|
132
132
|
parser (>= 3.3.1.0)
|
133
133
|
rubocop-capybara (2.21.0)
|
134
134
|
rubocop (~> 1.41)
|
@@ -151,14 +151,14 @@ GEM
|
|
151
151
|
simplecov_json_formatter (~> 0.1)
|
152
152
|
simplecov-html (0.13.1)
|
153
153
|
simplecov_json_formatter (0.1.4)
|
154
|
-
super_diff (0.
|
154
|
+
super_diff (0.15.0)
|
155
155
|
attr_extras (>= 6.2.4)
|
156
156
|
diff-lcs
|
157
157
|
patience_diff
|
158
158
|
thor (1.3.2)
|
159
159
|
tzinfo (2.0.6)
|
160
160
|
concurrent-ruby (~> 1.0)
|
161
|
-
unicode-display_width (3.1.
|
161
|
+
unicode-display_width (3.1.4)
|
162
162
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
163
163
|
unicode-emoji (4.0.4)
|
164
164
|
uri (1.0.2)
|
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
[![CircleCI](https://circleci.com/gh/sul-dlss/cocina-models.svg?style=svg)](https://circleci.com/gh/sul-dlss/cocina-models)
|
2
|
-
[![Test Coverage](https://
|
3
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/472273351516ac01dce1/maintainability)](https://codeclimate.com/github/sul-dlss/cocina-models/maintainability)
|
2
|
+
[![Test Coverage](https://codecov.io/github/sul-dlss/cocina-models/graph/badge.svg?token=FG1SRYCME2)](https://codecov.io/github/sul-dlss/cocina-models)
|
4
3
|
[![Gem Version](https://badge.fury.io/rb/cocina-models.svg)](https://badge.fury.io/rb/cocina-models)
|
5
4
|
[![OpenAPI Validator](http://validator.swagger.io/validator?url=https://raw.githubusercontent.com/sul-dlss/cocina-models/main/openapi.yml)](http://validator.swagger.io/validator/debug?url=https://raw.githubusercontent.com/sul-dlss/cocina-models/main/openapi.yml)
|
6
5
|
|
data/description_types.yml
CHANGED
@@ -51,6 +51,8 @@ contributor:
|
|
51
51
|
contributor.identifier:
|
52
52
|
- value: ORCID
|
53
53
|
description: Identifier from orcid.org.
|
54
|
+
- value: ROR
|
55
|
+
code: ror
|
54
56
|
- value: Wikidata
|
55
57
|
description: Identifier from wikidata.org.
|
56
58
|
contributor.name:
|
@@ -599,6 +601,8 @@ note.groupedValue:
|
|
599
601
|
- value: title
|
600
602
|
- value: text
|
601
603
|
relatedResource:
|
604
|
+
- value: derived from
|
605
|
+
description: The source from which the resource was derived, such as a raw data set before processing.
|
602
606
|
- value: has original version
|
603
607
|
description: An initial form of the resource.
|
604
608
|
- value: has other format
|
@@ -607,6 +611,8 @@ relatedResource:
|
|
607
611
|
description: A constituent unit of the resource.
|
608
612
|
- value: has version
|
609
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.
|
610
616
|
- value: in series
|
611
617
|
description: The name of a series of publications to which the resource belongs.
|
612
618
|
- value: other relation type
|
@@ -623,8 +629,16 @@ relatedResource:
|
|
623
629
|
description: A generically related resource.
|
624
630
|
- value: reviewed by
|
625
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.
|
626
634
|
- value: succeeded by
|
627
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.
|
628
642
|
subject:
|
629
643
|
- value: classification
|
630
644
|
description: A coded reference to the main subjects of the resource according to a larger system.
|
data/docs/description_types.md
CHANGED
@@ -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
|
@@ -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
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
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
|
@@ -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
|
-
|
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
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocina-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.100.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -536,7 +536,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
536
536
|
- !ruby/object:Gem::Version
|
537
537
|
version: '0'
|
538
538
|
requirements: []
|
539
|
-
rubygems_version: 3.5.
|
539
|
+
rubygems_version: 3.5.11
|
540
540
|
signing_key:
|
541
541
|
specification_version: 4
|
542
542
|
summary: Data models for the SDR
|