cocina-models 0.58.1 → 0.61.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +5 -5
- data/README.md +34 -24
- data/lib/cocina/generator/schema.rb +30 -2
- data/lib/cocina/generator/schema_array.rb +1 -1
- data/lib/cocina/generator/schema_base.rb +18 -8
- data/lib/cocina/generator/schema_ref.rb +1 -1
- data/lib/cocina/generator/schema_value.rb +2 -2
- data/lib/cocina/models/access.rb +10 -11
- data/lib/cocina/models/admin_policy.rb +0 -1
- data/lib/cocina/models/admin_policy_administrative.rb +3 -3
- data/lib/cocina/models/admin_policy_default_access.rb +3 -3
- data/lib/cocina/models/administrative.rb +1 -1
- data/lib/cocina/models/citation_only_access.rb +15 -0
- data/lib/cocina/models/collection.rb +1 -2
- data/lib/cocina/models/collection_access.rb +18 -0
- data/lib/cocina/models/collection_identification.rb +2 -2
- data/lib/cocina/models/contributor.rb +3 -3
- data/lib/cocina/models/controlled_digital_lending_access.rb +16 -0
- data/lib/cocina/models/dark_access.rb +15 -0
- data/lib/cocina/models/description.rb +3 -3
- data/lib/cocina/models/descriptive_basic_value.rb +8 -8
- data/lib/cocina/models/descriptive_parallel_contributor.rb +3 -3
- data/lib/cocina/models/descriptive_parallel_event.rb +2 -2
- data/lib/cocina/models/descriptive_value.rb +8 -8
- data/lib/cocina/models/descriptive_value_language.rb +4 -4
- data/lib/cocina/models/doi.rb +9 -0
- data/lib/cocina/models/dro.rb +0 -1
- data/lib/cocina/models/dro_access.rb +12 -10
- data/lib/cocina/models/dro_structural.rb +1 -1
- data/lib/cocina/models/embargo.rb +12 -3
- data/lib/cocina/models/event.rb +2 -2
- data/lib/cocina/models/file.rb +3 -3
- data/lib/cocina/models/file_access.rb +10 -7
- data/lib/cocina/models/identification.rb +7 -4
- data/lib/cocina/models/lane_medical_barcode.rb +9 -0
- data/lib/cocina/models/language.rb +7 -7
- data/lib/cocina/models/location_based_access.rb +15 -0
- data/lib/cocina/models/location_based_download_access.rb +15 -0
- data/lib/cocina/models/presentation.rb +2 -2
- data/lib/cocina/models/purl.rb +9 -0
- data/lib/cocina/models/related_resource.rb +7 -7
- data/lib/cocina/models/release_tag.rb +4 -4
- data/lib/cocina/models/request_admin_policy.rb +0 -1
- data/lib/cocina/models/request_collection.rb +1 -2
- data/lib/cocina/models/request_dro.rb +0 -1
- data/lib/cocina/models/request_dro_structural.rb +1 -1
- data/lib/cocina/models/request_file.rb +4 -4
- data/lib/cocina/models/request_identification.rb +6 -3
- data/lib/cocina/models/sequence.rb +1 -1
- data/lib/cocina/models/source.rb +4 -4
- data/lib/cocina/models/standard.rb +4 -4
- data/lib/cocina/models/stanford_access.rb +15 -0
- data/lib/cocina/models/title.rb +8 -8
- data/lib/cocina/models/version.rb +1 -1
- data/lib/cocina/models/world_access.rb +15 -0
- data/openapi.yml +351 -172
- metadata +13 -2
@@ -3,11 +3,11 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class CollectionIdentification < Struct
|
6
|
+
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
|
6
7
|
# Unique identifier in some other system. This is because a large proportion of what is deposited in SDR, historically and currently, are representations of objects that are also represented in other systems. For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
|
7
8
|
|
8
9
|
# example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
|
9
|
-
attribute :sourceId, Types::Strict::String.
|
10
|
-
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
|
10
|
+
attribute :sourceId, Types::Strict::String.meta(omittable: true)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -5,14 +5,14 @@ module Cocina
|
|
5
5
|
class Contributor < Struct
|
6
6
|
attribute :name, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
# Entity type of the contributor (person, organization, etc.).
|
8
|
-
attribute :type, Types::Strict::String.
|
8
|
+
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
9
|
# Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
|
10
|
-
attribute :status, Types::Strict::String.
|
10
|
+
attribute :status, Types::Strict::String.meta(omittable: true)
|
11
11
|
attribute :role, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
12
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
13
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
14
|
# URL or other pointer to the location of the contributor information.
|
15
|
-
attribute :valueAt, Types::Strict::String.
|
15
|
+
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
16
16
|
attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).meta(omittable: true)
|
17
17
|
end
|
18
18
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class ControlledDigitalLendingAccess < Struct
|
6
|
+
# Access level.
|
7
|
+
attribute :access, Types::Strict::String.enum('stanford')
|
8
|
+
# Download access level.
|
9
|
+
attribute :download, Types::Strict::String.enum('none')
|
10
|
+
# If access is "location-based", which location should have access.
|
11
|
+
attribute :readLocation, Types::Strict::String.optional.enum('').meta(omittable: true)
|
12
|
+
# Available for controlled digital lending.
|
13
|
+
attribute :controlledDigitalLending, Types::Strict::Bool.default(false)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class DarkAccess < Struct
|
6
|
+
# Access level.
|
7
|
+
attribute :access, Types::Strict::String.default('dark').enum('dark').meta(omittable: true)
|
8
|
+
# Download access level.
|
9
|
+
attribute :download, Types::Strict::String.default('none').enum('none').meta(omittable: true)
|
10
|
+
# If access is "location-based", which location should have access.
|
11
|
+
attribute :readLocation, Types::Strict::String.optional.enum('').meta(omittable: true)
|
12
|
+
attribute :controlledDigitalLending, Types::Strict::Bool.enum(false).meta(omittable: true)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -12,14 +12,14 @@ module Cocina
|
|
12
12
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
13
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
14
|
attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
15
|
-
# Stanford persistent URL associated with the resource.
|
16
|
-
attribute :purl, Types::Strict::String.
|
15
|
+
# Stanford persistent URL associated with the related resource. Note this is http, not https.
|
16
|
+
attribute :purl, Types::Strict::String.meta(omittable: true)
|
17
17
|
attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
|
18
18
|
attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
|
19
19
|
attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
20
20
|
attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
|
21
21
|
# URL or other pointer to the location of the resource description.
|
22
|
-
attribute :valueAt, Types::Strict::String.
|
22
|
+
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
23
23
|
|
24
24
|
def self.new(attributes = default_attributes, safe = false, validate = true, &block)
|
25
25
|
Validator.validate(self, attributes.with_indifferent_access) if validate && name
|
@@ -7,27 +7,27 @@ module Cocina
|
|
7
7
|
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
8
|
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
9
9
|
# String or integer value of the descriptive element.
|
10
|
-
attribute :value, Types::Nominal::Any.
|
10
|
+
attribute :value, Types::Nominal::Any.meta(omittable: true)
|
11
11
|
# Type of value provided by the descriptive element.
|
12
|
-
attribute :type, Types::Strict::String.
|
12
|
+
attribute :type, Types::Strict::String.meta(omittable: true)
|
13
13
|
# Status of the descriptive element value relative to other instances of the element.
|
14
|
-
attribute :status, Types::Strict::String.
|
14
|
+
attribute :status, Types::Strict::String.meta(omittable: true)
|
15
15
|
# Code value of the descriptive element.
|
16
|
-
attribute :code, Types::Strict::String.
|
16
|
+
attribute :code, Types::Strict::String.meta(omittable: true)
|
17
17
|
# URI value of the descriptive element.
|
18
|
-
attribute :uri, Types::Strict::String.
|
18
|
+
attribute :uri, Types::Strict::String.meta(omittable: true)
|
19
19
|
attribute :standard, Standard.optional.meta(omittable: true)
|
20
20
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
21
21
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
22
22
|
attribute :source, Source.optional.meta(omittable: true)
|
23
23
|
# The preferred display label to use for the descriptive element in access systems.
|
24
|
-
attribute :displayLabel, Types::Strict::String.
|
24
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
25
25
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
26
|
-
attribute :qualifier, Types::Strict::String.
|
26
|
+
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
27
27
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
28
28
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
29
29
|
# URL or other pointer to the location of the value of the descriptive element.
|
30
|
-
attribute :valueAt, Types::Strict::String.
|
30
|
+
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -5,14 +5,14 @@ module Cocina
|
|
5
5
|
class DescriptiveParallelContributor < Struct
|
6
6
|
attribute :name, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
# Entity type of the contributor (person, organization, etc.).
|
8
|
-
attribute :type, Types::Strict::String.
|
8
|
+
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
9
|
# Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
|
10
|
-
attribute :status, Types::Strict::String.
|
10
|
+
attribute :status, Types::Strict::String.meta(omittable: true)
|
11
11
|
attribute :role, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
12
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
13
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
14
|
# URL or other pointer to the location of the contributor information.
|
15
|
-
attribute :valueAt, Types::Strict::String.
|
15
|
+
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
16
16
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
17
17
|
end
|
18
18
|
end
|
@@ -5,9 +5,9 @@ module Cocina
|
|
5
5
|
class DescriptiveParallelEvent < Struct
|
6
6
|
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
# Description of the event (creation, publication, etc.).
|
8
|
-
attribute :type, Types::Strict::String.
|
8
|
+
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
9
|
# The preferred display label to use for the event in access systems.
|
10
|
-
attribute :displayLabel, Types::Strict::String.
|
10
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
11
11
|
attribute :date, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
12
|
attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
|
13
13
|
attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
@@ -7,27 +7,27 @@ module Cocina
|
|
7
7
|
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
8
|
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
9
9
|
# String or integer value of the descriptive element.
|
10
|
-
attribute :value, Types::Nominal::Any.
|
10
|
+
attribute :value, Types::Nominal::Any.meta(omittable: true)
|
11
11
|
# Type of value provided by the descriptive element.
|
12
|
-
attribute :type, Types::Strict::String.
|
12
|
+
attribute :type, Types::Strict::String.meta(omittable: true)
|
13
13
|
# Status of the descriptive element value relative to other instances of the element.
|
14
|
-
attribute :status, Types::Strict::String.
|
14
|
+
attribute :status, Types::Strict::String.meta(omittable: true)
|
15
15
|
# Code value of the descriptive element.
|
16
|
-
attribute :code, Types::Strict::String.
|
16
|
+
attribute :code, Types::Strict::String.meta(omittable: true)
|
17
17
|
# URI value of the descriptive element.
|
18
|
-
attribute :uri, Types::Strict::String.
|
18
|
+
attribute :uri, Types::Strict::String.meta(omittable: true)
|
19
19
|
attribute :standard, Standard.optional.meta(omittable: true)
|
20
20
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
21
21
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
22
22
|
attribute :source, Source.optional.meta(omittable: true)
|
23
23
|
# The preferred display label to use for the descriptive element in access systems.
|
24
|
-
attribute :displayLabel, Types::Strict::String.
|
24
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
25
25
|
# A term providing information about the circumstances of the statement (e.g., approximate dates).
|
26
|
-
attribute :qualifier, Types::Strict::String.
|
26
|
+
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
27
27
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
28
28
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
29
29
|
# URL or other pointer to the location of the value of the descriptive element.
|
30
|
-
attribute :valueAt, Types::Strict::String.
|
30
|
+
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
31
31
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
32
32
|
end
|
33
33
|
end
|
@@ -4,14 +4,14 @@ module Cocina
|
|
4
4
|
module Models
|
5
5
|
class DescriptiveValueLanguage < Struct
|
6
6
|
# Code representing the standard or encoding.
|
7
|
-
attribute :code, Types::Strict::String.
|
7
|
+
attribute :code, Types::Strict::String.meta(omittable: true)
|
8
8
|
# URI for the standard or encoding.
|
9
|
-
attribute :uri, Types::Strict::String.
|
9
|
+
attribute :uri, Types::Strict::String.meta(omittable: true)
|
10
10
|
# String describing the standard or encoding.
|
11
|
-
attribute :value, Types::Strict::String.
|
11
|
+
attribute :value, Types::Strict::String.meta(omittable: true)
|
12
12
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
13
|
# The version of the standard or encoding.
|
14
|
-
attribute :version, Types::Strict::String.
|
14
|
+
attribute :version, Types::Strict::String.meta(omittable: true)
|
15
15
|
attribute :source, Source.optional.meta(omittable: true)
|
16
16
|
attribute :valueScript, Standard.optional.meta(omittable: true)
|
17
17
|
end
|
data/lib/cocina/models/dro.rb
CHANGED
@@ -22,7 +22,6 @@ module Cocina
|
|
22
22
|
'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'].freeze
|
23
23
|
|
24
24
|
# The content type of the DRO. Selected from an established set of values.
|
25
|
-
# example: item
|
26
25
|
attribute :type, Types::Strict::String.enum(*DRO::TYPES)
|
27
26
|
# example: druid:bc123df4567
|
28
27
|
attribute :externalIdentifier, Types::Strict::String
|
@@ -3,24 +3,26 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class DROAccess < Struct
|
6
|
-
|
7
|
-
#
|
6
|
+
# Access level.
|
7
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
8
|
+
attribute :access, Types::Strict::String.optional.default('dark').meta(omittable: true)
|
9
|
+
# Download access level.
|
10
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
11
|
+
attribute :download, Types::Strict::String.optional.default('none').meta(omittable: true)
|
12
|
+
# If access is "location-based", which location should have access.
|
13
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
14
|
+
attribute :readLocation, Types::Strict::String.optional.meta(omittable: true)
|
15
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
8
16
|
attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
|
9
17
|
# The human readable copyright statement that applies
|
10
18
|
# example: Copyright World Trade Organization
|
11
19
|
attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
|
12
20
|
attribute :embargo, Embargo.optional.meta(omittable: true)
|
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.optional.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
|
16
|
-
# If access is "location-based", which location should have access. This is used in the transition from Fedora as a way to set a default readLocation at registration that is copied down to all the files.
|
17
|
-
|
18
|
-
attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
|
19
21
|
# The human readable use and reproduction statement that applies
|
20
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).
|
21
|
-
attribute :useAndReproductionStatement, Types::Strict::String.
|
23
|
+
attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
|
22
24
|
# The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
|
23
|
-
attribute :license, Types::Strict::String.
|
25
|
+
attribute :license, Types::Strict::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', 'http://cocina.sul.stanford.edu/licenses/none').meta(omittable: true)
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -7,7 +7,7 @@ module Cocina
|
|
7
7
|
attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).meta(omittable: true)
|
8
8
|
attribute :isMemberOf, Types::Strict::Array.of(Druid).meta(omittable: true)
|
9
9
|
# Agreement that covers the deposit of the DRO into SDR.
|
10
|
-
attribute :hasAgreement, Types::Strict::String.
|
10
|
+
attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -3,14 +3,23 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Embargo < Struct
|
6
|
+
# Access level.
|
7
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
8
|
+
attribute :access, Types::Strict::String.optional.default('dark').meta(omittable: true)
|
9
|
+
# Download access level.
|
10
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
11
|
+
attribute :download, Types::Strict::String.optional.default('none').meta(omittable: true)
|
12
|
+
# If access is "location-based", which location should have access.
|
13
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
14
|
+
attribute :readLocation, Types::Strict::String.optional.meta(omittable: true)
|
15
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
16
|
+
attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
|
6
17
|
# Date when the Collection is released from an embargo.
|
7
18
|
# example: 2029-06-22T07:00:00.000+00:00
|
8
19
|
attribute :releaseDate, Types::Params::DateTime
|
9
|
-
# Access level that applies when embargo expires.
|
10
|
-
attribute :access, Types::Strict::String.enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
|
11
20
|
# The human readable use and reproduction statement that applies when the embargo expires.
|
12
21
|
# example: These materials are in the public domain.
|
13
|
-
attribute :useAndReproductionStatement, Types::Strict::String.
|
22
|
+
attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
|
14
23
|
end
|
15
24
|
end
|
16
25
|
end
|
data/lib/cocina/models/event.rb
CHANGED
@@ -5,9 +5,9 @@ module Cocina
|
|
5
5
|
class Event < Struct
|
6
6
|
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
7
|
# Description of the event (creation, publication, etc.).
|
8
|
-
attribute :type, Types::Strict::String.
|
8
|
+
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
9
|
# The preferred display label to use for the event in access systems.
|
10
|
-
attribute :displayLabel, Types::Strict::String.
|
10
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
11
11
|
attribute :date, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
12
|
attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
|
13
13
|
attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
data/lib/cocina/models/file.rb
CHANGED
@@ -16,13 +16,13 @@ module Cocina
|
|
16
16
|
# Filename for a file. Can be same as label.
|
17
17
|
attribute :filename, Types::Strict::String
|
18
18
|
# Size of the File (binary) in bytes.
|
19
|
-
attribute :size, Types::Strict::Integer.
|
19
|
+
attribute :size, Types::Strict::Integer.meta(omittable: true)
|
20
20
|
# Version for the File within SDR.
|
21
21
|
attribute :version, Types::Strict::Integer
|
22
22
|
# MIME Type of the File.
|
23
|
-
attribute :hasMimeType, Types::Strict::String.
|
23
|
+
attribute :hasMimeType, Types::Strict::String.meta(omittable: true)
|
24
24
|
# Use for the File.
|
25
|
-
attribute :use, Types::Strict::String.
|
25
|
+
attribute :use, Types::Strict::String.meta(omittable: true)
|
26
26
|
attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([].freeze)
|
27
27
|
attribute(:access, FileAccess.default { FileAccess.new })
|
28
28
|
attribute(:administrative, FileAdministrative.default { FileAdministrative.new })
|
@@ -3,14 +3,17 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class FileAccess < Struct
|
6
|
-
# Access level
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
#
|
11
|
-
attribute :download, Types::Strict::String.optional.default('none').
|
6
|
+
# Access level.
|
7
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
8
|
+
attribute :access, Types::Strict::String.optional.default('dark').meta(omittable: true)
|
9
|
+
# Download access level.
|
10
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
11
|
+
attribute :download, Types::Strict::String.optional.default('none').meta(omittable: true)
|
12
12
|
# If access is "location-based", which location should have access.
|
13
|
-
|
13
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
14
|
+
attribute :readLocation, Types::Strict::String.optional.meta(omittable: true)
|
15
|
+
# Validation of this property is relaxed. See the openapi for full validation.
|
16
|
+
attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
|
14
17
|
end
|
15
18
|
end
|
16
19
|
end
|
@@ -3,13 +3,16 @@
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
5
|
class Identification < Struct
|
6
|
+
# A barcode
|
7
|
+
attribute :barcode, Types::Nominal::Any.meta(omittable: true)
|
8
|
+
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
|
9
|
+
# Digital Object Identifier (https://www.doi.org)
|
10
|
+
# example: 10.25740/druid:bc123df4567
|
11
|
+
attribute :doi, Types::Strict::String.meta(omittable: true)
|
6
12
|
# Unique identifier in some other system. This is because a large proportion of what is deposited in SDR, historically and currently, are representations of objects that are also represented in other systems. For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
|
7
13
|
|
8
14
|
# example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
|
9
|
-
attribute :sourceId, Types::Strict::String.
|
10
|
-
attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
|
11
|
-
# A barcode
|
12
|
-
attribute :barcode, Types::Nominal::Any.optional.meta(omittable: true)
|
15
|
+
attribute :sourceId, Types::Strict::String.meta(omittable: true)
|
13
16
|
end
|
14
17
|
end
|
15
18
|
end
|
@@ -5,27 +5,27 @@ module Cocina
|
|
5
5
|
class Language < Struct
|
6
6
|
attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
|
7
7
|
# Code value of the descriptive element.
|
8
|
-
attribute :code, Types::Strict::String.
|
8
|
+
attribute :code, Types::Strict::String.meta(omittable: true)
|
9
9
|
# The preferred display label to use for the descriptive element in access systems.
|
10
|
-
attribute :displayLabel, Types::Strict::String.
|
10
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
11
11
|
attribute :encoding, Standard.optional.meta(omittable: true)
|
12
12
|
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
13
13
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
14
|
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
15
15
|
# present for mapping to additional schemas in the future and for consistency but not otherwise used
|
16
|
-
attribute :qualifier, Types::Strict::String.
|
16
|
+
attribute :qualifier, Types::Strict::String.meta(omittable: true)
|
17
17
|
attribute :script, DescriptiveValue.optional.meta(omittable: true)
|
18
18
|
attribute :source, Source.optional.meta(omittable: true)
|
19
19
|
# Status of the language relative to other parallel language elements (e.g. the primary language)
|
20
|
-
attribute :status, Types::Strict::String.
|
20
|
+
attribute :status, Types::Strict::String.enum('primary').meta(omittable: true)
|
21
21
|
attribute :standard, Standard.optional.meta(omittable: true)
|
22
22
|
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
23
23
|
# URI value of the descriptive element.
|
24
|
-
attribute :uri, Types::Strict::String.
|
24
|
+
attribute :uri, Types::Strict::String.meta(omittable: true)
|
25
25
|
# Value of the descriptive element.
|
26
|
-
attribute :value, Types::Strict::String.
|
26
|
+
attribute :value, Types::Strict::String.meta(omittable: true)
|
27
27
|
# URL or other pointer to the location of the language information.
|
28
|
-
attribute :valueAt, Types::Strict::String.
|
28
|
+
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
29
29
|
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
30
30
|
end
|
31
31
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class LocationBasedAccess < Struct
|
6
|
+
# Access level.
|
7
|
+
attribute :access, Types::Strict::String.enum('location-based')
|
8
|
+
# Download access level.
|
9
|
+
attribute :download, Types::Strict::String.enum('location-based', 'none')
|
10
|
+
# If access is "location-based", which location should have access.
|
11
|
+
attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m')
|
12
|
+
attribute :controlledDigitalLending, Types::Strict::Bool.enum(false).meta(omittable: true)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|