The DataCite Metadata Schema XSD allows certain relatedItem properties to contain attributes not specified in the schema. When reading these properties, bolognese does not check for attributes, generating hashes with attribute values instead of just content values if attributes are present. For example, <volume xml:lang="en">RR-175</volume> is read as "volume": { "lang": "en", "__content__": "RR-175" },
Downstream, this cause indexing errors in lupo because ElasticSearch does not expect hash values for these properties.
This PR corrects this behavior, rendering only content values for these properties in JSON:
"volume" => "RR-175",
closes: #149
Approach
Added parse_attributes function to the problematic properties. This returns the property's content rather than a hash with the attributes.
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Be humble in the language and feedback you give, ask don't tell.
Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
Offer suggestions on how to improve code e.g. simplification or expanding clarity.
Ensure you give reasons for the changes you are proposing.
Purpose
The DataCite Metadata Schema XSD allows certain relatedItem properties to contain attributes not specified in the schema. When reading these properties, bolognese does not check for attributes, generating hashes with attribute values instead of just content values if attributes are present. For example,
<volume xml:lang="en">RR-175</volume>
is read as"volume": { "lang": "en", "__content__": "RR-175" },
Downstream, this cause indexing errors in lupo because ElasticSearch does not expect hash values for these properties.
This PR corrects this behavior, rendering only content values for these properties in JSON:
"volume" => "RR-175",
closes: #149
Approach
Added
parse_attributes
function to the problematic properties. This returns the property's content rather than a hash with the attributes.Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Reviewer, please remember our guidelines: