cocina-models 0.87.1 → 0.89.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 +4 -4
- data/Gemfile.lock +9 -9
- 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/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/validators/catalog_links_validator.rb +17 -6
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +64 -108
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6350dbb0cb127ef0fffb8a31e84c622bd0a6ed1a93d8a8fbed44462f1749b1c3
|
4
|
+
data.tar.gz: fcdfede93a6ae1c22f6b322513ef8b30f0474f7ad9aae9f9601711faf22903c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee21ac69b1e00d6ae0de058bda4c3b32905566804635221e60d51ab011db0c49a22d7f166f919b8327ba32b68423a11e9020bc746d122e127504475c163c9a38
|
7
|
+
data.tar.gz: d4e3e69934c64064279a4f16af8c7e1e3d0cd05623f357c891a5c9c6e462338efd51a1799c4d23aa06feda2b8ba56738949f548caaf21724dbad4f5c2c16c6f6
|
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.0)
|
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)
|
@@ -51,11 +51,11 @@ GEM
|
|
51
51
|
dry-types (>= 1.7, < 2)
|
52
52
|
ice_nine (~> 0.11)
|
53
53
|
zeitwerk (~> 2.6)
|
54
|
-
dry-types (1.7.
|
54
|
+
dry-types (1.7.1)
|
55
55
|
concurrent-ruby (~> 1.0)
|
56
|
-
dry-core (~> 1.0
|
57
|
-
dry-inflector (~> 1.0
|
58
|
-
dry-logic (
|
56
|
+
dry-core (~> 1.0)
|
57
|
+
dry-inflector (~> 1.0)
|
58
|
+
dry-logic (~> 1.4)
|
59
59
|
zeitwerk (~> 2.6)
|
60
60
|
edtf (3.1.1)
|
61
61
|
activesupport (>= 3.0, < 8.0)
|
@@ -106,19 +106,19 @@ 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.46.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
119
|
rubocop-ast (1.26.0)
|
120
120
|
parser (>= 3.2.1.0)
|
121
|
-
rubocop-capybara (2.17.
|
121
|
+
rubocop-capybara (2.17.1)
|
122
122
|
rubocop (~> 1.41)
|
123
123
|
rubocop-rake (0.6.0)
|
124
124
|
rubocop (~> 1.0)
|
@@ -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
|
@@ -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
@@ -19,22 +19,33 @@ module Cocina
|
|
19
19
|
def validate
|
20
20
|
return unless meets_preconditions?
|
21
21
|
|
22
|
+
validate_catalog('symphony')
|
23
|
+
validate_catalog('folio')
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
attr_reader :clazz, :attributes
|
29
|
+
|
30
|
+
def validate_catalog(catalog)
|
31
|
+
refresh_catalog_links = refresh_catalog_links_for(catalog)
|
32
|
+
|
22
33
|
return if refresh_catalog_links.length <= MAX_REFRESH_CATALOG_LINKS
|
23
34
|
|
24
35
|
raise ValidationError, "Multiple catalog links have 'refresh' property set to true " \
|
25
36
|
"(only one allowed) #{refresh_catalog_links}"
|
26
37
|
end
|
27
38
|
|
28
|
-
|
29
|
-
|
30
|
-
|
39
|
+
def catalog_links
|
40
|
+
@catalog_links ||= Array(attributes.dig(:identification, :catalogLinks))
|
41
|
+
end
|
31
42
|
|
32
43
|
def meets_preconditions?
|
33
|
-
(dro? || collection?) &&
|
44
|
+
(dro? || collection?) && catalog_links.any?
|
34
45
|
end
|
35
46
|
|
36
|
-
def
|
37
|
-
|
47
|
+
def refresh_catalog_links_for(catalog)
|
48
|
+
catalog_links.select { |catalog_link| catalog_link[:catalog] == catalog && catalog_link[:refresh] }
|
38
49
|
end
|
39
50
|
|
40
51
|
def dro?
|
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:
|
@@ -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.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: 2023-02-
|
11
|
+
date: 2023-02-28 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
|