lib/bolognese/readers/datacite_reader.rb in bolognese-1.0.31 vs lib/bolognese/readers/datacite_reader.rb in bolognese-1.0.32

- old
+ new

@@ -75,10 +75,12 @@ else id = normalize_doi(meta.dig("identifier", "__content__") || options[:id], sandbox: options[:sandbox]) end identifiers = [{ "identifierType" => "DOI", "identifier" => id }] + Array.wrap(meta.dig("alternateIdentifiers", "alternateIdentifier")).map do |r| - { "identifierType" => get_identifier_type(r["alternateIdentifierType"]), "identifier" => r["__content__"].presence }.compact + if r["__content__"].present? + { "identifierType" => get_identifier_type(r["alternateIdentifierType"]), "identifier" => r["__content__"] } + end end.compact doi = Array.wrap(identifiers).find { |r| r["identifierType"] == "DOI" }.to_h.fetch("identifier", nil) resource_type_general = meta.dig("resourceType", "resourceTypeGeneral")