MENDELU/OAI-PMH Updated citation format and added ispartof metadatum into dc.relation#1297
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the OAI-PMH oai_dc crosswalk to adjust how citation-like identifiers are formatted and to expose dc.relation.ispartof within the standard dc:relation element for better Dublin Core compatibility.
Changes:
- Updated formatted
dc:identifiercitation string (punctuation and removed ISSN inclusion). - Remapped
dc.relation.ispartofoutput from a custom element (dc:identifier.ispartof) to standard<dc:relation>.
| <xsl:text>, vol. </xsl:text> | ||
| <xsl:value-of select="doc:metadata/doc:element[@name='local']/doc:element[@name='volume']/doc:element/doc:field[@name='value']" /> | ||
| <xsl:text>, č. </xsl:text> | ||
| <xsl:value-of select="doc:metadata/doc:element[@name='local']/doc:element[@name='number']/doc:element/doc:field[@name='value']" /> |
There was a problem hiding this comment.
The citation formatter emits the ", vol." and ", č." segments unconditionally (lines 124-127), but the xsl:if guard (line 119) only requires any of issued/volume/number to exist. If (for example) only dc.date.issued is present, the output will still include empty volume/number placeholders and punctuation. Consider building the string with per-field conditionals (and separators) so missing fields don’t produce dangling commas/labels.
| <xsl:text>, vol. </xsl:text> | |
| <xsl:value-of select="doc:metadata/doc:element[@name='local']/doc:element[@name='volume']/doc:element/doc:field[@name='value']" /> | |
| <xsl:text>, č. </xsl:text> | |
| <xsl:value-of select="doc:metadata/doc:element[@name='local']/doc:element[@name='number']/doc:element/doc:field[@name='value']" /> | |
| <xsl:if test="doc:metadata/doc:element[@name='local']/doc:element[@name='volume']/doc:element/doc:field[@name='value']"> | |
| <xsl:text>, vol. </xsl:text> | |
| <xsl:value-of select="doc:metadata/doc:element[@name='local']/doc:element[@name='volume']/doc:element/doc:field[@name='value']" /> | |
| </xsl:if> | |
| <xsl:if test="doc:metadata/doc:element[@name='local']/doc:element[@name='number']/doc:element/doc:field[@name='value']"> | |
| <xsl:text>, č. </xsl:text> | |
| <xsl:value-of select="doc:metadata/doc:element[@name='local']/doc:element[@name='number']/doc:element/doc:field[@name='value']" /> | |
| </xsl:if> |
| <xsl:if test="doc:metadata/doc:element[@name='dc']/doc:element[@name='date']/doc:element[@name='issued']/doc:element/doc:field[@name='value'] or doc:metadata/doc:element[@name='local']/doc:element[@name='volume']/doc:element/doc:field[@name='value'] or doc:metadata/doc:element[@name='local']/doc:element[@name='number']/doc:element/doc:field[@name='value']"> | ||
| <dc:identifier> | ||
| <xsl:text> . </xsl:text> | ||
| <xsl:value-of select="doc:metadata/doc:element[@name='dc']/doc:element[@name='relation']/doc:element[@name='ispartof']/doc:element/doc:field[@name='value']" /> | ||
| <xsl:text>. </xsl:text> | ||
| <xsl:value-of select="doc:metadata/doc:element[@name='dc']/doc:element[@name='date']/doc:element[@name='issued']/doc:element/doc:field[@name='value']" /> |
There was a problem hiding this comment.
The formatted citation dc:identifier now unconditionally outputs dc.relation.ispartof (line 121), but the surrounding xsl:if guard (line 119) doesn’t check for ispartof. If issued/volume/number exist but ispartof is missing, this will emit a leading ". " and an incomplete citation. Consider either including ispartof in the xsl:if condition, or wrapping the ispartof output (and its trailing punctuation) in its own conditional to avoid stray punctuation and empty segments.
| <xsl:for-each select="doc:metadata/doc:element[@name='dc']/doc:element[@name='relation']/doc:element[@name='ispartof']/doc:element/doc:field[@name='value']"> | ||
| <dc:identifier.ispartof><xsl:value-of select="." /></dc:identifier.ispartof> | ||
| <dc:relation><xsl:value-of select="." /></dc:relation> |
There was a problem hiding this comment.
This PR changes the OAI-PMH oai_dc.xsl output (formatted dc:identifier and mapping dc.relation.ispartof). There are existing stylesheet tests for other metadataFormats (e.g., QDCXslTest/RioxxXslTest via AbstractXSLTest), but none appear to cover oai_dc.xsl. Please add/extend a stylesheet test to assert the updated citation formatting and that ispartof is emitted as dc:relation (and no longer as a custom element), to prevent regressions.
Problem description
Update because of citacePRO citations.
Analysis
(Write here, if there is needed describe some specific problem. Erase it, when it is not needed.)
Problems
(Write here, if some unexpected problems occur during solving issues. Erase it, when it is not needed.)
Manual Testing (if applicable)
Copilot review