From 26cb85b39fc31f2252706e4f06ae7879d64df22b Mon Sep 17 00:00:00 2001 From: Simon Choy Date: Wed, 15 May 2024 14:20:34 -0400 Subject: [PATCH] Update DataCite schema to version 4.5 --- VERSION | 2 +- lib/ezid/metadata_transforms/datacite.rb | 2 +- spec/fixtures/datacite_xml/empty.xml | 2 +- spec/fixtures/datacite_xml/populated.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 81c871d..1cac385 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.10.0 +1.11.0 diff --git a/lib/ezid/metadata_transforms/datacite.rb b/lib/ezid/metadata_transforms/datacite.rb index f9510ba..77110c1 100644 --- a/lib/ezid/metadata_transforms/datacite.rb +++ b/lib/ezid/metadata_transforms/datacite.rb @@ -10,7 +10,7 @@ def self.transform(hsh) resource_opts = { "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", "xmlns" => "http://datacite.org/schema/kernel-4", - "xsi:schemaLocation" => "http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd" + "xsi:schemaLocation" => "http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.5/metadata.xsd" } xml_builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") { |builder| builder.resource(resource_opts) { diff --git a/spec/fixtures/datacite_xml/empty.xml b/spec/fixtures/datacite_xml/empty.xml index eba2430..105cd0c 100644 --- a/spec/fixtures/datacite_xml/empty.xml +++ b/spec/fixtures/datacite_xml/empty.xml @@ -1 +1 @@ -</titles><publisher/><publicationYear/><resourceType resourceTypeGeneral=""></resourceType><descriptions><description descriptionType="Abstract"></description></descriptions></resource> +<?xml version="1.0" encoding="UTF-8"?><resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.5/metadata.xsd"><identifier identifierType="DOI"></identifier><creators><creator><creatorName/></creator></creators><titles><title/></titles><publisher/><publicationYear/><resourceType resourceTypeGeneral=""></resourceType><descriptions><description descriptionType="Abstract"></description></descriptions></resource> diff --git a/spec/fixtures/datacite_xml/populated.xml b/spec/fixtures/datacite_xml/populated.xml index 32f2a4c..b61b650 100644 --- a/spec/fixtures/datacite_xml/populated.xml +++ b/spec/fixtures/datacite_xml/populated.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="UTF-8"?><resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd"><identifier identifierType="TestIdentifierType">TestIdentifier</identifier><creators><creator><creatorName>TestCreatorName</creatorName></creator></creators><titles><title>TestTitleTestPublisherTestPublicationYearTestResourceTypeTestDescription +TestIdentifierTestCreatorNameTestTitleTestPublisherTestPublicationYearTestResourceTypeTestDescription