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

Start working on FQS

parent 35b57780
......@@ -836,6 +836,88 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issuetopic", "Special Issue: Well-being in cities and regions: measurement, analysis and policy practices") ) );
}
@Test
public void getSinglePublicationFqs() throws IOException {
Map<String, String> map = new HashMap<>();
String xMetaDissPlusXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/fqs-nlm-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("nlm", xMetaDissPlusXsltString);
String oaiDcXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/fqs-oai_dc-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("oai_dc", oaiDcXsltString);
XsltTransformerOaiPmhBundlesStreamSource bss = new XsltTransformerOaiPmhBundlesStreamSource("http://www.qualitative-research.net/index.php/fqs/oai/", map);
// http://www.qualitative-research.net/index.php/fqs/oai?verb=GetRecord&metadataPrefix=nlm&identifier=oai:www.qualitative-research.net:article/2671
// http://www.qualitative-research.net/index.php/fqs/article/view/2671
// https://www.ssoar.info/ssoar/handle/document/55562
Bundle bundle = bss.getBundle("oai:www.qualitative-research.net:article/2671");
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.journal", "Forum Qualitative Sozialforschung / Forum: Qualitative Social Research") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.pubstatus", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Wimbauer, Christine") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Motakef, Mona") ) );
assertEquals(2, metadata.stream().filter(m -> m.getKey().equals("dc.contributor.author") ).count() );
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", "2017") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "de", "Paarinterviews erlauben die Erfassung von Interaktionen, Aushandlungen, Performances und Präsentationen des Paares und als Paar in situ. Sie liefern Einblicke in die konkrete Paarpraxis und in die Darstellung der Praxis im Interview als doing couple, aber auch als doing gender, doing family, doing recognition oder doing inequality. Mit dem Blick auf Individuen in Paarbeziehungen mittels Paarinterviews können Macht- und Ungleichheitsverhältnisse im Paar sowie die Prozesshaftigkeit und Dynamik des Sozialen ausschnitthaft beobachtet werden.Paarinterviews werden in der nichtstandardisierten Sozialforschung zunehmend, jedoch weitaus seltener als Einzelinterviews verwendet. Bisher gibt es im deutschsprachigen Raum kaum systematische methodische und methodologische Überlegungen zum gemeinsamen Paarinterview. Basierend auf der Fassung von Paarbeziehungen als Realität sui generis und als eigenständigem Analysegegenstand zeigen wir – verortet im interpretativen Paradigma – Erkenntnisinteressen, Anwendungsbereiche und Stärken von Paarinterviews für die soziologische Paarforschung auf. Zudem präsentieren wir neben ausgewählten soziologischen Paarforschungen methodische Aspekte der Durchführung und Anwendung, method(olog)ische Grenzen von und offene method(olog)ische Fragen zum Paarinterview (nicht nur) in der soziologischen Paarforschung.URN: http://nbn-resolving.de/urn:nbn:de:0114-fqs170243") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "en", "Joint couple interviews allow for the collection of data on interactions, negotiations, couple performances, and couple presentations by couples in situ. Joint interviews provide insight into concrete couple practices and representations of those practices as part of the interview as a form of doing couple, but also as doing gender, doing family, doing recognition, or doing inequality. By focusing on individuals-in-couple-relationships, couple interviews can reveal power relations and inequalities within the couple relationship, the processual quality, and the dynamic of the social relation.Joint couple interviews are increasingly employed in interpretive social research, however, less frequently than individual interviews. To date, there has been little systematic work in German-speaking countries on methodological and methodical issues related to joint couple interviews. Proceeding from an interpretative perspective and considering couple relationships as a reality sui generis and as a distinct object of analysis, we outline its interests for sociology. We also briefly review selected empirical studies on couples, and focus especially on methodological questions related to conducting joint couple interviews, as well as  limitations and open method(olog)ical questions (not only) for the sociological research on couples.URN: http://nbn-resolving.de/urn:nbn:de:0114-fqs170243") ) );
assertEquals(2, metadata.stream().filter(m -> m.getKey().equals("dc.description.abstract") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.issn", "1438-5627") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.url", "http://www.qualitative-research.net/index.php/fqs/article/view/2671") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.identifier.url") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.language", "de") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.rights.licence", "16") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issue", "2") ) );
assertEquals(0, metadata.stream().filter(m -> m.getKey().equals("dc.source.issuetopic") ).count() );
assertEquals(0, metadata.stream().filter(m -> m.getKey().equals("dc.source.pageinfo") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.volume", "18") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "couple interviews") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "interpretative paradigm") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "qualitative methods") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "qualitative methodology") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "intimate relationships") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "social interactions") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "gender inequalities") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "de", "Paarinterviews") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "de", "qualitative Sozialforschung") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "de", "qualitative Methodologie") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "de", "soziologische Paarforschung") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "de", "Paarbeziehungen") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "de", "soziale Interaktionen") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "de", "Geschlechter­ungleichheiten") ) );
assertEquals(14, metadata.stream().filter(m -> m.getKey().equals("dc.subject.other") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "de", "Das Paarinterview in der soziologischen Paarforschung. Method(olog)ische und forschungspraktische Überlegungen") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "en", "Joint Couple Interviews in Sociological Research on Couples: Methodological and Practical Considerations") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title.alternative") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.urn", "http://dx.doi.org/10.18335/region.v3i1.121") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.dda.reference", "http://openjournals.wu.ac.at/ojs/index.php/region/oai/@@oai:ojs.openjournals.wu.ac.at:article/121") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "AUT") ) );
LOG.info("---------------------------------------");
bundle = bss.getBundle("oai:ojs.openjournals.wu.ac.at:article/188");
LOG.info("{}", bundle);
metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "Well-being in cities and regions: measurement, analysis and policy practices") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.review", "2") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.review") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issuetopic", "Special Issue: Well-being in cities and regions: measurement, analysis and policy practices") ) );
}
@Test
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.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: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:message terminate="no">here is the tree at the current node <xsl:copy-of select="."/> </xsl:message> -->
<!-- <xsl:message terminate="no">here is some message for stderr, e.g. <xsl:value-of select='text()' /> </xsl:message> -->
<!--
<xsl:for-each select="./*">
<xsl:message terminate="no">a child=<xsl:value-of select="name()"/></xsl:message>
</xsl:for-each>
-->
<!-- 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/nlm:article" />
<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.type.stock'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'article'"/>
</xsl:call-template -->
<!-- xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.document'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'32'"/>
</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="'Forum Qualitative Sozialforschung / Forum: Qualitative Social Research'"/>
</xsl:call-template>
<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>
<!-- http://www.qualitative-research.net/index.php/fqs/about/editorialPolicies#peerReviewProcess -->
<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:element>
</xsl:element>
</xsl:template>
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/nlm:article">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( @xml:lang )" />
<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:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:header">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/nlm:article/nlm:front">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:journal-meta">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:issn[@pub-type='epub']">
<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="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:article-meta">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:contrib-group">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:contrib[@contrib-type='author']">
<xsl:variable name="fullName" select="concat( nlm:name/nlm:surname/text(), ', ', nlm:name/nlm:given-names/text() )" />
<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="$fullName"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:article-id[@pub-id-type='doi']">
<xsl:variable name="doi" select="concat( 'http://dx.doi.org/', text() )" />
<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="$doi"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:pub-date[@pub-type='collection']">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:year">
<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="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:abstract-trans">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage(@xml:lang)" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="$sanitizedLanguage"/>
<xsl:with-param name="value" select="nlm:p/text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:self-uri[ not(@content-type) ]">
<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="@xlink:href"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:permissions">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:license">
<xsl:choose>
<xsl:when test="@xlink:href = 'http://creativecommons.org/licenses/by/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="'16'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@xlink:href = 'http://creativecommons.org/licenses/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="@xlink:href = 'http://creativecommons.org/licenses/by-nc/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="'32'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<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="@xlink:href"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="nlm: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="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:issue-title">
<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="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm: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="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:kwd-group">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:kwd">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage(../@xml:lang)" />
<xsl:variable name="subjects" select="replace( text(), ',', ';')" />
<xsl:if test="$subjects != ''">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.subject.other'"/>
<xsl:with-param name="language" select="$sanitizedLanguage"/>
<xsl:with-param name="value" select="$subjects"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="/oai:OAI-PMH/oai:GetRecord/oai:record/oai:header/oai:setSpec">
<!-- http://www.qualitative-research.net/index.php/fqs/oai?verb=ListSets -->
<!-- http://www.qualitative-research.net/index.php/fqs/about/editorialPolicies#peerReviewProcess -->
<!-- guard against multiple set assignments such as 'fqsregion:ART' AND 'ec_fundedresources' -->
<xsl:if test="starts-with( text(), 'fqs:' )">
<xsl:choose>
<xsl:when test="text() = 'fqs:REV' or text() = 'fqs:U22' or text() = 'fqs:U23' or text() = 'fqs:U24'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.stock'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'recension'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.document'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'23'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="text() = 'fqs:CONF'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.stock'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'article'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.document'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'16'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.stock'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'article'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.document'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'32'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="new-metadatum">
<xsl:param name="key" />
<xsl:param name="language" />
<xsl:param name="value" />
<xsl:element name="metadatum">
<xsl:element name="key">
<xsl:value-of select="$key" />
</xsl:element>
<xsl:if test="$language != ''">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage($language)" />
<xsl:element name="language">
<xsl:value-of select="$sanitizedLanguage" />
</xsl:element>
</xsl:if>
<xsl:element name="value">
<xsl:value-of select="$value" />
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:function name="zoai:sanitizeLanguage">
<xsl:param name="inputLanguage" />
<xsl:choose>
<xsl:when test="$inputLanguage = 'ger' or $inputLanguage = 'DE' or $inputLanguage = 'de-DE' or $inputLanguage = 'deu'">
<xsl:value-of select="'de'" />
</xsl:when>
<xsl:when test="$inputLanguage = 'eng' or $inputLanguage = 'EN' or $inputLanguage = 'en-US' or $inputLanguage = 'en-GB'">
<xsl:value-of select="'en'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$inputLanguage" />
</xsl:otherwise>
</xsl:choose>
</xsl:function>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.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:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="dc:title">
<xsl:if test="text() != ''">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( @xml:lang )" />
<xsl:variable name="sanitizedMainLanguage" select="zoai:sanitizeLanguage( /oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc/dc:language )" />
<xsl:choose>
<xsl:when test="$sanitizedLanguage = $sanitizedMainLanguage">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.title'"/>
<xsl:with-param name="language" select="$sanitizedLanguage"/>
<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.title.alternative'"/>
<xsl:with-param name="language" select="$sanitizedLanguage"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="new-metadatum">
<xsl:param name="key" />
<xsl:param name="language" />
<xsl:param name="value" />
<xsl:element name="metadatum">
<xsl:element name="key">
<xsl:value-of select="$key" />
</xsl:element>
<xsl:if test="$language != ''">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage($language)" />
<xsl:element name="language">
<xsl:value-of select="$sanitizedLanguage" />
</xsl:element>
</xsl:if>
<xsl:element name="value">
<xsl:value-of select="$value" />
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:function name="zoai:sanitizeLanguage">
<xsl:param name="inputLanguage" />
<xsl:choose>
<xsl:when test="$inputLanguage = 'ger' or $inputLanguage = 'DE' or $inputLanguage = 'de-DE' or $inputLanguage = 'deu'">
<xsl:value-of select="'de'" />
</xsl:when>
<xsl:when test="$inputLanguage = 'eng' or $inputLanguage = 'EN' or $inputLanguage = 'en-US' or $inputLanguage = 'en-GB'">
<xsl:value-of select="'en'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$inputLanguage" />
</xsl:otherwise>
</xsl:choose>
</xsl:function>
</xsl:stylesheet>
\ No newline at end of file
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