Commit f1cc49a2 authored by Gerrit Hübbers's avatar Gerrit Hübbers 🃏
Browse files

Improve Africa Spectrum test harvesting

parent 35243226
......@@ -124,7 +124,13 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.review", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "The Ethiopian Second Republic and the Fragile “Social Contract”") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "de", "Die 2. Republik in Äthiopien und der “fragile Gesellschaftsvertrag“") ) );
assertTrue( metadata.stream().noneMatch(m -> m.getKey().equals("dc.source.issuetopic")) );
assertTrue( metadata.stream().noneMatch( m -> m.getKey().equals("dc.source.issuetopic") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "3-28") ) );
bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/1054");
metadata = bundle.getMetadata();
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "Review: Anika Becher, Explaining Ethnic and Election Violence: Kenya and Malawi in Comparison (2016)") ) );
assertTrue( metadata.stream().noneMatch( m -> m.getKey().equals("dc.source.issuetopic") ) );
assertTrue( metadata.stream().noneMatch( m -> m.getKey().equals("dc.source.pageinfo") ) );
}
}
......@@ -59,15 +59,15 @@
</xsl:call-template>
</xsl:if>
<!-- dc:source may contain page information ... if it exists, it is after the last '; ' occurrence -->
<!-- dc:source may contain page information ... if it exists and follows the pattern 123(-125), it is after the last '; ' occurrence -->
<xsl:variable name="pageinfo" select="tokenize(text(),'; ')[last()]" />
<!-- <xsl:message terminate="no">pageinfo=<xsl:value-of select="$pageinfo"/></xsl:message> -->
<xsl:if test="$pageinfo != ''">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.pageinfo'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$pageinfo"/>
</xsl:call-template>
<xsl:if test="$pageinfo != '' and matches($pageinfo, '^\d+(-\d+)?')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.pageinfo'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$pageinfo"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
......
......@@ -39,18 +39,6 @@
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/xMetaDiss:xMetaDiss" />
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:header" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.publisher'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'XXX to be defined... GIGA or Hamburg University Press ... or both?'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.publisher.country'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'DEU'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.stock'"/>
<xsl:with-param name="language" select="''"/>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment