cocina-models 0.88.0 → 0.89.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/lib/cocina/generator/datatype.rb +13 -3
- data/lib/cocina/generator/generator.rb +0 -1
- data/lib/cocina/models/admin_policy_access_template.rb +16 -14
- data/lib/cocina/models/business_barcode.rb +1 -3
- data/lib/cocina/models/catkey_barcode.rb +1 -3
- data/lib/cocina/models/cocina_version.rb +1 -3
- data/lib/cocina/models/collection_access.rb +4 -4
- data/lib/cocina/models/copyright.rb +7 -0
- data/lib/cocina/models/created_in_folio_identifier.rb +1 -3
- data/lib/cocina/models/doi_exceptions.rb +1 -3
- data/lib/cocina/models/doi_pattern.rb +1 -3
- data/lib/cocina/models/dro_access.rb +3 -3
- data/lib/cocina/models/druid.rb +1 -3
- data/lib/cocina/models/embargo.rb +3 -3
- data/lib/cocina/models/folio_catalog_link.rb +1 -1
- data/lib/cocina/models/lane_medical_barcode.rb +1 -3
- data/lib/cocina/models/license.rb +1 -4
- data/lib/cocina/models/migrated_from_symphony_identifier.rb +1 -3
- data/lib/cocina/models/migrated_from_voyager_identifier.rb +1 -3
- data/lib/cocina/models/purl.rb +1 -3
- data/lib/cocina/models/source_id.rb +1 -3
- data/lib/cocina/models/standard_barcode.rb +1 -3
- data/lib/cocina/models/use_and_reproduction_statement.rb +7 -0
- data/lib/cocina/models/version.rb +1 -1
- data/lib/cocina/rspec/factories.rb +12 -2
- data/openapi.yml +67 -111
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0dbfb214630511f046a824a0f6774e203db38bcef1c7af9dc6118932148caa4
|
4
|
+
data.tar.gz: d087a39d4cb3270cd01d8fc77beb0c053a45431867c47570715c09fc0868e856
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b083699765ee6bd9715ff5fe575ca994220ebb7f1d8ec9e7526b15f2af320c8c99b7c85cabb843e00027f37fddf68a50cf91b2c2e7513b8cdc82e5cd16a70bfe
|
7
|
+
data.tar.gz: f3d50447698ba52af5d8f71565cd77235970f318ba78105de1e88dc4bd23134d9e826d167ad745adfd3aeeb0d2add3bf854fad0f713f512984188b5e9ea355c3
|
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.89.1)
|
5
5
|
activesupport
|
6
6
|
deprecation
|
7
7
|
dry-struct (~> 1.0)
|
@@ -33,7 +33,7 @@ GEM
|
|
33
33
|
openapi_parser (>= 0.11.1, < 1.0)
|
34
34
|
rack (>= 1.5)
|
35
35
|
commonmarker (0.23.8)
|
36
|
-
concurrent-ruby (1.2.
|
36
|
+
concurrent-ruby (1.2.2)
|
37
37
|
deprecation (1.1.0)
|
38
38
|
activesupport
|
39
39
|
diff-lcs (1.5.0)
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
jsonpath (1.1.2)
|
70
70
|
multi_json
|
71
71
|
mini_portile2 (2.8.1)
|
72
|
-
minitest (5.
|
72
|
+
minitest (5.18.0)
|
73
73
|
multi_json (1.15.0)
|
74
74
|
nokogiri (1.14.2)
|
75
75
|
mini_portile2 (~> 2.8.0)
|
@@ -84,7 +84,7 @@ GEM
|
|
84
84
|
patience_diff (1.2.0)
|
85
85
|
optimist (~> 3.0)
|
86
86
|
racc (1.6.2)
|
87
|
-
rack (3.0.4.
|
87
|
+
rack (3.0.4.2)
|
88
88
|
rainbow (3.1.1)
|
89
89
|
rake (13.0.6)
|
90
90
|
regexp_parser (2.7.0)
|
@@ -106,17 +106,17 @@ GEM
|
|
106
106
|
rspec-core (>= 2, < 4, != 2.12.0)
|
107
107
|
rss (0.2.9)
|
108
108
|
rexml
|
109
|
-
rubocop (1.
|
109
|
+
rubocop (1.48.0)
|
110
110
|
json (~> 2.3)
|
111
111
|
parallel (~> 1.10)
|
112
112
|
parser (>= 3.2.0.0)
|
113
113
|
rainbow (>= 2.2.2, < 4.0)
|
114
114
|
regexp_parser (>= 1.8, < 3.0)
|
115
115
|
rexml (>= 3.2.5, < 4.0)
|
116
|
-
rubocop-ast (>= 1.
|
116
|
+
rubocop-ast (>= 1.26.0, < 2.0)
|
117
117
|
ruby-progressbar (~> 1.7)
|
118
118
|
unicode-display_width (>= 2.4.0, < 3.0)
|
119
|
-
rubocop-ast (1.
|
119
|
+
rubocop-ast (1.27.0)
|
120
120
|
parser (>= 3.2.1.0)
|
121
121
|
rubocop-capybara (2.17.1)
|
122
122
|
rubocop (~> 1.41)
|
@@ -125,7 +125,7 @@ GEM
|
|
125
125
|
rubocop-rspec (2.18.1)
|
126
126
|
rubocop (~> 1.33)
|
127
127
|
rubocop-capybara (~> 2.17)
|
128
|
-
ruby-progressbar (1.
|
128
|
+
ruby-progressbar (1.13.0)
|
129
129
|
simplecov (0.22.0)
|
130
130
|
docile (~> 1.1)
|
131
131
|
simplecov-html (~> 0.11)
|
@@ -10,13 +10,23 @@ module Cocina
|
|
10
10
|
|
11
11
|
module Cocina
|
12
12
|
module Models
|
13
|
-
#{name} = Types::String
|
14
|
-
format: /#{schema_doc.pattern}/
|
15
|
-
)
|
13
|
+
#{name} = Types::String#{pattern}#{enum}
|
16
14
|
end
|
17
15
|
end
|
18
16
|
RUBY
|
19
17
|
end
|
18
|
+
|
19
|
+
def pattern
|
20
|
+
return unless schema_doc.pattern
|
21
|
+
|
22
|
+
".constrained(format: /#{schema_doc.pattern}/)"
|
23
|
+
end
|
24
|
+
|
25
|
+
def enum
|
26
|
+
return unless schema_doc.enum
|
27
|
+
|
28
|
+
".enum(#{schema_doc.enum.map { |item| quote(item) }.join(', ')})"
|
29
|
+
end
|
20
30
|
end
|
21
31
|
end
|
22
32
|
end
|
@@ -2,25 +2,27 @@
|
|
2
2
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
|
-
# Provides the template of access settings that is copied to the items
|
5
|
+
# Provides the template of access settings that is copied to the items governed by an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.
|
6
6
|
class AdminPolicyAccessTemplate < Struct
|
7
|
-
attribute? :view, Types::Strict::String.enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
|
8
|
-
# Available for controlled digital lending.
|
9
|
-
attribute? :controlledDigitalLending, Types::Strict::Bool.default(false)
|
10
7
|
# The human readable copyright statement that applies
|
11
8
|
# example: Copyright World Trade Organization
|
12
|
-
attribute? :copyright,
|
13
|
-
# Download access level. This is used in the transition from Fedora as a way to set a default download level at registration that is copied down to all the files.
|
14
|
-
|
15
|
-
attribute? :download, Types::Strict::String.enum('world', 'stanford', 'location-based', 'none')
|
16
|
-
# If access or download is "location-based", this indicates which location should have access. This is used in the transition from Fedora as a way to set a default location at registration that is copied down to all the files.
|
17
|
-
|
18
|
-
attribute? :location, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m')
|
9
|
+
attribute? :copyright, Copyright.optional
|
19
10
|
# The human readable use and reproduction statement that applies
|
20
11
|
# example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
|
21
|
-
attribute? :useAndReproductionStatement,
|
22
|
-
# The license governing reuse of the
|
23
|
-
attribute? :license,
|
12
|
+
attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
|
13
|
+
# The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
|
14
|
+
attribute? :license, License.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
|
15
|
+
# Access level.
|
16
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
17
|
+
attribute? :view, Types::Strict::String.optional.default('dark')
|
18
|
+
# Download access level.
|
19
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
20
|
+
attribute? :download, Types::Strict::String.optional.default('none')
|
21
|
+
# Not used for this access type, must be null.
|
22
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
23
|
+
attribute? :location, Types::Strict::String.optional
|
24
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
25
|
+
attribute? :controlledDigitalLending, Types::Strict::Bool.optional.default(false)
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -8,12 +8,12 @@ module Cocina
|
|
8
8
|
attribute? :view, Types::Strict::String.default('dark').enum('world', 'dark')
|
9
9
|
# The human readable copyright statement that applies
|
10
10
|
# example: Copyright World Trade Organization
|
11
|
-
attribute? :copyright,
|
11
|
+
attribute? :copyright, Copyright.optional
|
12
12
|
# The human readable use and reproduction statement that applies
|
13
13
|
# example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
|
14
|
-
attribute? :useAndReproductionStatement,
|
15
|
-
# The license governing reuse of the
|
16
|
-
attribute? :license,
|
14
|
+
attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
|
15
|
+
# The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
|
16
|
+
attribute? :license, License.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
|
-
DoiExceptions = Types::String.constrained(
|
6
|
-
format: %r{^10\.(25740/([vV][aA]90-[cC][tT]15|[sS][yY][xX][aA]-[mM]256|12[qQ][fF]-5243|65[jJ]8-6114)|25936/629[tT]-[bB][xX]79)$}
|
7
|
-
)
|
5
|
+
DoiExceptions = Types::String.constrained(format: %r{^10\.(25740/([vV][aA]90-[cC][tT]15|[sS][yY][xX][aA]-[mM]256|12[qQ][fF]-5243|65[jJ]8-6114)|25936/629[tT]-[bB][xX]79)$})
|
8
6
|
end
|
9
7
|
end
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
|
-
DoiPattern = Types::String.constrained(
|
6
|
-
format: %r{^10\.(25740|80343)/[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$}
|
7
|
-
)
|
5
|
+
DoiPattern = Types::String.constrained(format: %r{^10\.(25740|80343)/[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$})
|
8
6
|
end
|
9
7
|
end
|
@@ -16,13 +16,13 @@ module Cocina
|
|
16
16
|
attribute? :controlledDigitalLending, Types::Strict::Bool.optional.default(false)
|
17
17
|
# The human readable copyright statement that applies
|
18
18
|
# example: Copyright World Trade Organization
|
19
|
-
attribute? :copyright,
|
19
|
+
attribute? :copyright, Copyright.optional
|
20
20
|
attribute? :embargo, Embargo.optional
|
21
21
|
# The human readable use and reproduction statement that applies
|
22
22
|
# example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
|
23
|
-
attribute? :useAndReproductionStatement,
|
23
|
+
attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
|
24
24
|
# The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
|
25
|
-
attribute? :license,
|
25
|
+
attribute? :license, License.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/lib/cocina/models/druid.rb
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
|
-
Druid = Types::String.constrained(
|
6
|
-
format: /^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$/
|
7
|
-
)
|
5
|
+
Druid = Types::String.constrained(format: /^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$/)
|
8
6
|
end
|
9
7
|
end
|
@@ -17,9 +17,9 @@ module Cocina
|
|
17
17
|
# Date when the Collection is released from an embargo.
|
18
18
|
# example: 2029-06-22T07:00:00.000+00:00
|
19
19
|
attribute :releaseDate, Types::Params::DateTime
|
20
|
-
# The human readable use and reproduction statement that applies
|
21
|
-
# example:
|
22
|
-
attribute? :useAndReproductionStatement,
|
20
|
+
# The human readable use and reproduction statement that applies
|
21
|
+
# example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
|
22
|
+
attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -7,7 +7,7 @@ module Cocina
|
|
7
7
|
# Catalog that is the source of the linked record.
|
8
8
|
# example: folio
|
9
9
|
attribute :catalog, Types::Strict::String.enum('folio', 'previous folio')
|
10
|
-
# Only one of the
|
10
|
+
# Only one of the Folio instance HRIDs should be designated for refreshing. This means that this HRID is the one used to pull metadata from the catalog if there is more than one HRID present.
|
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
|
@@ -2,9 +2,6 @@
|
|
2
2
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
|
-
|
6
|
-
class License < Vocabulary('https://cocina.sul.stanford.edu/licenses/')
|
7
|
-
property :none
|
8
|
-
end
|
5
|
+
License = Types::String.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
|
9
6
|
end
|
10
7
|
end
|
data/lib/cocina/models/purl.rb
CHANGED
@@ -90,7 +90,7 @@ module Cocina
|
|
90
90
|
|
91
91
|
# rubocop:disable Metrics/ParameterLists
|
92
92
|
def self.build_request_dro_properties(type:, version:, label:, title:, source_id:, admin_policy_id:,
|
93
|
-
barcode: nil, catkeys: [], collection_ids: [])
|
93
|
+
barcode: nil, catkeys: [], folio_instance_hrids: [], collection_ids: [])
|
94
94
|
{
|
95
95
|
type: type,
|
96
96
|
version: version,
|
@@ -112,6 +112,11 @@ module Cocina
|
|
112
112
|
{ catalog: 'symphony', catalogRecordId: catkey, refresh: index.zero? }
|
113
113
|
end
|
114
114
|
end
|
115
|
+
if folio_instance_hrids.present?
|
116
|
+
props[:identification][:catalogLinks] = folio_instance_hrids.map.with_index do |folio_id, index|
|
117
|
+
{ catalog: 'folio', catalogRecordId: folio_id, refresh: index.zero? }
|
118
|
+
end
|
119
|
+
end
|
115
120
|
props[:identification][:barcode] = barcode if barcode
|
116
121
|
end
|
117
122
|
end
|
@@ -130,7 +135,7 @@ module Cocina
|
|
130
135
|
end
|
131
136
|
|
132
137
|
# rubocop:disable Metrics/ParameterLists
|
133
|
-
def self.build_request_collection_properties(type:, version:, label:, title:, admin_policy_id:, source_id: nil, catkeys: [])
|
138
|
+
def self.build_request_collection_properties(type:, version:, label:, title:, admin_policy_id:, source_id: nil, catkeys: [], folio_instance_hrids: [])
|
134
139
|
{
|
135
140
|
type: type,
|
136
141
|
version: version,
|
@@ -147,6 +152,11 @@ module Cocina
|
|
147
152
|
{ catalog: 'symphony', catalogRecordId: catkey, refresh: index.zero? }
|
148
153
|
end
|
149
154
|
end
|
155
|
+
if folio_instance_hrids.present?
|
156
|
+
props[:identification][:catalogLinks] = folio_instance_hrids.map.with_index do |folio_id, index|
|
157
|
+
{ catalog: 'folio', catalogRecordId: folio_id, refresh: index.zero? }
|
158
|
+
end
|
159
|
+
end
|
150
160
|
props[:identification][:sourceId] = source_id if source_id
|
151
161
|
end
|
152
162
|
end
|
data/openapi.yml
CHANGED
@@ -237,63 +237,24 @@ components:
|
|
237
237
|
required:
|
238
238
|
- hasAdminPolicy
|
239
239
|
AdminPolicyAccessTemplate:
|
240
|
-
description: 'Provides the template of access settings that is copied to the items
|
240
|
+
description: 'Provides the template of access settings that is copied to the items governed by an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.'
|
241
241
|
type: object
|
242
242
|
additionalProperties: false
|
243
|
+
oneOf:
|
244
|
+
- $ref: '#/components/schemas/DarkAccess'
|
245
|
+
- $ref: '#/components/schemas/CitationOnlyAccess'
|
246
|
+
- $ref: '#/components/schemas/ControlledDigitalLendingAccess'
|
247
|
+
- $ref: '#/components/schemas/LocationBasedAccess'
|
248
|
+
- $ref: '#/components/schemas/LocationBasedDownloadAccess'
|
249
|
+
- $ref: '#/components/schemas/StanfordAccess'
|
250
|
+
- $ref: '#/components/schemas/WorldAccess'
|
243
251
|
properties:
|
244
|
-
view:
|
245
|
-
type: string
|
246
|
-
enum:
|
247
|
-
- 'world'
|
248
|
-
- 'stanford'
|
249
|
-
- 'location-based'
|
250
|
-
- 'citation-only'
|
251
|
-
- 'dark'
|
252
|
-
controlledDigitalLending:
|
253
|
-
description: Available for controlled digital lending.
|
254
|
-
type: boolean
|
255
252
|
copyright:
|
256
|
-
|
257
|
-
example: Copyright World Trade Organization
|
258
|
-
type: string
|
259
|
-
nullable: true
|
260
|
-
download:
|
261
|
-
description: >
|
262
|
-
Download access level. This is used in the transition from Fedora as
|
263
|
-
a way to set a default download level at registration that is copied
|
264
|
-
down to all the files.
|
265
|
-
|
266
|
-
type: string
|
267
|
-
enum:
|
268
|
-
- 'world'
|
269
|
-
- 'stanford'
|
270
|
-
- 'location-based'
|
271
|
-
- 'none'
|
272
|
-
location:
|
273
|
-
description: >
|
274
|
-
If access or download is "location-based", this indicates which
|
275
|
-
location should have access. This is used in the transition from
|
276
|
-
Fedora as a way to set a default location at registration that is
|
277
|
-
copied down to all the files.
|
278
|
-
|
279
|
-
type: string
|
280
|
-
nullable: true
|
281
|
-
enum:
|
282
|
-
- 'spec'
|
283
|
-
- 'music'
|
284
|
-
- 'ars'
|
285
|
-
- 'art'
|
286
|
-
- 'hoover'
|
287
|
-
- 'm&m'
|
253
|
+
$ref: "#/components/schemas/Copyright"
|
288
254
|
useAndReproductionStatement:
|
289
|
-
|
290
|
-
example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
|
291
|
-
type: string
|
292
|
-
nullable: true
|
255
|
+
$ref: "#/components/schemas/UseAndReproductionStatement"
|
293
256
|
license:
|
294
|
-
|
295
|
-
type: string
|
296
|
-
nullable: true
|
257
|
+
$ref: "#/components/schemas/License"
|
297
258
|
AdminPolicyAdministrative:
|
298
259
|
description: Administrative properties for an AdminPolicy
|
299
260
|
type: object
|
@@ -455,19 +416,11 @@ components:
|
|
455
416
|
- 'dark'
|
456
417
|
default: 'dark'
|
457
418
|
copyright:
|
458
|
-
|
459
|
-
example: Copyright World Trade Organization
|
460
|
-
type: string
|
461
|
-
nullable: true
|
419
|
+
$ref: "#/components/schemas/Copyright"
|
462
420
|
useAndReproductionStatement:
|
463
|
-
|
464
|
-
example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
|
465
|
-
type: string
|
466
|
-
nullable: true
|
421
|
+
$ref: "#/components/schemas/UseAndReproductionStatement"
|
467
422
|
license:
|
468
|
-
|
469
|
-
type: string
|
470
|
-
nullable: true
|
423
|
+
$ref: "#/components/schemas/License"
|
471
424
|
CollectionIdentification:
|
472
425
|
type: object
|
473
426
|
additionalProperties: false
|
@@ -554,6 +507,11 @@ components:
|
|
554
507
|
required:
|
555
508
|
- view
|
556
509
|
- download
|
510
|
+
Copyright:
|
511
|
+
description: The human readable copyright statement that applies
|
512
|
+
example: Copyright World Trade Organization
|
513
|
+
type: string
|
514
|
+
nullable: true
|
557
515
|
CreatedInFolioIdentifier:
|
558
516
|
description: A record identifier created in Folio
|
559
517
|
type: string
|
@@ -629,52 +587,13 @@ components:
|
|
629
587
|
- type: object
|
630
588
|
properties:
|
631
589
|
copyright:
|
632
|
-
|
633
|
-
example: Copyright World Trade Organization
|
634
|
-
type: string
|
635
|
-
nullable: true
|
590
|
+
$ref: "#/components/schemas/Copyright"
|
636
591
|
embargo:
|
637
592
|
$ref: '#/components/schemas/Embargo'
|
638
593
|
useAndReproductionStatement:
|
639
|
-
|
640
|
-
example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
|
641
|
-
type: string
|
642
|
-
nullable: true
|
594
|
+
$ref: "#/components/schemas/UseAndReproductionStatement"
|
643
595
|
license:
|
644
|
-
|
645
|
-
type: string
|
646
|
-
nullable: true
|
647
|
-
enum:
|
648
|
-
- 'https://www.gnu.org/licenses/agpl.txt'
|
649
|
-
- 'https://www.apache.org/licenses/LICENSE-2.0'
|
650
|
-
- 'https://opensource.org/licenses/BSD-2-Clause'
|
651
|
-
- 'https://opensource.org/licenses/BSD-3-Clause'
|
652
|
-
- 'https://creativecommons.org/licenses/by/4.0/legalcode'
|
653
|
-
- 'https://creativecommons.org/licenses/by-nc/4.0/legalcode'
|
654
|
-
- 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode'
|
655
|
-
- 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode'
|
656
|
-
- 'https://creativecommons.org/licenses/by-nd/4.0/legalcode'
|
657
|
-
- 'https://creativecommons.org/licenses/by-sa/4.0/legalcode'
|
658
|
-
- 'https://creativecommons.org/publicdomain/zero/1.0/legalcode'
|
659
|
-
- 'https://opensource.org/licenses/cddl1'
|
660
|
-
- 'https://www.eclipse.org/legal/epl-2.0'
|
661
|
-
- 'https://www.gnu.org/licenses/gpl-3.0-standalone.html'
|
662
|
-
- 'https://www.isc.org/downloads/software-support-policy/isc-license/'
|
663
|
-
- 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html'
|
664
|
-
- 'https://opensource.org/licenses/MIT'
|
665
|
-
- 'https://www.mozilla.org/MPL/2.0/'
|
666
|
-
- 'https://opendatacommons.org/licenses/by/1-0/'
|
667
|
-
- 'http://opendatacommons.org/licenses/odbl/1.0/' # Non cannonical, but in some of our data
|
668
|
-
- 'https://opendatacommons.org/licenses/odbl/1-0/'
|
669
|
-
- 'https://creativecommons.org/publicdomain/mark/1.0/'
|
670
|
-
- 'https://opendatacommons.org/licenses/pddl/1-0/'
|
671
|
-
- 'https://creativecommons.org/licenses/by/3.0/legalcode'
|
672
|
-
- 'https://creativecommons.org/licenses/by-sa/3.0/legalcode'
|
673
|
-
- 'https://creativecommons.org/licenses/by-nd/3.0/legalcode'
|
674
|
-
- 'https://creativecommons.org/licenses/by-nc/3.0/legalcode'
|
675
|
-
- 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode'
|
676
|
-
- 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode'
|
677
|
-
- 'https://cocina.sul.stanford.edu/licenses/none' # Only used in some legacy ETDs and not actually permitted per the Project Chimera docs.
|
596
|
+
$ref: "#/components/schemas/License"
|
678
597
|
DROStructural:
|
679
598
|
description: Structural metadata
|
680
599
|
type: object
|
@@ -1046,10 +965,7 @@ components:
|
|
1046
965
|
format: date-time
|
1047
966
|
example: '2029-06-22T07:00:00.000+00:00'
|
1048
967
|
useAndReproductionStatement:
|
1049
|
-
|
1050
|
-
example: These materials are in the public domain.
|
1051
|
-
type: string
|
1052
|
-
nullable: true
|
968
|
+
$ref: "#/components/schemas/UseAndReproductionStatement"
|
1053
969
|
required:
|
1054
970
|
- releaseDate
|
1055
971
|
Event:
|
@@ -1242,9 +1158,9 @@ components:
|
|
1242
1158
|
- previous folio
|
1243
1159
|
example: folio
|
1244
1160
|
refresh:
|
1245
|
-
description: Only one of the
|
1246
|
-
This means that this
|
1247
|
-
if there is more than one
|
1161
|
+
description: Only one of the Folio instance HRIDs should be designated for refreshing.
|
1162
|
+
This means that this HRID is the one used to pull metadata from the catalog
|
1163
|
+
if there is more than one HRID present.
|
1248
1164
|
type: boolean
|
1249
1165
|
default: false
|
1250
1166
|
catalogRecordId:
|
@@ -1357,6 +1273,41 @@ components:
|
|
1357
1273
|
valueLanguage:
|
1358
1274
|
# description: present for mapping to additional schemas in the future and for consistency but not otherwise used
|
1359
1275
|
$ref: "#/components/schemas/DescriptiveValueLanguage"
|
1276
|
+
License:
|
1277
|
+
description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
|
1278
|
+
type: string
|
1279
|
+
nullable: true
|
1280
|
+
enum:
|
1281
|
+
- 'https://www.gnu.org/licenses/agpl.txt'
|
1282
|
+
- 'https://www.apache.org/licenses/LICENSE-2.0'
|
1283
|
+
- 'https://opensource.org/licenses/BSD-2-Clause'
|
1284
|
+
- 'https://opensource.org/licenses/BSD-3-Clause'
|
1285
|
+
- 'https://creativecommons.org/licenses/by/4.0/legalcode'
|
1286
|
+
- 'https://creativecommons.org/licenses/by-nc/4.0/legalcode'
|
1287
|
+
- 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode'
|
1288
|
+
- 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode'
|
1289
|
+
- 'https://creativecommons.org/licenses/by-nd/4.0/legalcode'
|
1290
|
+
- 'https://creativecommons.org/licenses/by-sa/4.0/legalcode'
|
1291
|
+
- 'https://creativecommons.org/publicdomain/zero/1.0/legalcode'
|
1292
|
+
- 'https://opensource.org/licenses/cddl1'
|
1293
|
+
- 'https://www.eclipse.org/legal/epl-2.0'
|
1294
|
+
- 'https://www.gnu.org/licenses/gpl-3.0-standalone.html'
|
1295
|
+
- 'https://www.isc.org/downloads/software-support-policy/isc-license/'
|
1296
|
+
- 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html'
|
1297
|
+
- 'https://opensource.org/licenses/MIT'
|
1298
|
+
- 'https://www.mozilla.org/MPL/2.0/'
|
1299
|
+
- 'https://opendatacommons.org/licenses/by/1-0/'
|
1300
|
+
- 'http://opendatacommons.org/licenses/odbl/1.0/' # Non cannonical, but in some of our data
|
1301
|
+
- 'https://opendatacommons.org/licenses/odbl/1-0/'
|
1302
|
+
- 'https://creativecommons.org/publicdomain/mark/1.0/'
|
1303
|
+
- 'https://opendatacommons.org/licenses/pddl/1-0/'
|
1304
|
+
- 'https://creativecommons.org/licenses/by/3.0/legalcode'
|
1305
|
+
- 'https://creativecommons.org/licenses/by-sa/3.0/legalcode'
|
1306
|
+
- 'https://creativecommons.org/licenses/by-nd/3.0/legalcode'
|
1307
|
+
- 'https://creativecommons.org/licenses/by-nc/3.0/legalcode'
|
1308
|
+
- 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode'
|
1309
|
+
- 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode'
|
1310
|
+
- 'https://cocina.sul.stanford.edu/licenses/none' # Only used in some legacy ETDs and not actually permitted per the Project Chimera docs.
|
1360
1311
|
LocationBasedAccess:
|
1361
1312
|
type: object
|
1362
1313
|
properties:
|
@@ -2068,6 +2019,11 @@ components:
|
|
2068
2019
|
- type: object
|
2069
2020
|
required:
|
2070
2021
|
- valueAt
|
2022
|
+
UseAndReproductionStatement:
|
2023
|
+
description: The human readable use and reproduction statement that applies
|
2024
|
+
example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
|
2025
|
+
type: string
|
2026
|
+
nullable: true
|
2071
2027
|
WorldAccess:
|
2072
2028
|
type: object
|
2073
2029
|
properties:
|
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.89.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -387,6 +387,7 @@ files:
|
|
387
387
|
- lib/cocina/models/collection_with_metadata.rb
|
388
388
|
- lib/cocina/models/contributor.rb
|
389
389
|
- lib/cocina/models/controlled_digital_lending_access.rb
|
390
|
+
- lib/cocina/models/copyright.rb
|
390
391
|
- lib/cocina/models/created_in_folio_identifier.rb
|
391
392
|
- lib/cocina/models/dark_access.rb
|
392
393
|
- lib/cocina/models/description.rb
|
@@ -510,6 +511,7 @@ files:
|
|
510
511
|
- lib/cocina/models/stanford_access.rb
|
511
512
|
- lib/cocina/models/symphony_catalog_link.rb
|
512
513
|
- lib/cocina/models/title.rb
|
514
|
+
- lib/cocina/models/use_and_reproduction_statement.rb
|
513
515
|
- lib/cocina/models/validatable.rb
|
514
516
|
- lib/cocina/models/validators/associated_name_validator.rb
|
515
517
|
- lib/cocina/models/validators/catalog_links_validator.rb
|
@@ -531,7 +533,7 @@ homepage: https://github.com/sul-dlss/cocina-models
|
|
531
533
|
licenses: []
|
532
534
|
metadata:
|
533
535
|
rubygems_mfa_required: 'true'
|
534
|
-
post_install_message:
|
536
|
+
post_install_message:
|
535
537
|
rdoc_options: []
|
536
538
|
require_paths:
|
537
539
|
- lib
|
@@ -547,7 +549,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
547
549
|
version: '0'
|
548
550
|
requirements: []
|
549
551
|
rubygems_version: 3.3.7
|
550
|
-
signing_key:
|
552
|
+
signing_key:
|
551
553
|
specification_version: 4
|
552
554
|
summary: Data models for the SDR
|
553
555
|
test_files: []
|