datacite / bolognese

Ruby gem and command-line utility for conversion of DOI metadata
MIT License
40 stars 14 forks source link

Fix relatedItems handling #144

Closed digitaldogsbody closed 1 year ago

digitaldogsbody commented 1 year ago

Purpose

Bolognese handling of relatedItems has a couple of problems: 1) Accessing subproperties of relatedItemIdentifier, even though it is optional, causing nilClass errors when relatedItemIdentifier is absent - #139 2) Including all optional properties even when they have no data (i.e as self-terminated keys <firstPage />) - #140 3) Knock on effect of causing schema validation to fail when optional property publicationYear is absent, as it gets included as a blank element, and thus fails the datetype requirement in the XSD - https://github.com/datacite/lupo/issues/782

This PR fixes the above, and adds a test

closes: #139 closes: #140

Approach

Open Questions and Pre-Merge TODOs

Learning

Types of changes

Reviewer, please remember our guidelines: