cocina-models 0.55.0 → 0.58.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cocina/generator/schema.rb +1 -1
  3. data/lib/cocina/generator/schema_base.rb +10 -0
  4. data/lib/cocina/generator/schema_value.rb +2 -1
  5. data/lib/cocina/models/access.rb +10 -2
  6. data/lib/cocina/models/admin_policy_administrative.rb +8 -3
  7. data/lib/cocina/models/admin_policy_default_access.rb +25 -0
  8. data/lib/cocina/models/administrative.rb +1 -1
  9. data/lib/cocina/models/business_barcode.rb +9 -0
  10. data/lib/cocina/models/catkey_barcode.rb +9 -0
  11. data/lib/cocina/models/collection_identification.rb +1 -1
  12. data/lib/cocina/models/contributor.rb +3 -3
  13. data/lib/cocina/models/description.rb +2 -2
  14. data/lib/cocina/models/descriptive_basic_value.rb +8 -8
  15. data/lib/cocina/models/descriptive_parallel_contributor.rb +3 -3
  16. data/lib/cocina/models/descriptive_parallel_event.rb +2 -2
  17. data/lib/cocina/models/descriptive_value.rb +8 -8
  18. data/lib/cocina/models/descriptive_value_language.rb +4 -4
  19. data/lib/cocina/models/dro_access.rb +8 -6
  20. data/lib/cocina/models/dro_structural.rb +1 -1
  21. data/lib/cocina/models/embargo.rb +1 -1
  22. data/lib/cocina/models/event.rb +2 -2
  23. data/lib/cocina/models/file.rb +3 -3
  24. data/lib/cocina/models/file_access.rb +4 -4
  25. data/lib/cocina/models/identification.rb +3 -1
  26. data/lib/cocina/models/language.rb +7 -7
  27. data/lib/cocina/models/presentation.rb +2 -2
  28. data/lib/cocina/models/related_resource.rb +6 -6
  29. data/lib/cocina/models/release_tag.rb +4 -4
  30. data/lib/cocina/models/request_dro_structural.rb +1 -1
  31. data/lib/cocina/models/request_file.rb +4 -4
  32. data/lib/cocina/models/request_identification.rb +2 -0
  33. data/lib/cocina/models/sequence.rb +1 -1
  34. data/lib/cocina/models/source.rb +4 -4
  35. data/lib/cocina/models/standard.rb +4 -4
  36. data/lib/cocina/models/standard_barcode.rb +9 -0
  37. data/lib/cocina/models/title.rb +8 -8
  38. data/lib/cocina/models/version.rb +1 -1
  39. data/openapi.yml +100 -2
  40. metadata +6 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbed8aec9255570088565182862681d94908cb165e5f6be489ad103052a5f708
4
- data.tar.gz: 526b172620cbe31ea3ca59871d0ed0a816bec3c01726214fd3634bf54ec24eba
3
+ metadata.gz: 2f791f4fb5f53b913b495bcae9bd9918b924f43652e27125c624ffb12ba67e6a
4
+ data.tar.gz: f6d42499c81c75870ba3859ddb0241a2ecc4df420677a2d371c775ba3f72efd4
5
5
  SHA512:
6
- metadata.gz: 6a555879230729f246d468589fb3e5ec261cebc36ae17d1282b663ef1b0ff0a5bd4afc9e9ee9688978da98bf20e7f709f989a6b46934a103ad0fabe40ee2353a
7
- data.tar.gz: 332f3a59c67779ccb81340a352baa9894e9c3c76cbf5ff2bed383b501c5ff9ec7fb6e1d80aa3610b9a3ee289448a6b93e59e50345bd97b7f9279acf684191db3
6
+ metadata.gz: ef6a8fcbb2550b49fbcb5fbd09a2d3fafce8f345773387fd12520b654e5e0f810aa805a51aeda04ccf4766eac0108cb4c59467a3d1ff86b9dbf5e337450da5aa
7
+ data.tar.gz: 5a7282e082a864bc3e3c223593a01c3c42243f458ba2debc2d4aa72478d945af9e350877aec68073590bf30e0c4080cf882b0f255d190dd901b46f950accb93a
@@ -96,7 +96,7 @@ module Cocina
96
96
  doc.properties.map do |key, properties_doc|
97
97
  property_class_for(properties_doc).new(properties_doc,
98
98
  key: key,
99
- required: doc.requires?(properties_doc),
99
+ required: doc.requires?(key),
100
100
  parent: self)
101
101
  end
102
102
  end
@@ -21,12 +21,22 @@ module Cocina
21
21
  key || schema_doc.name
22
22
  end
23
23
 
24
+ # Allows non-required values to not be provided. This allows smaller
25
+ # requests as not every field needs to be present.
24
26
  def omittable
25
27
  return '' if required
26
28
 
27
29
  '.meta(omittable: true)'
28
30
  end
29
31
 
32
+ # Allows non-required values to be set to nil. This is useful when doing
33
+ # an update and you want to clear out a value.
34
+ def optional
35
+ return '' if required
36
+
37
+ '.optional'
38
+ end
39
+
30
40
  def quote(item)
31
41
  return item unless schema_doc.type == 'string'
32
42
 
@@ -6,7 +6,8 @@ module Cocina
6
6
  class SchemaValue < SchemaBase
7
7
  # rubocop:disable Layout/LineLength
8
8
  def generate
9
- "#{description}#{example}attribute :#{name.camelize(:lower)}, Types::#{dry_datatype(schema_doc)}#{default}#{enum}#{omittable}"
9
+ # optional has to come before default or the default value that gets set will be nil.
10
+ "#{description}#{example}attribute :#{name.camelize(:lower)}, Types::#{dry_datatype(schema_doc)}#{optional}#{default}#{enum}#{omittable}"
10
11
  end
11
12
  # rubocop:enable Layout/LineLength
12
13
 
@@ -4,9 +4,17 @@ module Cocina
4
4
  module Models
5
5
  class Access < Struct
6
6
  # Access level
7
- attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
7
+ attribute :access, Types::Strict::String.optional.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
8
+ # The human readable copyright statement that applies
9
+ # example: Copyright World Trade Organization
10
+ attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
8
11
  # If access is "location-based", which location should have access.
9
- attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
12
+ attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
13
+ # The human readable use and reproduction statement that applies
14
+ # 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).
15
+ attribute :useAndReproductionStatement, Types::Strict::String.optional.meta(omittable: true)
16
+ # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
17
+ attribute :license, Types::Strict::String.optional.meta(omittable: true)
10
18
  end
11
19
  end
12
20
  end
@@ -3,14 +3,19 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class AdminPolicyAdministrative < Struct
6
- attribute :defaultObjectRights, Types::Strict::String.default('<?xml version="1.0" encoding="UTF-8"?><rightsMetadata><access type="discover"><machine><world/></machine></access><access type="read"><machine><world/></machine></access><use><human type="useAndReproduction"/><human type="creativeCommons"/><machine type="creativeCommons" uri=""/><human type="openDataCommons"/><machine type="openDataCommons" uri=""/></use><copyright><human/></copyright></rightsMetadata>').meta(omittable: true)
6
+ # This is an XML expression of the default access (see defaultAccess)
7
+ attribute :defaultObjectRights, Types::Strict::String.optional.default('<?xml version="1.0" encoding="UTF-8"?><rightsMetadata><access type="discover"><machine><world/></machine></access><access type="read"><machine><world/></machine></access><use><human type="useAndReproduction"/><human type="creativeCommons"/><machine type="creativeCommons" uri=""/><human type="openDataCommons"/><machine type="openDataCommons" uri=""/></use><copyright><human/></copyright></rightsMetadata>').meta(omittable: true)
8
+ attribute :defaultAccess, AdminPolicyDefaultAccess.optional.meta(omittable: true)
7
9
  attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
8
10
  # An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
9
11
  # example: wasCrawlPreassemblyWF
10
- attribute :disseminationWorkflow, Types::Strict::String.meta(omittable: true)
12
+ attribute :disseminationWorkflow, Types::Strict::String.optional.meta(omittable: true)
11
13
  attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
12
- attribute :roles, Types::Strict::Array.of(AccessRole).meta(omittable: true)
14
+ # example: druid:bc123df4567
13
15
  attribute :hasAdminPolicy, Types::Strict::String
16
+ # example: druid:bc123df4567
17
+ attribute :referencesAgreement, Types::Strict::String.optional.meta(omittable: true)
18
+ attribute :roles, Types::Strict::Array.of(AccessRole).meta(omittable: true)
14
19
  end
15
20
  end
16
21
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class AdminPolicyDefaultAccess < Struct
6
+ attribute :access, Types::Strict::String.optional.enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
7
+ # Available for controlled digital lending.
8
+ attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
9
+ # The human readable copyright statement that applies
10
+ # example: Copyright World Trade Organization
11
+ attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
12
+ # 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.
13
+
14
+ attribute :download, Types::Strict::String.optional.enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
15
+ # 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.
16
+
17
+ attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
18
+ # The human readable use and reproduction statement that applies
19
+ # 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).
20
+ attribute :useAndReproductionStatement, Types::Strict::String.optional.meta(omittable: true)
21
+ # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
22
+ attribute :license, Types::Strict::String.optional.meta(omittable: true)
23
+ end
24
+ end
25
+ end
@@ -8,7 +8,7 @@ module Cocina
8
8
  attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).meta(omittable: true)
9
9
  # Administrative or Internal project this resource is a part of
10
10
  # example: Google Books
11
- attribute :partOfProject, Types::Strict::String.meta(omittable: true)
11
+ attribute :partOfProject, Types::Strict::String.optional.meta(omittable: true)
12
12
  end
13
13
  end
14
14
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ BusinessBarcode = Types::String.constrained(
6
+ format: /^2050[0-9]{7}$/i
7
+ )
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ CatkeyBarcode = Types::String.constrained(
6
+ format: /^[0-9]+-[0-9]+$/i
7
+ )
8
+ end
9
+ end
@@ -6,7 +6,7 @@ module Cocina
6
6
  # 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
7
 
8
8
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
9
- attribute :sourceId, Types::Strict::String.meta(omittable: true)
9
+ attribute :sourceId, Types::Strict::String.optional.meta(omittable: true)
10
10
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
11
  end
12
12
  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.meta(omittable: true)
8
+ attribute :type, Types::Strict::String.optional.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.meta(omittable: true)
10
+ attribute :status, Types::Strict::String.optional.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.meta(omittable: true)
15
+ attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
16
16
  attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).meta(omittable: true)
17
17
  end
18
18
  end
@@ -13,13 +13,13 @@ module Cocina
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
15
  # Stanford persistent URL associated with the resource.
16
- attribute :purl, Types::Strict::String.meta(omittable: true)
16
+ attribute :purl, Types::Strict::String.optional.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.meta(omittable: true)
22
+ attribute :valueAt, Types::Strict::String.optional.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.meta(omittable: true)
10
+ attribute :value, Types::Nominal::Any.optional.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
12
- attribute :type, Types::Strict::String.meta(omittable: true)
12
+ attribute :type, Types::Strict::String.optional.meta(omittable: true)
13
13
  # Status of the descriptive element value relative to other instances of the element.
14
- attribute :status, Types::Strict::String.meta(omittable: true)
14
+ attribute :status, Types::Strict::String.optional.meta(omittable: true)
15
15
  # Code value of the descriptive element.
16
- attribute :code, Types::Strict::String.meta(omittable: true)
16
+ attribute :code, Types::Strict::String.optional.meta(omittable: true)
17
17
  # URI value of the descriptive element.
18
- attribute :uri, Types::Strict::String.meta(omittable: true)
18
+ attribute :uri, Types::Strict::String.optional.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.meta(omittable: true)
24
+ attribute :displayLabel, Types::Strict::String.optional.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.meta(omittable: true)
26
+ attribute :qualifier, Types::Strict::String.optional.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.meta(omittable: true)
30
+ attribute :valueAt, Types::Strict::String.optional.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.meta(omittable: true)
8
+ attribute :type, Types::Strict::String.optional.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.meta(omittable: true)
10
+ attribute :status, Types::Strict::String.optional.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.meta(omittable: true)
15
+ attribute :valueAt, Types::Strict::String.optional.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.meta(omittable: true)
8
+ attribute :type, Types::Strict::String.optional.meta(omittable: true)
9
9
  # The preferred display label to use for the event in access systems.
10
- attribute :displayLabel, Types::Strict::String.meta(omittable: true)
10
+ attribute :displayLabel, Types::Strict::String.optional.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.meta(omittable: true)
10
+ attribute :value, Types::Nominal::Any.optional.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
12
- attribute :type, Types::Strict::String.meta(omittable: true)
12
+ attribute :type, Types::Strict::String.optional.meta(omittable: true)
13
13
  # Status of the descriptive element value relative to other instances of the element.
14
- attribute :status, Types::Strict::String.meta(omittable: true)
14
+ attribute :status, Types::Strict::String.optional.meta(omittable: true)
15
15
  # Code value of the descriptive element.
16
- attribute :code, Types::Strict::String.meta(omittable: true)
16
+ attribute :code, Types::Strict::String.optional.meta(omittable: true)
17
17
  # URI value of the descriptive element.
18
- attribute :uri, Types::Strict::String.meta(omittable: true)
18
+ attribute :uri, Types::Strict::String.optional.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.meta(omittable: true)
24
+ attribute :displayLabel, Types::Strict::String.optional.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.meta(omittable: true)
26
+ attribute :qualifier, Types::Strict::String.optional.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.meta(omittable: true)
30
+ attribute :valueAt, Types::Strict::String.optional.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.meta(omittable: true)
7
+ attribute :code, Types::Strict::String.optional.meta(omittable: true)
8
8
  # URI for the standard or encoding.
9
- attribute :uri, Types::Strict::String.meta(omittable: true)
9
+ attribute :uri, Types::Strict::String.optional.meta(omittable: true)
10
10
  # String describing the standard or encoding.
11
- attribute :value, Types::Strict::String.meta(omittable: true)
11
+ attribute :value, Types::Strict::String.optional.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.meta(omittable: true)
14
+ attribute :version, Types::Strict::String.optional.meta(omittable: true)
15
15
  attribute :source, Source.optional.meta(omittable: true)
16
16
  attribute :valueScript, Standard.optional.meta(omittable: true)
17
17
  end
@@ -3,22 +3,24 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DROAccess < Struct
6
- attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
6
+ attribute :access, Types::Strict::String.optional.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
7
7
  # Available for controlled digital lending.
8
- attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
8
+ attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
9
9
  # The human readable copyright statement that applies
10
10
  # example: Copyright World Trade Organization
11
- attribute :copyright, Types::Strict::String.meta(omittable: true)
11
+ attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
12
12
  attribute :embargo, Embargo.optional.meta(omittable: true)
13
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
14
 
15
- attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
15
+ attribute :download, Types::Strict::String.optional.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
16
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
17
 
18
- attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
18
+ attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
19
19
  # The human readable use and reproduction statement that applies
20
20
  # 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.meta(omittable: true)
21
+ attribute :useAndReproductionStatement, Types::Strict::String.optional.meta(omittable: true)
22
+ # 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.optional.meta(omittable: true)
22
24
  end
23
25
  end
24
26
  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.meta(omittable: true)
10
+ attribute :hasAgreement, Types::Strict::String.optional.meta(omittable: true)
11
11
  end
12
12
  end
13
13
  end
@@ -10,7 +10,7 @@ module Cocina
10
10
  attribute :access, Types::Strict::String.enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
11
11
  # The human readable use and reproduction statement that applies when the embargo expires.
12
12
  # example: These materials are in the public domain.
13
- attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
13
+ attribute :useAndReproductionStatement, Types::Strict::String.optional.meta(omittable: true)
14
14
  end
15
15
  end
16
16
  end
@@ -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.meta(omittable: true)
8
+ attribute :type, Types::Strict::String.optional.meta(omittable: true)
9
9
  # The preferred display label to use for the event in access systems.
10
- attribute :displayLabel, Types::Strict::String.meta(omittable: true)
10
+ attribute :displayLabel, Types::Strict::String.optional.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)
@@ -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.meta(omittable: true)
19
+ attribute :size, Types::Strict::Integer.optional.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.meta(omittable: true)
23
+ attribute :hasMimeType, Types::Strict::String.optional.meta(omittable: true)
24
24
  # Use for the File.
25
- attribute :use, Types::Strict::String.meta(omittable: true)
25
+ attribute :use, Types::Strict::String.optional.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 })
@@ -4,13 +4,13 @@ module Cocina
4
4
  module Models
5
5
  class FileAccess < Struct
6
6
  # Access level
7
- attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
7
+ attribute :access, Types::Strict::String.optional.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
8
8
  # Available for controlled digital lending.
9
- attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
9
+ attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
10
10
  # Download access level for a file
11
- attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
11
+ attribute :download, Types::Strict::String.optional.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
12
12
  # If access is "location-based", which location should have access.
13
- attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
13
+ attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
14
14
  end
15
15
  end
16
16
  end
@@ -6,8 +6,10 @@ module Cocina
6
6
  # 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
7
 
8
8
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
9
- attribute :sourceId, Types::Strict::String.meta(omittable: true)
9
+ attribute :sourceId, Types::Strict::String.optional.meta(omittable: true)
10
10
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
+ # A barcode
12
+ attribute :barcode, Types::Nominal::Any.optional.meta(omittable: true)
11
13
  end
12
14
  end
13
15
  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.meta(omittable: true)
8
+ attribute :code, Types::Strict::String.optional.meta(omittable: true)
9
9
  # The preferred display label to use for the descriptive element in access systems.
10
- attribute :displayLabel, Types::Strict::String.meta(omittable: true)
10
+ attribute :displayLabel, Types::Strict::String.optional.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.meta(omittable: true)
16
+ attribute :qualifier, Types::Strict::String.optional.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.enum('primary').meta(omittable: true)
20
+ attribute :status, Types::Strict::String.optional.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.meta(omittable: true)
24
+ attribute :uri, Types::Strict::String.optional.meta(omittable: true)
25
25
  # Value of the descriptive element.
26
- attribute :value, Types::Strict::String.meta(omittable: true)
26
+ attribute :value, Types::Strict::String.optional.meta(omittable: true)
27
27
  # URL or other pointer to the location of the language information.
28
- attribute :valueAt, Types::Strict::String.meta(omittable: true)
28
+ attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
29
29
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
30
30
  end
31
31
  end
@@ -4,9 +4,9 @@ module Cocina
4
4
  module Models
5
5
  class Presentation < Struct
6
6
  # Height in pixels
7
- attribute :height, Types::Strict::Integer.meta(omittable: true)
7
+ attribute :height, Types::Strict::Integer.optional.meta(omittable: true)
8
8
  # Width in pixels
9
- attribute :width, Types::Strict::Integer.meta(omittable: true)
9
+ attribute :width, Types::Strict::Integer.optional.meta(omittable: true)
10
10
  end
11
11
  end
12
12
  end
@@ -4,11 +4,11 @@ module Cocina
4
4
  module Models
5
5
  class RelatedResource < Struct
6
6
  # The relationship of the related resource to the described resource.
7
- attribute :type, Types::Strict::String.meta(omittable: true)
7
+ attribute :type, Types::Strict::String.optional.meta(omittable: true)
8
8
  # Status of the related resource relative to other related resources.
9
- attribute :status, Types::Strict::String.meta(omittable: true)
9
+ attribute :status, Types::Strict::String.optional.meta(omittable: true)
10
10
  # The preferred display label to use for the related resource in access systems.
11
- attribute :displayLabel, Types::Strict::String.meta(omittable: true)
11
+ attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
12
12
  attribute :title, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
14
14
  attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
@@ -19,14 +19,14 @@ module Cocina
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
21
21
  # Stanford persistent URL associated with the related resource.
22
- attribute :purl, Types::Strict::String.meta(omittable: true)
22
+ attribute :purl, Types::Strict::String.optional.meta(omittable: true)
23
23
  attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
24
24
  attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
25
25
  attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
26
26
  # The version of the related resource.
27
- attribute :version, Types::Strict::String.meta(omittable: true)
27
+ attribute :version, Types::Strict::String.optional.meta(omittable: true)
28
28
  # URL or other pointer to the location of the related resource information.
29
- attribute :valueAt, Types::Strict::String.meta(omittable: true)
29
+ attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
30
30
  end
31
31
  end
32
32
  end
@@ -5,15 +5,15 @@ module Cocina
5
5
  class ReleaseTag < Struct
6
6
  # Who did this release
7
7
  # example: petucket
8
- attribute :who, Types::Strict::String.meta(omittable: true)
8
+ attribute :who, Types::Strict::String.optional.meta(omittable: true)
9
9
  # What is being released. This item or the whole collection.
10
10
  # example: self
11
- attribute :what, Types::Strict::String.enum('self', 'collection').meta(omittable: true)
11
+ attribute :what, Types::Strict::String.optional.enum('self', 'collection').meta(omittable: true)
12
12
  # When did this action happen
13
- attribute :date, Types::Params::DateTime.meta(omittable: true)
13
+ attribute :date, Types::Params::DateTime.optional.meta(omittable: true)
14
14
  # What platform is it released to
15
15
  # example: Searchworks
16
- attribute :to, Types::Strict::String.meta(omittable: true)
16
+ attribute :to, Types::Strict::String.optional.meta(omittable: true)
17
17
  attribute :release, Types::Strict::Bool.default(false)
18
18
  end
19
19
  end
@@ -6,7 +6,7 @@ module Cocina
6
6
  attribute :contains, Types::Strict::Array.of(RequestFileSet).meta(omittable: true)
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
- attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
9
+ attribute :hasAgreement, Types::Strict::String.optional.meta(omittable: true)
10
10
  end
11
11
  end
12
12
  end
@@ -10,11 +10,11 @@ module Cocina
10
10
  attribute :type, Types::Strict::String.enum(*RequestFile::TYPES)
11
11
  attribute :label, Types::Strict::String
12
12
  attribute :filename, Types::Strict::String
13
- attribute :size, Types::Strict::Integer.meta(omittable: true)
13
+ attribute :size, Types::Strict::Integer.optional.meta(omittable: true)
14
14
  attribute :version, Types::Strict::Integer
15
- attribute :hasMimeType, Types::Strict::String.meta(omittable: true)
16
- attribute :externalIdentifier, Types::Strict::String.meta(omittable: true)
17
- attribute :use, Types::Strict::String.meta(omittable: true)
15
+ attribute :hasMimeType, Types::Strict::String.optional.meta(omittable: true)
16
+ attribute :externalIdentifier, Types::Strict::String.optional.meta(omittable: true)
17
+ attribute :use, Types::Strict::String.optional.meta(omittable: true)
18
18
  attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([].freeze)
19
19
  attribute(:access, FileAccess.default { FileAccess.new })
20
20
  attribute(:administrative, FileAdministrative.default { FileAdministrative.new })
@@ -8,6 +8,8 @@ module Cocina
8
8
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
9
9
  attribute :sourceId, Types::Strict::String
10
10
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
+ # A barcode
12
+ attribute :barcode, Types::Nominal::Any.optional.meta(omittable: true)
11
13
  end
12
14
  end
13
15
  end
@@ -5,7 +5,7 @@ module Cocina
5
5
  class Sequence < Struct
6
6
  attribute :members, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
7
7
  # The direction that a sequence of canvases should be displayed to the user
8
- attribute :viewingDirection, Types::Strict::String.enum('right-to-left', 'left-to-right').meta(omittable: true)
8
+ attribute :viewingDirection, Types::Strict::String.optional.enum('right-to-left', 'left-to-right').meta(omittable: true)
9
9
  end
10
10
  end
11
11
  end
@@ -4,14 +4,14 @@ module Cocina
4
4
  module Models
5
5
  class Source < Struct
6
6
  # Code representing the value source.
7
- attribute :code, Types::Strict::String.meta(omittable: true)
7
+ attribute :code, Types::Strict::String.optional.meta(omittable: true)
8
8
  # URI for the value source.
9
- attribute :uri, Types::Strict::String.meta(omittable: true)
9
+ attribute :uri, Types::Strict::String.optional.meta(omittable: true)
10
10
  # String describing the value source.
11
- attribute :value, Types::Strict::String.meta(omittable: true)
11
+ attribute :value, Types::Strict::String.optional.meta(omittable: true)
12
12
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  # The version of the value source.
14
- attribute :version, Types::Strict::String.meta(omittable: true)
14
+ attribute :version, Types::Strict::String.optional.meta(omittable: true)
15
15
  end
16
16
  end
17
17
  end
@@ -4,14 +4,14 @@ module Cocina
4
4
  module Models
5
5
  class Standard < Struct
6
6
  # Code representing the standard or encoding.
7
- attribute :code, Types::Strict::String.meta(omittable: true)
7
+ attribute :code, Types::Strict::String.optional.meta(omittable: true)
8
8
  # URI for the standard or encoding.
9
- attribute :uri, Types::Strict::String.meta(omittable: true)
9
+ attribute :uri, Types::Strict::String.optional.meta(omittable: true)
10
10
  # String describing the standard or encoding.
11
- attribute :value, Types::Strict::String.meta(omittable: true)
11
+ attribute :value, Types::Strict::String.optional.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.meta(omittable: true)
14
+ attribute :version, Types::Strict::String.optional.meta(omittable: true)
15
15
  attribute :source, Source.optional.meta(omittable: true)
16
16
  end
17
17
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ StandardBarcode = Types::String.constrained(
6
+ format: /^36105[0-9]{9}$/i
7
+ )
8
+ end
9
+ end
@@ -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.meta(omittable: true)
10
+ attribute :value, Types::Nominal::Any.optional.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
12
- attribute :type, Types::Strict::String.meta(omittable: true)
12
+ attribute :type, Types::Strict::String.optional.meta(omittable: true)
13
13
  # Status of the descriptive element value relative to other instances of the element.
14
- attribute :status, Types::Strict::String.meta(omittable: true)
14
+ attribute :status, Types::Strict::String.optional.meta(omittable: true)
15
15
  # Code value of the descriptive element.
16
- attribute :code, Types::Strict::String.meta(omittable: true)
16
+ attribute :code, Types::Strict::String.optional.meta(omittable: true)
17
17
  # URI value of the descriptive element.
18
- attribute :uri, Types::Strict::String.meta(omittable: true)
18
+ attribute :uri, Types::Strict::String.optional.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.meta(omittable: true)
24
+ attribute :displayLabel, Types::Strict::String.optional.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.meta(omittable: true)
26
+ attribute :qualifier, Types::Strict::String.optional.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.meta(omittable: true)
30
+ attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
31
31
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
32
32
  end
33
33
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.55.0'
5
+ VERSION = '0.58.1'
6
6
  end
7
7
  end
data/openapi.yml CHANGED
@@ -108,6 +108,10 @@ components:
108
108
  - 'citation-only'
109
109
  - 'dark'
110
110
  default: 'dark'
111
+ copyright:
112
+ description: The human readable copyright statement that applies
113
+ example: Copyright World Trade Organization
114
+ type: string
111
115
  readLocation:
112
116
  description: If access is "location-based", which location should have access.
113
117
  type: string
@@ -118,6 +122,13 @@ components:
118
122
  - 'art'
119
123
  - 'hoover'
120
124
  - 'm&m'
125
+ useAndReproductionStatement:
126
+ description: The human readable use and reproduction statement that applies
127
+ 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).
128
+ type: string
129
+ license:
130
+ description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
131
+ type: string
121
132
  AccessRole:
122
133
  description: Access role conferred by an AdminPolicy to objects within it. (used by Argo)
123
134
  type: object
@@ -214,7 +225,11 @@ components:
214
225
  properties:
215
226
  defaultObjectRights:
216
227
  type: string
228
+ description: This is an XML expression of the default access (see defaultAccess)
229
+ deprecated: true
217
230
  default: <?xml version="1.0" encoding="UTF-8"?><rightsMetadata><access type="discover"><machine><world/></machine></access><access type="read"><machine><world/></machine></access><use><human type="useAndReproduction"/><human type="creativeCommons"/><machine type="creativeCommons" uri=""/><human type="openDataCommons"/><machine type="openDataCommons" uri=""/></use><copyright><human/></copyright></rightsMetadata>
231
+ defaultAccess:
232
+ $ref: '#/components/schemas/AdminPolicyDefaultAccess'
218
233
  registrationWorkflow:
219
234
  description: When you register an item with this admin policy, these are the workflows that are available.
220
235
  type: array
@@ -229,15 +244,70 @@ components:
229
244
  type: array
230
245
  items:
231
246
  type: string
247
+ hasAdminPolicy:
248
+ $ref: '#/components/schemas/Druid'
249
+ referencesAgreement:
250
+ $ref: '#/components/schemas/Druid'
232
251
  roles:
233
252
  description: The access roles conferred by this AdminPolicy (used by Argo)
234
253
  type: array
235
254
  items:
236
255
  $ref: '#/components/schemas/AccessRole'
237
- hasAdminPolicy:
238
- type: string
239
256
  required:
240
257
  - hasAdminPolicy
258
+ AdminPolicyDefaultAccess:
259
+ description: 'Provides the default access settings for an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.'
260
+ type: object
261
+ additionalProperties: false
262
+ properties:
263
+ access:
264
+ type: string
265
+ enum:
266
+ - 'world'
267
+ - 'stanford'
268
+ - 'location-based'
269
+ - 'citation-only'
270
+ - 'dark'
271
+ controlledDigitalLending:
272
+ description: Available for controlled digital lending.
273
+ type: boolean
274
+ copyright:
275
+ description: The human readable copyright statement that applies
276
+ example: Copyright World Trade Organization
277
+ type: string
278
+ download:
279
+ description: >
280
+ Download access level. This is used in the transition from Fedora as
281
+ a way to set a default download level at registration that is copied
282
+ down to all the files.
283
+
284
+ type: string
285
+ enum:
286
+ - 'world'
287
+ - 'stanford'
288
+ - 'location-based'
289
+ - 'none'
290
+ readLocation:
291
+ description: >
292
+ If access is "location-based", which location should have access.
293
+ This is used in the transition from Fedora as a way to set a default
294
+ readLocation at registration that is copied down to all the files.
295
+
296
+ type: string
297
+ enum:
298
+ - 'spec'
299
+ - 'music'
300
+ - 'ars'
301
+ - 'art'
302
+ - 'hoover'
303
+ - 'm&m'
304
+ useAndReproductionStatement:
305
+ description: The human readable use and reproduction statement that applies
306
+ 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).
307
+ type: string
308
+ license:
309
+ description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
310
+ type: string
241
311
  AppliesTo:
242
312
  description: Property model for indicating the parts, aspects, or versions of the resource to which a
243
313
  descriptive element is applicable.
@@ -248,6 +318,17 @@ components:
248
318
  type: array
249
319
  items:
250
320
  $ref: "#/components/schemas/DescriptiveBasicValue"
321
+ Barcode:
322
+ description: 'A barcode'
323
+ oneOf:
324
+ - $ref: '#/components/schemas/BusinessBarcode'
325
+ - $ref: '#/components/schemas/CatkeyBarcode'
326
+ - $ref: '#/components/schemas/StandardBarcode'
327
+ BusinessBarcode:
328
+ description: The barcode associated with a business library DRO object, prefixed with 2050
329
+ type: string
330
+ pattern: '^2050[0-9]{7}$'
331
+ example: 20503740296
251
332
  CatalogLink:
252
333
  type: object
253
334
  additionalProperties: false
@@ -263,6 +344,11 @@ components:
263
344
  description: Record identifier that is unique within the context of the linked record's catalog.
264
345
  type: string
265
346
  example: 11403803
347
+ CatkeyBarcode:
348
+ description: The barcode associated with a DRO object based on catkey, prefixed with 36105
349
+ type: string
350
+ pattern: '^[0-9]+-[0-9]+$'
351
+ example: 6772719-1001
266
352
  Collection:
267
353
  description: A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
268
354
  type: object
@@ -809,6 +895,9 @@ components:
809
895
  description: The human readable use and reproduction statement that applies
810
896
  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).
811
897
  type: string
898
+ license:
899
+ description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
900
+ type: string
812
901
  DROStructural:
813
902
  description: Structural metadata
814
903
  type: object
@@ -1083,6 +1172,8 @@ components:
1083
1172
  type: array
1084
1173
  items:
1085
1174
  $ref: '#/components/schemas/CatalogLink'
1175
+ barcode:
1176
+ $ref: '#/components/schemas/Barcode'
1086
1177
  Language:
1087
1178
  description: Languages, scripts, symbolic systems, and notations used in all
1088
1179
  or part of a resource or its descriptive metadata.
@@ -1502,6 +1593,8 @@ components:
1502
1593
  type: array
1503
1594
  items:
1504
1595
  $ref: '#/components/schemas/CatalogLink'
1596
+ barcode:
1597
+ $ref: '#/components/schemas/Barcode'
1505
1598
  required:
1506
1599
  - sourceId
1507
1600
  Sequence:
@@ -1581,6 +1674,11 @@ components:
1581
1674
  type: string
1582
1675
  source:
1583
1676
  $ref: "#/components/schemas/Source"
1677
+ StandardBarcode:
1678
+ description: The standard barcode associated with a DRO object, prefixed with 36105
1679
+ type: string
1680
+ pattern: '^36105[0-9]{9}$'
1681
+ example: 36105010362304
1584
1682
  Title:
1585
1683
  type: object
1586
1684
  additionalProperties: false
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.55.0
4
+ version: 0.58.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-12 00:00:00.000000000 Z
11
+ date: 2021-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -258,9 +258,12 @@ files:
258
258
  - lib/cocina/models/access_role_member.rb
259
259
  - lib/cocina/models/admin_policy.rb
260
260
  - lib/cocina/models/admin_policy_administrative.rb
261
+ - lib/cocina/models/admin_policy_default_access.rb
261
262
  - lib/cocina/models/administrative.rb
262
263
  - lib/cocina/models/applies_to.rb
264
+ - lib/cocina/models/business_barcode.rb
263
265
  - lib/cocina/models/catalog_link.rb
266
+ - lib/cocina/models/catkey_barcode.rb
264
267
  - lib/cocina/models/checkable.rb
265
268
  - lib/cocina/models/collection.rb
266
269
  - lib/cocina/models/collection_identification.rb
@@ -307,6 +310,7 @@ files:
307
310
  - lib/cocina/models/source.rb
308
311
  - lib/cocina/models/source_id.rb
309
312
  - lib/cocina/models/standard.rb
313
+ - lib/cocina/models/standard_barcode.rb
310
314
  - lib/cocina/models/title.rb
311
315
  - lib/cocina/models/validator.rb
312
316
  - lib/cocina/models/version.rb