diff --git a/Gemfile b/Gemfile index 0f0e07ef3..406a1b37a 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'rails', '~> 7.0' # DLSS/domain-specific dependencies -gem 'cocina-models', '~> 0.86.0' +gem 'cocina-models', '~> 0.87.0' gem 'datacite', '~> 0.3.0' gem 'dor-workflow-client', '~> 5.0' gem 'druid-tools', '~> 2.2' diff --git a/Gemfile.lock b/Gemfile.lock index 29b5d05b0..9cb8afe4f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -103,7 +103,7 @@ GEM capistrano-bundler (>= 1.1, < 3) capistrano-shared_configs (0.2.2) chronic (0.10.2) - cocina-models (0.86.0) + cocina-models (0.87.0) activesupport deprecation dry-struct (~> 1.0) @@ -282,12 +282,12 @@ GEM net-protocol net-ssh (7.0.1) nio4r (2.5.8) - nokogiri (1.14.1) + nokogiri (1.14.2) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.14.1-x86_64-darwin) + nokogiri (1.14.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.1-x86_64-linux) + nokogiri (1.14.2-x86_64-linux) racc (~> 1.4) nokogiri-happymapper (0.9.0) nokogiri (~> 1.5) @@ -488,7 +488,7 @@ DEPENDENCIES capistrano-passenger capistrano-rails capistrano-shared_configs - cocina-models (~> 0.86.0) + cocina-models (~> 0.87.0) committee (~> 4.4) config datacite (~> 0.3.0) diff --git a/openapi.yml b/openapi.yml index dde9a0991..4599922b4 100644 --- a/openapi.yml +++ b/openapi.yml @@ -1454,19 +1454,6 @@ components: required: - identifier - type - Administrative: - type: object - additionalProperties: false - properties: - hasAdminPolicy: - $ref: '#/components/schemas/Druid' - releaseTags: - description: Tags for release - type: array - items: - $ref: '#/components/schemas/ReleaseTag' - required: - - hasAdminPolicy AdminPolicy: type: object additionalProperties: true @@ -1494,40 +1481,19 @@ components: - label - type - version - AdminPolicyAdministrative: - description: Administrative properties for an AdminPolicy + Administrative: type: object additionalProperties: false properties: - accessTemplate: - $ref: '#/components/schemas/AdminPolicyAccessTemplate' - registrationWorkflow: - description: When you register an item with this admin policy, these are the workflows that are available. - type: array - items: - type: string - disseminationWorkflow: - description: An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete - example: wasCrawlPreassemblyWF - type: string - collectionsForRegistration: - description: When you register an item with this admin policy, these are the collections that are available. - type: array - items: - type: string hasAdminPolicy: $ref: '#/components/schemas/Druid' - hasAgreement: - $ref: '#/components/schemas/Druid' - roles: - description: The access roles conferred by this AdminPolicy (used by Argo) + releaseTags: + description: Tags for release type: array items: - $ref: '#/components/schemas/AccessRole' + $ref: '#/components/schemas/ReleaseTag' required: - hasAdminPolicy - - hasAgreement - - accessTemplate AdminPolicyAccessTemplate: description: 'Provides the template of access settings that is copied to the items goverend by an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.' type: object @@ -1586,6 +1552,40 @@ components: description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.). type: string nullable: true + AdminPolicyAdministrative: + description: Administrative properties for an AdminPolicy + type: object + additionalProperties: false + properties: + accessTemplate: + $ref: '#/components/schemas/AdminPolicyAccessTemplate' + registrationWorkflow: + description: When you register an item with this admin policy, these are the workflows that are available. + type: array + items: + type: string + disseminationWorkflow: + description: An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete + example: wasCrawlPreassemblyWF + type: string + collectionsForRegistration: + description: When you register an item with this admin policy, these are the collections that are available. + type: array + items: + type: string + hasAdminPolicy: + $ref: '#/components/schemas/Druid' + hasAgreement: + $ref: '#/components/schemas/Druid' + roles: + description: The access roles conferred by this AdminPolicy (used by Argo) + type: array + items: + $ref: '#/components/schemas/AccessRole' + required: + - hasAdminPolicy + - hasAgreement + - accessTemplate AppliesTo: description: Property model for indicating the parts, aspects, or versions of the resource to which a descriptive element is applicable. @@ -1608,37 +1608,11 @@ components: type: string pattern: '^2050[0-9]{7}$' example: '20503740296' - LaneMedicalBarcode: - description: The barcode associated with a Lane Medical Library DRO object, prefixed with 245 - type: string - pattern: '^245[0-9]{8}$' - example: '24503259768' CatalogLink: - type: object - additionalProperties: false - properties: - catalog: - description: Catalog that is the source of the linked record. - type: string - enum: - - symphony - - previous symphony - example: symphony - refresh: - description: Only one of the catkeys should be designated for refreshing. - This means that this key is the one used to pull metadata from the catalog - if there is more than one key present. - type: boolean - default: false - catalogRecordId: - description: Record identifier that is unique within the context of the linked record's catalog. - type: string - pattern: '^\d+(:\d+)*$' - example: '11403803' - required: - - catalog - - catalogRecordId - - refresh + description: 'A linkage between an object and a catalog record' + oneOf: + - $ref: '#/components/schemas/FolioCatalogLink' + - $ref: '#/components/schemas/SymphonyCatalogLink' CatkeyBarcode: description: The barcode associated with a DRO object based on catkey, prefixed with a catkey followed by a hyphen type: string @@ -1682,7 +1656,7 @@ components: additionalProperties: true properties: cocinaVersion: - $ref: '#/components/schemas/CocinaVersion' + $ref: '#/components/schemas/CocinaVersion' type: description: The content type of the Collection. Selected from an established set of values. type: string @@ -1766,7 +1740,7 @@ components: items: $ref: "#/components/schemas/DescriptiveValue" type: - description: Entity type of the contributor (person, organization, etc.). + description: Entity type of the contributor (person, organization, etc.). See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md for valid types. type: string status: description: Status of the contributor relative to other parallel contributors @@ -1822,6 +1796,147 @@ components: required: - view - download + CreatedInFolioIdentifier: + description: A record identifier created in Folio + type: string + pattern: '^in\d+$' + example: 'in11403803' + DOI: + description: Digital Object Identifier (https://www.doi.org) + oneOf: + - $ref: '#/components/schemas/DoiPattern' + - $ref: '#/components/schemas/DoiExceptions' + DRO: + description: Domain-defined abstraction of a 'work'. Digital Repository Objects' abstraction is describable for our domain’s purposes, i.e. for management needs within our system. + type: object + additionalProperties: true + properties: + cocinaVersion: + $ref: '#/components/schemas/CocinaVersion' + type: + description: The content type of the DRO. Selected from an established set of values. + type: string + enum: + - 'https://cocina.sul.stanford.edu/models/object' + - 'https://cocina.sul.stanford.edu/models/3d' + - 'https://cocina.sul.stanford.edu/models/agreement' + - 'https://cocina.sul.stanford.edu/models/book' + - 'https://cocina.sul.stanford.edu/models/document' + - 'https://cocina.sul.stanford.edu/models/geo' + - 'https://cocina.sul.stanford.edu/models/image' + - 'https://cocina.sul.stanford.edu/models/page' + - 'https://cocina.sul.stanford.edu/models/photograph' + - 'https://cocina.sul.stanford.edu/models/manuscript' + - 'https://cocina.sul.stanford.edu/models/map' + - 'https://cocina.sul.stanford.edu/models/media' + - 'https://cocina.sul.stanford.edu/models/track' + - 'https://cocina.sul.stanford.edu/models/webarchive-binary' + - 'https://cocina.sul.stanford.edu/models/webarchive-seed' + externalIdentifier: + $ref: '#/components/schemas/Druid' + label: + description: Primary processing label (can be same as title) for a DRO. + type: string + version: + description: Version for the DRO within SDR. + type: integer + access: + $ref: '#/components/schemas/DROAccess' + administrative: + $ref: '#/components/schemas/Administrative' + description: + $ref: '#/components/schemas/Description' + identification: + $ref: '#/components/schemas/Identification' + structural: + $ref: '#/components/schemas/DROStructural' + geographic: + $ref: '#/components/schemas/Geographic' + required: + - cocinaVersion + - access + - administrative + - description + - externalIdentifier + - label + - type + - version + - identification + - structural + DROAccess: + type: object + additionalProperties: false + allOf: + - $ref: "#/components/schemas/Access" + - type: object + properties: + copyright: + description: The human readable copyright statement that applies + example: Copyright World Trade Organization + type: string + nullable: true + embargo: + $ref: '#/components/schemas/Embargo' + useAndReproductionStatement: + description: The human readable use and reproduction statement that applies + 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). + type: string + nullable: true + license: + description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.). + type: string + nullable: true + 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/' # Non cannonical, but in some of our data + - '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' # Only used in some legacy ETDs and not actually permitted per the Project Chimera docs. + DROStructural: + description: Structural metadata + type: object + additionalProperties: false + properties: + contains: + description: Filesets that contain the digital representations (Files) + type: array + items: + $ref: '#/components/schemas/FileSet' + hasMemberOrders: + description: Provided sequences or orderings of members, including some metadata about each sequence (i.e. sequence label, sequence type, if the sequence is primary, etc.). + type: array + items: + $ref: '#/components/schemas/Sequence' + isMemberOf: + description: Collections that this DRO is a member of + type: array + items: + $ref: '#/components/schemas/Druid' DarkAccess: type: object properties: @@ -1838,7 +1953,7 @@ components: enum: - 'none' location: - description: If access is "location-based", which location should have access. + description: Not used for this access type, must be null. type: string nullable: true default: null @@ -1933,9 +2048,9 @@ components: items: $ref: "#/components/schemas/DescriptiveValue" DescriptiveBasicValue: - description: Basic value model for descriptive elements. + description: Basic value model for descriptive elements. Can only have one of value, parallelValue, groupedValue, or structuredValue. type: object - # additionalProperties breaks the validator, unclear as to why. + # additionalProperties breaks the validator for allOf, unclear as to why. # additionalProperties: false allOf: - $ref: "#/components/schemas/DescriptiveStructuredValue" @@ -1948,13 +2063,13 @@ components: value: description: String or integer value of the descriptive element. oneOf: - - type: string + - type: string # Title note (nonsorting character count) was supposed to be able to accept an integer value, # but this triggered a bug in committee: # https://github.com/interagent/committee/issues/286 # - type: integer type: - description: Type of value provided by the descriptive element. + description: Type of value provided by the descriptive element. See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md for valid types. type: string status: description: Status of the descriptive element value relative to other instances @@ -1977,7 +2092,7 @@ components: description: Identifiers and URIs associated with the descriptive element. type: array items: - $ref: "#/components/schemas/DescriptiveValue" + $ref: "#/components/schemas/DescriptiveValue" source: $ref: "#/components/schemas/Source" displayLabel: @@ -2031,7 +2146,7 @@ components: items: $ref: "#/components/schemas/DescriptiveValue" type: - description: Entity type of the contributor (person, organization, etc.). + description: Entity type of the contributor (person, organization, etc.). See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md for valid types. type: string status: description: Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors). @@ -2104,185 +2219,50 @@ components: description: Value model for multiple representations of the same information (e.g. in different languages). type: object additionalProperties: false - properties: - parallelValue: - type: array - items: - $ref: "#/components/schemas/DescriptiveValue" - DescriptiveStructuredValue: - description: Value model for descriptive elements structured as typed, ordered values. - type: object - additionalProperties: false - properties: - structuredValue: - type: array - items: - $ref: "#/components/schemas/DescriptiveValue" - DescriptiveValue: - description: Default value model for descriptive elements. - type: object - additionalProperties: false - allOf: - - $ref: "#/components/schemas/DescriptiveBasicValue" - - $ref: "#/components/schemas/AppliesTo" - DescriptiveValueLanguage: - description: Language of the descriptive element value - type: object - additionalProperties: false - allOf: - - $ref: "#/components/schemas/Standard" - - type: object - properties: - valueScript: - $ref: '#/components/schemas/Standard' - # description: An alphabet or other notation used to represent a - # language or other symbolic system of the descriptive element value. - DOI: - description: Digital Object Identifier (https://www.doi.org) - oneOf: - - $ref: '#/components/schemas/DoiPattern' - - $ref: '#/components/schemas/DoiExceptions' - DoiExceptions: - type: string - description: pre-existing Digital Object Identifiers (https://www.doi.org) not matching the pattern (case insensitive) - pattern: '^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)$' - example: '10.25740/12qF-5243' - DoiPattern: - type: string - description: Digital Object Identifier (https://www.doi.org) regex pattern # The prod and test prefixes are permitted - pattern: '^10\.(25740|80343)\/[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$' - example: '10.25740/bc123df4567' - DRO: - description: Domain-defined abstraction of a 'work'. Digital Repository Objects' abstraction is describable for our domain’s purposes, i.e. for management needs within our system. - type: object - additionalProperties: true - properties: - cocinaVersion: - $ref: '#/components/schemas/CocinaVersion' - type: - description: The content type of the DRO. Selected from an established set of values. - type: string - enum: - - 'https://cocina.sul.stanford.edu/models/object' - - 'https://cocina.sul.stanford.edu/models/3d' - - 'https://cocina.sul.stanford.edu/models/agreement' - - 'https://cocina.sul.stanford.edu/models/book' - - 'https://cocina.sul.stanford.edu/models/document' - - 'https://cocina.sul.stanford.edu/models/geo' - - 'https://cocina.sul.stanford.edu/models/image' - - 'https://cocina.sul.stanford.edu/models/page' - - 'https://cocina.sul.stanford.edu/models/photograph' - - 'https://cocina.sul.stanford.edu/models/manuscript' - - 'https://cocina.sul.stanford.edu/models/map' - - 'https://cocina.sul.stanford.edu/models/media' - - 'https://cocina.sul.stanford.edu/models/track' - - 'https://cocina.sul.stanford.edu/models/webarchive-binary' - - 'https://cocina.sul.stanford.edu/models/webarchive-seed' - externalIdentifier: - $ref: '#/components/schemas/Druid' - label: - description: Primary processing label (can be same as title) for a DRO. - type: string - version: - description: Version for the DRO within SDR. - type: integer - access: - $ref: '#/components/schemas/DROAccess' - administrative: - $ref: '#/components/schemas/Administrative' - description: - $ref: '#/components/schemas/Description' - identification: - $ref: '#/components/schemas/Identification' - structural: - $ref: '#/components/schemas/DROStructural' - geographic: - $ref: '#/components/schemas/Geographic' - required: - - cocinaVersion - - access - - administrative - - description - - externalIdentifier - - label - - type - - version - - identification - - structural - DROAccess: - type: object - additionalProperties: false - allOf: - - $ref: "#/components/schemas/Access" - - type: object - properties: - copyright: - description: The human readable copyright statement that applies - example: Copyright World Trade Organization - type: string - nullable: true - embargo: - $ref: '#/components/schemas/Embargo' - useAndReproductionStatement: - description: The human readable use and reproduction statement that applies - 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). - type: string - nullable: true - license: - description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.). - type: string - nullable: true - 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/' # Non cannonical, but in some of our data - - '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' # Only used in some legacy ETDs and not actually permitted per the Project Chimera docs. - DROStructural: - description: Structural metadata - type: object - additionalProperties: false - properties: - contains: - description: Filesets that contain the digital representations (Files) - type: array - items: - $ref: '#/components/schemas/FileSet' - hasMemberOrders: - description: Provided sequences or orderings of members, including some metadata about each sequence (i.e. sequence label, sequence type, if the sequence is primary, etc.). + properties: + parallelValue: type: array items: - $ref: '#/components/schemas/Sequence' - isMemberOf: - description: Collections that this DRO is a member of + $ref: "#/components/schemas/DescriptiveValue" + DescriptiveStructuredValue: + description: Value model for descriptive elements structured as typed, ordered values. + type: object + additionalProperties: false + properties: + structuredValue: type: array items: - $ref: '#/components/schemas/Druid' + $ref: "#/components/schemas/DescriptiveValue" + DescriptiveValue: + description: Default value model for descriptive elements. + type: object + additionalProperties: false + allOf: + - $ref: "#/components/schemas/DescriptiveBasicValue" + - $ref: "#/components/schemas/AppliesTo" + DescriptiveValueLanguage: + description: Language of the descriptive element value + type: object + additionalProperties: false + allOf: + - $ref: "#/components/schemas/Standard" + - type: object + properties: + valueScript: + $ref: '#/components/schemas/Standard' + # description: An alphabet or other notation used to represent a + # language or other symbolic system of the descriptive element value. + DoiExceptions: + type: string + description: pre-existing Digital Object Identifiers (https://www.doi.org) not matching the pattern (case insensitive) + pattern: '^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)$' + example: '10.25740/12qF-5243' + DoiPattern: + type: string + description: Digital Object Identifier (https://www.doi.org) regex pattern + # The prod and test prefixes are permitted + pattern: '^10\.(25740|80343)\/[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$' + example: '10.25740/bc123df4567' Druid: type: string pattern: '^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$' @@ -2483,6 +2463,34 @@ components: type: array items: $ref: '#/components/schemas/File' + FolioCatalogLink: + description: A linkage between an object and a Folio catalog record + type: object + additionalProperties: false + properties: + catalog: + description: Catalog that is the source of the linked record. + type: string + enum: + - folio + - previous folio + example: folio + refresh: + description: Only one of the catkeys should be designated for refreshing. + This means that this key is the one used to pull metadata from the catalog + if there is more than one key present. + type: boolean + default: false + catalogRecordId: + description: Record identifier that is unique within the context of the linked record's catalog. + oneOf: + - $ref: '#/components/schemas/MigratedFromSymphonyIdentifier' + - $ref: '#/components/schemas/MigratedFromVoyagerIdentifier' + - $ref: '#/components/schemas/CreatedInFolioIdentifier' + required: + - catalog + - catalogRecordId + - refresh Geographic: description: Geographic metadata type: object @@ -2509,6 +2517,11 @@ components: $ref: '#/components/schemas/SourceId' required: - sourceId + LaneMedicalBarcode: + description: The barcode associated with a Lane Medical Library DRO object, prefixed with 245 + type: string + pattern: '^245[0-9]{8}$' + example: '24503259768' Language: description: Languages, scripts, symbolic systems, and notations used in all or part of a resource or its descriptive metadata. @@ -2661,6 +2674,16 @@ components: required: - type - digest + MigratedFromSymphonyIdentifier: + description: A record identifier migrated from Symphony + type: string + pattern: '^a\d+$' + example: 'a11403803' + MigratedFromVoyagerIdentifier: + description: A record identifier migrated from Voyager + type: string + pattern: '^L\d+$' + example: 'L11403803' Presentation: description: Presentation data for the File. type: object @@ -2673,7 +2696,7 @@ components: description: Width in pixels type: integer Purl: - description: Stanford persistent URL associated with the related resource. Note this is http, not https. + description: Stanford persistent URL associated with the related resource. type: string format: uri # Canonical URI is https @@ -2783,18 +2806,6 @@ components: example: Searchworks release: type: boolean - RequestAdministrative: - type: object - additionalProperties: false - allOf: - - $ref: "#/components/schemas/Administrative" - - type: object - additionalProperties: false - properties: - partOfProject: - description: Internal project this resource is a part of. This governs routing of messages about this object. - example: Google Books - type: string RequestAdminPolicy: description: Same as an AdminPolicy, but doesn't have an externalIdentifier as one will be created type: object @@ -2823,10 +2834,22 @@ components: - label - type - version + RequestAdministrative: + type: object + additionalProperties: false + allOf: + - $ref: "#/components/schemas/Administrative" + - type: object + additionalProperties: false + properties: + partOfProject: + description: Internal project this resource is a part of. This governs routing of messages about this object. + example: Google Books + type: string RequestCollection: description: Same as a Collection, but doesn't have an externalIdentifier as one will be created type: object - additionalProperties: false + additionalProperties: true properties: cocinaVersion: $ref: '#/components/schemas/CocinaVersion' @@ -2860,6 +2883,75 @@ components: - label - type - version + RequestDRO: + description: A request to create a DRO. This has the same general structure as a DRO but doesn't have externalIdentifier and doesn't require the access subschema. If no access subschema is provided, these values will be inherited from the AdminPolicy. + type: object + additionalProperties: true + properties: + cocinaVersion: + $ref: '#/components/schemas/CocinaVersion' + type: + type: string + enum: + - 'https://cocina.sul.stanford.edu/models/object' + - 'https://cocina.sul.stanford.edu/models/3d' + - 'https://cocina.sul.stanford.edu/models/agreement' + - 'https://cocina.sul.stanford.edu/models/book' + - 'https://cocina.sul.stanford.edu/models/document' + - 'https://cocina.sul.stanford.edu/models/geo' + - 'https://cocina.sul.stanford.edu/models/image' + - 'https://cocina.sul.stanford.edu/models/page' + - 'https://cocina.sul.stanford.edu/models/photograph' + - 'https://cocina.sul.stanford.edu/models/manuscript' + - 'https://cocina.sul.stanford.edu/models/map' + - 'https://cocina.sul.stanford.edu/models/media' + - 'https://cocina.sul.stanford.edu/models/track' + - 'https://cocina.sul.stanford.edu/models/webarchive-binary' + - 'https://cocina.sul.stanford.edu/models/webarchive-seed' + label: + type: string + version: + type: integer + default: 1 + enum: + - 1 + access: + $ref: '#/components/schemas/DROAccess' + administrative: + $ref: '#/components/schemas/RequestAdministrative' + description: + $ref: '#/components/schemas/RequestDescription' + identification: + $ref: '#/components/schemas/RequestIdentification' + structural: + $ref: '#/components/schemas/RequestDROStructural' + geographic: + $ref: '#/components/schemas/Geographic' + required: + - cocinaVersion + - administrative + - identification + - label + - type + - version + RequestDROStructural: + description: Structural metadata + type: object + additionalProperties: false + properties: + contains: + type: array + items: + $ref: '#/components/schemas/RequestFileSet' + hasMemberOrders: + type: array + items: + $ref: '#/components/schemas/Sequence' + isMemberOf: + description: Collections that this DRO is a member of + type: array + items: + $ref: '#/components/schemas/Druid' RequestDescription: description: Description that is included in a request to create a DRO. This is the same as a Description, except excludes PURL. type: object @@ -2933,78 +3025,6 @@ components: type: string required: - title - RequestDRO: - description: A request to create a DRO. This has the same general structure as a DRO but doesn't have externalIdentifier and doesn't require the access subschema. If no access subschema is provided, these values will be inherited from the AdminPolicy. - type: object - # There is a bug in Committee (https://github.com/interagent/committee/issues/328) that causes validation errors when - # validating a request that has query parameters and a request body. - # Since POST /v1/objects has both, setting additionalProperties to true. - additionalProperties: true - properties: - cocinaVersion: - $ref: '#/components/schemas/CocinaVersion' - type: - type: string - enum: - - 'https://cocina.sul.stanford.edu/models/object' - - 'https://cocina.sul.stanford.edu/models/3d' - - 'https://cocina.sul.stanford.edu/models/agreement' - - 'https://cocina.sul.stanford.edu/models/book' - - 'https://cocina.sul.stanford.edu/models/document' - - 'https://cocina.sul.stanford.edu/models/geo' - - 'https://cocina.sul.stanford.edu/models/image' - - 'https://cocina.sul.stanford.edu/models/page' - - 'https://cocina.sul.stanford.edu/models/photograph' - - 'https://cocina.sul.stanford.edu/models/manuscript' - - 'https://cocina.sul.stanford.edu/models/map' - - 'https://cocina.sul.stanford.edu/models/media' - - 'https://cocina.sul.stanford.edu/models/track' - - 'https://cocina.sul.stanford.edu/models/webarchive-binary' - - 'https://cocina.sul.stanford.edu/models/webarchive-seed' - label: - type: string - version: - type: integer - default: 1 - enum: - - 1 - access: - $ref: '#/components/schemas/DROAccess' - administrative: - $ref: '#/components/schemas/RequestAdministrative' - description: - $ref: '#/components/schemas/RequestDescription' - identification: - $ref: '#/components/schemas/RequestIdentification' - structural: - $ref: '#/components/schemas/RequestDROStructural' - geographic: - $ref: '#/components/schemas/Geographic' - required: - - cocinaVersion - - administrative - - identification - - label - - type - - version - RequestDROStructural: - description: Structural metadata - type: object - additionalProperties: false - properties: - contains: - type: array - items: - $ref: '#/components/schemas/RequestFileSet' - hasMemberOrders: - type: array - items: - $ref: '#/components/schemas/Sequence' - isMemberOf: - description: Collections that this DRO is a member of - type: array - items: - $ref: '#/components/schemas/Druid' RequestFile: type: object additionalProperties: false @@ -3089,7 +3109,9 @@ components: items: $ref: '#/components/schemas/RequestFile' RequestIdentification: - description: Same as a Identification, but requires a sourceId. + # Doesn't permit a DOI because our DOIs all use the DRUID as part of the DOI. + # You have to register the object in order to get the DRUID before you can mint a DOI + description: Same as a Identification, but requires a sourceId and doesn't permit a DOI. type: object additionalProperties: false properties: @@ -3213,6 +3235,33 @@ components: required: - view - download + SymphonyCatalogLink: + description: A linkage between an object and a Symphony catalog record + type: object + additionalProperties: false + properties: + catalog: + description: Catalog that is the source of the linked record. + type: string + enum: + - symphony + - previous symphony + example: symphony + refresh: + description: Only one of the catkeys should be designated for refreshing. + This means that this key is the one used to pull metadata from the catalog + if there is more than one key present. + type: boolean + default: false + catalogRecordId: + description: Record identifier that is unique within the context of the linked record's catalog. + type: string + pattern: '^\d+$' + example: '11403803' + required: + - catalog + - catalogRecordId + - refresh Title: type: object additionalProperties: false diff --git a/spec/services/cocina/mapping/descriptive/h2_datacite/identifiers_h2_datacite_spec.rb b/spec/services/cocina/mapping/descriptive/h2_datacite/identifiers_h2_datacite_spec.rb index 55a801eae..f314a337d 100644 --- a/spec/services/cocina/mapping/descriptive/h2_datacite/identifiers_h2_datacite_spec.rb +++ b/spec/services/cocina/mapping/descriptive/h2_datacite/identifiers_h2_datacite_spec.rb @@ -4,7 +4,7 @@ RSpec.describe 'Cocina --> DataCite mappings for identifier and alternateIdentifier (H2 specific)' do # NOTE: Because we haven't set a title in this Cocina::Models::Description, it will not validate against the openapi. - let(:cocina_description) { Cocina::Models::Description.new(cocina.merge(purl: cocina.fetch(:purl, 'https://purl.stanford.edu/aa666bb1234')), false, false) } + let(:cocina_description) { Cocina::Models::Description.new(cocina.merge(purl: cocina.fetch(:purl, 'https://purl.stanford.edu/gz708sf9862')), false, false) } let(:identifier_attributes) { Cocina::ToDatacite::Identifier.identifier_attributes(cocina_description) } let(:alternate_identifier_attributes) { Cocina::ToDatacite::Identifier.alternate_identifier_attributes(cocina_description) } @@ -32,17 +32,17 @@ end describe 'purl' do - # purl: http://purl.stanford.edu/gz708sf9862 + # purl: https://purl.stanford.edu/gz708sf9862 let(:cocina) do { - purl: 'http://purl.stanford.edu/gz708sf9862' + purl: 'https://purl.stanford.edu/gz708sf9862' } end it 'populates alternate_identifier_attributes correctly' do expect(alternate_identifier_attributes).to eq [ { - alternateIdentifier: 'http://purl.stanford.edu/gz708sf9862', + alternateIdentifier: 'https://purl.stanford.edu/gz708sf9862', alternateIdentifierType: 'PURL' } ] diff --git a/spec/services/cocina/mapping/descriptive/h2_datacite/note_h2_datacite_spec.rb b/spec/services/cocina/mapping/descriptive/h2_datacite/note_h2_datacite_spec.rb index 146868bbc..447b8c3ac 100644 --- a/spec/services/cocina/mapping/descriptive/h2_datacite/note_h2_datacite_spec.rb +++ b/spec/services/cocina/mapping/descriptive/h2_datacite/note_h2_datacite_spec.rb @@ -4,7 +4,7 @@ RSpec.describe 'Cocina --> DataCite mappings for note' do # NOTE: Because we haven't set a title in this Cocina::Models::Description, it will not validate against the openapi. - let(:cocina_description) { Cocina::Models::Description.new(cocina.merge(purl: cocina.fetch(:purl, 'https://purl.stanford.edu/aa666bb1234')), false, false) } + let(:cocina_description) { Cocina::Models::Description.new(cocina.merge(purl: cocina.fetch(:purl, 'https://purl.stanford.edu/gz708sf9862')), false, false) } let(:descriptions_attributes) { Cocina::ToDatacite::Note.descriptions_attributes(cocina_description) } describe 'Abstract' do diff --git a/spec/services/cocina/mapping/descriptive/h2_datacite/related_resource_h2_datacite_spec.rb b/spec/services/cocina/mapping/descriptive/h2_datacite/related_resource_h2_datacite_spec.rb index 7509e6702..4291d0e60 100644 --- a/spec/services/cocina/mapping/descriptive/h2_datacite/related_resource_h2_datacite_spec.rb +++ b/spec/services/cocina/mapping/descriptive/h2_datacite/related_resource_h2_datacite_spec.rb @@ -8,7 +8,7 @@ # relatedItem attribute new in DataCite MetadataKerne schema v. 4.4 and not included in the DataCite ReST API docs as of 2021-07 RSpec.describe 'Cocina --> DataCite mappings for relatedItem' do # NOTE: Because we haven't set a title in this Cocina::Models::Description, it will not validate against the openapi. - let(:cocina_description) { Cocina::Models::Description.new(cocina.merge(purl: cocina.fetch(:purl, 'https://purl.stanford.edu/aa666bb1234')), false, false) } + let(:cocina_description) { Cocina::Models::Description.new(cocina.merge(purl: cocina.fetch(:purl, 'https://purl.stanford.edu/gz708sf9862')), false, false) } let(:related_item_attributes) { Cocina::ToDatacite::RelatedResource.related_item_attributes(cocina_description) } describe 'Related citation' do diff --git a/spec/services/cocina/mapping/descriptive/h2_datacite/subject_h2_datacite_spec.rb b/spec/services/cocina/mapping/descriptive/h2_datacite/subject_h2_datacite_spec.rb index f8b1898a5..adfaa2259 100644 --- a/spec/services/cocina/mapping/descriptive/h2_datacite/subject_h2_datacite_spec.rb +++ b/spec/services/cocina/mapping/descriptive/h2_datacite/subject_h2_datacite_spec.rb @@ -4,7 +4,7 @@ RSpec.describe 'Cocina --> DataCite mappings for FAST subjects' do # NOTE: Because we haven't set a title in this Cocina::Models::Description, it will not validate against the openapi. - let(:cocina_description) { Cocina::Models::Description.new(cocina.merge(purl: cocina.fetch(:purl, 'https://purl.stanford.edu/aa666bb1234')), false, false) } + let(:cocina_description) { Cocina::Models::Description.new(cocina.merge(purl: cocina.fetch(:purl, 'https://purl.stanford.edu/gz708sf9862')), false, false) } let(:subjects_attributes) { Cocina::ToDatacite::Subject.subjects_attributes(cocina_description) } describe 'FAST topic' do diff --git a/spec/services/refresh_metadata_action_spec.rb b/spec/services/refresh_metadata_action_spec.rb index a93f0798b..0589bea51 100644 --- a/spec/services/refresh_metadata_action_spec.rb +++ b/spec/services/refresh_metadata_action_spec.rb @@ -77,7 +77,7 @@ end describe '#identifiers' do - subject(:indentifiers) { described_class.identifiers(cocina_object:) } + subject(:identifiers) { described_class.identifiers(cocina_object:) } let(:identification) { instance_double(Cocina::Models::RequestIdentification, catalogLinks: catalog_links) } let(:cocina_object) do @@ -86,13 +86,13 @@ context 'when a valid identifier' do let(:catalog_links) do - [Cocina::Models::CatalogLink.new(catalog: 'symphony', catalogRecordId: 'nope123', refresh: false), - Cocina::Models::CatalogLink.new(catalog: 'symphony', catalogRecordId: 'yup123', refresh: true), - Cocina::Models::CatalogLink.new(catalog: 'previous symphony', catalogRecordId: 'old123', refresh: true)] + [Cocina::Models::CatalogLink[catalog: 'folio', catalogRecordId: 'a123', refresh: false], + Cocina::Models::CatalogLink[catalog: 'symphony', catalogRecordId: '123', refresh: true], + Cocina::Models::CatalogLink[catalog: 'previous symphony', catalogRecordId: '1234', refresh: true]] end it 'returns only the valid symphony identifier with refresh == true' do - expect(indentifiers).to eq(['catkey:yup123']) + expect(identifiers).to eq(['catkey:123']) end end @@ -100,17 +100,17 @@ let(:catalog_links) { [] } it 'returns an empty array' do - expect(indentifiers).to eq([]) + expect(identifiers).to eq([]) end end context 'when no valid identifiers' do let(:catalog_links) do - [Cocina::Models::CatalogLink.new(catalog: 'symphony', catalogRecordId: 'nope123', refresh: false)] + [Cocina::Models::CatalogLink[catalog: 'previous folio', catalogRecordId: 'in123', refresh: false]] end it 'returns an empty array' do - expect(indentifiers).to eq([]) + expect(identifiers).to eq([]) end end end