Commit 5fe442f4 authored by Steinberg, Jan's avatar Steinberg, Jan

changed tatup filter for letting through every item with volume 19 issue 3 and higher

parent 90b8d8ec
......@@ -9,43 +9,49 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Tatup2SsoarBundleFilter implements BundleFilter {
private final static Logger LOG = LoggerFactory.getLogger(Tatup2SsoarBundleFilter.class);
/**
* Filter away everything published before 2017
*/
@Override
public boolean test(Bundle bundle) {
boolean result;
Set<Metadatum> metadata = bundle.getMetadata();
Metadatum dateIssued = metadata.stream().filter( m -> m.getKey().equals("dc.date.issued") ).findFirst().orElse(null);
if (null != dateIssued) {
String dateIssuedString = dateIssued.getValue();
try {
int dateIssuedValue = Integer.parseInt(dateIssuedString);
// for test changed to 2020 , normally it is 2017
if ( dateIssuedValue >= 2017 ) {
result = true;
}
else {
LOG.info("Tatup2SsoarBundleFilter - filtering away bundle.reference={}", bundle.getReference() );
result = false;
}
}
catch (NumberFormatException e) {
LOG.warn("unparsable dc.source.volume={} for bundle.reference={}", dateIssuedString, bundle.getReference() );
result = true;
}
}
else {
result = true;
}
return result;
}
private final static Logger LOG = LoggerFactory.getLogger(Tatup2SsoarBundleFilter.class);
/**
* Filter away everything published before 2017
*/
@Override
public boolean test(Bundle bundle) {
boolean result = false;
Set<Metadatum> metadata = bundle.getMetadata();
Metadatum volume = metadata.stream().filter(m -> m.getKey().equals("dc.source.volume")).findFirst()
.orElse(null);
Metadatum issue = metadata.stream().filter(m -> m.getKey().equals("dc.source.issue")).findFirst().orElse(null);
if (null != volume) {
String volumeString = volume.getValue();
try {
int volumeValue = Integer.parseInt(volumeString);
if (volumeValue > 19) {
result = true;
} else if (volumeValue == 19) {
if (null != issue) {
String issueString = issue.getValue();
int issueValue = Integer.parseInt(issueString);
if (issueValue >= 3) {
result = true;
}
}
} else {
LOG.info("Tatup2SsoarBundleFilter - filtering away bundle.reference={}", bundle.getReference());
result = false;
}
} catch (NumberFormatException e) {
LOG.warn("unparsable dc.source.volume={} for bundle.reference={}", volumeString, bundle.getReference());
result = true;
}
} else {
result = true;
}
return result;
}
}
......@@ -1953,6 +1953,94 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertEquals( 2, fileSet.size());
}
@Test
public void getSinglePublicationRuR() throws IOException {
Map<String, String> map = new HashMap<>();
String oaiDcXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/rur-oai_dc-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("oai_dc", oaiDcXsltString);
XsltTransformerOaiPmhBundlesStreamSource bss = new XsltTransformerOaiPmhBundlesStreamSource("https://www.econstor.eu/oai/request", map);
Bundle bundle = bss.getBundle("oai:econstor.eu:10419/222185");
LOG.info("{}", bundle);
Set<Metadatum> metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.type.stock", "article") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.type.document", "32") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.source.series", "WZB Discussion Paper") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.pubstatus", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Mose, Ingo") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Hammer, Thomas") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Siegrist, Dominik") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Weixlbaumer, Norbert") ) );
assertEquals( 4 , metadata.stream().filter(m -> m.getKey().equals("dc.contributor.author") ).count() );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.corporateeditor", "381") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("ssoar.contributor.institution", "WZB") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.review", "1") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.review") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.date.issued", "2019") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "de", "Der Beitrag thematisiert die Entwicklung und Erfahrungen einer internationalen Forschergruppe, die sich schwerpunktmäßig mit Fragestellungen des Gebietsschutzes in Europa befasst. Unter dem Akronym \"NeReGro\" (für \"Neue Regionalentwicklung in Großschutzgebieten\") pflegen vier geographische Arbeitsgruppen an Hochschulen in der Schweiz, Österreich und Deutschland erfolgreich eine lose, informelle Form der Kooperation, die inzwischen annähernd 20 Jahre umspannt. Zentraler Gegenstand ihrer Zusammenarbeit sind die unübersehbaren Veränderungen, die der Gebietsschutz in Europa seit geraumer Zeit erfährt. Diese Entwicklung spiegelt sich besonders anschaulich in den sogenannten Großschutzgebieten wider, von denen viele neben den klassischen Aufgaben des Naturschutzes heute zahlreiche weitere Funktionen wahrnehmen. Ein nicht geringer Teil der raumwissenschaftlichen Forschung zu Großschutzgebieten erweckt den Eindruck relativ isolierter Arbeiten, die wenig Bezug zueinander haben bzw. von geringer gegenseitiger Kenntnis(nahme) zeugen. Die Entwicklung von NeReGro lässt anschaulich die Vorteile erkennen, die sich aus einer systematischen Zusammenarbeit für die Weiterentwicklung der Gebietsschutzforschung insgesamt gewinnen lassen. Diese betreffen die Entwicklung eines international vergleichenden Forschungsansatzes, die Berücksichtigung der gesellschaftlichen Implikationen des Gebietsschutzes sowie die Ergänzung der lokal-regionalen um eine globale Forschungsperspektive. Neben dem Mehrwert von Kooperation, wie er sich in der Arbeit von NeReGro zeigt, sind auch die Grenzen der Zusammenarbeit zu erkennen, wie sie für die Gebietsschutzforschung in Europa generell kennzeichend sind. Hieraus erwächst der Bedarf an der konsequenten Weiterentwicklung geeigneter Formen der Forschungskooperation auf europäischer Ebene, um den wachsenden Herausforderungen, die Planung und Management des Gebietsschutzes mit sich bringen, zukünftig angemessen begegnen zu können.") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "en", "This paper addresses development and experiences of an international group of researchers with a focus on area protection in Europe. Under the acronym \"NeReGro\" (for \"New regional development and large protected areas\") four university research groups in geography from Switzerland, Austria and Germany practice successfully a rather lose, informal way of collaboration for almost 20 years. Core subject of their joint activities is the considerable change experienced in area protection in Europe for quite some time. This is especially mirrored by large protected areas, many of which carry out a multitude of functions beyond the classical tasks of nature conservation. A considerable part of this research appears relatively isolated though, relatively disconnected and with limited mutual recognition. The development of NeReGro well illustrates the benefits that can be generated instead from ways of systematic collaboration for research on protected areas at large. These regard the development of a comparative international research agenda, the recognition of the societal implications of area protection, and the enhancement of the local-regional research perspective by a global view. Besides the added value of collaboration visibale through the work of NeReGro, the case of the research group equally illustrates limits of collabation similarly characteristic for protected areas research in Europe at large. Against this background, the consistent development of appropriate forms of research collaboration at European scale are demanded in order to meet future challenges caused by planning and management of protected areas.") ) );
assertEquals(2, metadata.stream().filter(m -> m.getKey().equals("dc.description.abstract") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.handle", "https://hdl.handle.net/10419/222185") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.identifier.handle") ).count() );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.handle", "http://hdl.handle.net/10419/43900") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.identifier.handle") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.language", "de") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.journal", "1776") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.issn", "1869-4179")));
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.2478/rara-2019-0004")));
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.volume", "77") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issue", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "81-93") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.rights.licence", "20") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "de", "Gebietsschutz in Europa - Herausforderungen für wissenschaftliche Kooperation: Erfahrungen der Forschergruppe NeReGro") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "en", "Protected areas in Europe - challenges for scientific collaboration: Experiences of the research group NeReGro")));
assertTrue( metadata.contains( new SimpleMetadatum("internal.dda.reference", "https://www.econstor.eu/oai/request@@oai:econstor.eu:10419/222185") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "DEU") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("internal.identifier.classoz", "10900") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.classoz", "10900") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.identifier.ddc", "710") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.status", "formal und inhaltlich fertig erschlossen") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "Gebietsschutz") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "Paradigmenwechsel") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "Regionalentwicklung") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "Multifunktionalität") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "Modellgebiete") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "Forschungskooperation") ) );
Set<InputStream> fileSet = bundle.getContents();
assertEquals( 1, fileSet.size());
// ===========
Bundle bundle2 = bss.getBundle("oai:econstor.eu:10419/222228");
LOG.info("{}", bundle2);
Set<Metadatum> metadata2 = bundle2.getMetadata();
metadata2.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata2.contains( new SimpleMetadatum("dc.type.stock", "article") ) );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.type.document", "32") ) );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.title", "de", "Urbane Produktion und temporäre räumliche Nähe in Produktionsprozessen") ) );
assertEquals(1, metadata2.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.title.alternative", "en", "Urban manufacturing and temporary spatial proximity in production processes")));
assertTrue( metadata2.contains( new SimpleMetadatum("dc.description.abstract", "de", "In diesem Beitrag wird argumentiert, dass temporäre räumliche Nähe zwischen Wirtschaftsakteuren neben der Wissensgenerierung ebenfalls einen produktionsbedingten Zweck verfolgen kann. Dabei werden materielle Konsumgüter aufgrund neuer technologischer Entwicklungen und Trends durch temporäre räumliche Nähe zwischen Endkunden und Produzenten erzeugt und in diesem Beitrag am Beispiel der urbanen Produktion diskutiert. Der temporäre Austausch hat das Ziel, ein den individuellen Wünschen der jeweiligen Kunden entsprechendes materielles Gut in Echtzeit zu erstellen. Ziel dieses Beitrags ist es, produktionsbedingte temporäre räumliche Nähe zu analysieren aufzuzeigen, wie sie Produktionsstandorte und Produktionsstätten sowie die Beziehung zu Kunden prägt. Anhand einer Literaturanalyse und Fallstudien wird produktionsbedingte temporäre räumliche Nähe in Großunternehmen, Manufakturen, Makerspaces und sogenannten Festivals untersucht. Die Ergebnisse zeigen, dass Kunden intensiv in den Produktionsprozess eingebunden sind. Veränderungen der Produktionsweise und Produktionsstätte sind die Konsequenz, da es um die Herstellung von Einzelstücken geht. Zusätzlich verändern sich aber auch die Produktionsstandorte, die aufgrund größerer Marktnähe in stark frequentierte Einzelhandelslagen oder Wohngebiete rücken. Produktionsbedingte temporäre räumliche Nähe zwischen Produzenten und Kunden und damit verbundene innerstädtische Produktion wird die massenhafte Herstellung von Konsumgütern nicht ablösen. Sie ist jedoch ein wichtiger Faktor, der die der Wahl von Geschäftsmodellen und Unternehmensstandorten angesichts des gegenwärtigen Trends der Individualisierung von Konsumgütern beeinflusst.") ) );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.description.abstract", "en", "This article argues that temporary spatial proximity between economic agents can also have a productionrelated purpose besides knowledge generation. At the same time, due to new technological developments and trends, consumer goods are generated by temporary spatial proximity between end customers and producers. The purpose of the temporary exchange is to create material goods meeting the individual demands of the respective customer in real time. The aim of this paper is to analyse production-related temporary spatial proximity of urban manufacturing to show how production sites and locations as well as the relationship with customers are altered. Based on a literature analysis and case studies, production-related temporary spatial proximity in large companies, factories, makerspaces and festivals is examined. The results show that customers are intensively involved in the production process. Changes in the production method and location are the consequence, since it is about the production of individual pieces. In addition, production locations change, as they need to be in retail locations or housing areas, i.e. close to the market where the end consumers are. Production-oriented temporal spatial proximity between producers and consumers and associated inner-city production will not replace mass production of consumer goods. However, it is an important factor influencing the choice of business models and business locations for entrepreneurs given the current trend in the individualisation of consumer goods.") ) );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.subject.other", "Koproduktion") ) );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.subject.other", "temporäre räumliche Nähe") ) );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.subject.other", "urbane Produktion") ) );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.subject.other", "Co-production") ) );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.subject.other", "Temporary spatial proximity") ) );
assertTrue( metadata2.contains( new SimpleMetadatum("dc.subject.other", "Urban manufacturing") ) );
Set<InputStream> fileSet2 = bundle2.getContents();
assertEquals( 1, fileSet2.size());
}
@Test
public void iterateThroughFqsPublications() throws IOException {
Map<String, String> map = new HashMap<>();
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:cc="http://www.d-nb.de/standards/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcmitype="http://purl.org/dc/dcmitype/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:ddb="http://www.d-nb.de/standards/ddb/"
xmlns:dini="http://www.d-nb.de/standards/xmetadissplus/type/"
xmlns:doi="http://www.d-nb.de/standards/doi/"
xmlns:hdl="http://www.d-nb.de/standards/hdl/"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:nlm="http://dtd.nlm.nih.gov/publishing/2.3"
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:pc="http://www.d-nb.de/standards/pc/"
xmlns:thesis="http://www.ndltd.org/standards/metadata/etdms/1.0/"
xmlns:urn="http://www.d-nb.de/standards/urn/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xMetaDiss="http://www.d-nb.de/standards/xmetadissplus/"
xmlns:xoai="http://www.lyncode.com/xoai"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:zoai="http://git.gesis.org/dda/zoai">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- <xsl:copy-of select="."/> -->
<!-- <xsl:message terminate="no">here is some message for stderr, e.g. <xsl:value-of select='text()' /> </xsl:message> -->
<!-- override default template -->
<xsl:template match="*" />
<xsl:template match="/">
<xsl:element name="bundle">
<xsl:element name="metadata">
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc" />
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc">
<!--xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.pubstatus'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1'"/>
</xsl:call-template-->
<xsl:variable name="pubstatus">
<xsl:for-each select="//dc:description">
<xsl:value-of select="text()"/>
<xsl:text> ; </xsl:text>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.pubstatus'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1'"/>
</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="'ssoar.contributor.institution'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'WZB'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'ssoar.urn.registration'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'true'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.review'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.journal'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1776'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'internal.status'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'formal und inhaltlich fertig erschlossen'"/>
</xsl:call-template>
<!--xsl:apply-templates select="dc:type[@xml:lang='en-US']" /-->
<xsl:apply-templates select="dc:title" />
<xsl:apply-templates select="dc:description" />
<xsl:apply-templates select="dc:language" />
<xsl:apply-templates select="dc:source[@xml:lang='de-DE']" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^http.*')]" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^Journal.*')]" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^doi.*')]" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^urn.*') and not(matches(text(), '^.*isbn:\d+.*'))]" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^.*isbn:\d+.*')]" />
<xsl:apply-templates select="dc:type" />
<xsl:apply-templates select="dc:relation" />
<xsl:apply-templates select="dc:creator" />
<xsl:apply-templates select="dc:date" />
<xsl:apply-templates select="dc:publisher" />
<xsl:apply-templates select="dc:subject[starts-with(.,'ddc:')]" />
<xsl:apply-templates select="dc:subject[not(starts-with(.,'ddc:'))]" />
<xsl:apply-templates select="dc:rights" />
</xsl:template>
<xsl:template match="dc:description">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( ../dc:language/text() )" />
<xsl:choose>
<xsl:when test="position() = 1 and $sanitizedLanguage = 'de'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'de'"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[‹›»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="position() = 1 and $sanitizedLanguage = 'en'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'en'"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[‹›»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="position() != 1 and $sanitizedLanguage = 'de'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'en'"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[‹›»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="position() != 1 and $sanitizedLanguage = 'en'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'de'"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[‹›»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:date">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.date.issued'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="substring(text(),1,4)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:creator">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.contributor.author'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:relation">
<xsl:if test="starts-with(., 'Series: ')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.series'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="substring-before(substring-after(., 'Series: '), ' ;')"/>
</xsl:call-template>
<xsl:if test="contains(., ' ; ')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.volume'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="normalize-space(replace(substring-after(., ' ; '), 'No.',''))"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="dc:language">
<xsl:if test="position()=1">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( text() )" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.language'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$sanitizedLanguage"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^http.*')]">
<xsl:if test="not(contains(text(), 'handle'))">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.url'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="contains(text(), 'handle')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.handle'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="replace(text(),'http:','https:')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^doi.*')]">
<xsl:choose>
<xsl:when test="contains(.,'doi.org')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.doi'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.doi'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="concat('https://doi.org/', substring-after(text(), 'doi:'))"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^urn.*') and not(matches(text(), '^.*isbn:\d+.*'))]">
<xsl:choose>
<xsl:when test="contains(.,'https://nbn-resolving.org')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.urn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="substring-after(text(),'nbn-resolving.org/')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.urn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^.*isbn:\d+.*')]">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.isbn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="substring-after(text(), 'isbn:')"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^Journal.*')]">
<xsl:for-each select="tokenize(text(), ' ; ')">
<!-- xsl:if test="starts-with(., 'Journal: ')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.journal'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="normalize-space(substring-after(.,'Journal:'))"/>
</xsl:call-template>
</xsl:if -->
<xsl:if test="starts-with(., 'ISSN: ')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.issn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="normalize-space(substring-after(.,'ISSN:'))"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="starts-with(., 'Volume: ')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.volume'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="normalize-space(substring-after(.,'Volume:'))"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="starts-with(., 'Issue: ')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.issue'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="normalize-space(substring-after(.,'Issue:'))"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="starts-with(., 'Pages: ')">
<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="normalize-space(substring-after(.,'Pages:'))"/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="dc:source[@xml:lang='de-DE']">
<xsl:variable name="pageinfo" select="tokenize( text(),'; ' )[last()]" />
<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:if test="$pageinfo != '' and matches($pageinfo, '^\w\d+(-\w\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:variable name="issue" select="substring-before(substring-after(text(),'Nr. '),' ')" />
<xsl:if test="$issue != '' and matches ($issue, '\d+')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.issue'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$issue"/>
</xsl:call-template>
</xsl:if>
<xsl:variable name="issuetopic" select="substring-before(substring-after(text(),'): '),'; ')" />
<xsl:if test="$issuetopic != ''">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.issuetopic'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="replace($issuetopic,'•',':')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:rights">
<xsl:if test="matches(text(), '^.*creativecommons.org.*')">
<xsl:choose>
<xsl:when test="contains(text(), '/by-sa/1.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="21"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-sa/2.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="22"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-sa/3.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="23"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-sa/4.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="24"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-sa/')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="8"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-nd/1.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="17"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-nd/2.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="18"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-nd/3.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="19"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-nd/4.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="20"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-nd/')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="20"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-sa/1.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="33"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-sa/2.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="34"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-sa/3.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="35"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-sa/4.0')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="36"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(text(), '/by-nc-sa/')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>