Commit 6324a215 authored by Jakowatz, Stefan's avatar Jakowatz, Stefan

SAH und FQS

parent 9338c995
......@@ -1347,6 +1347,150 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.review") ).count() );
}
@Test
public void getSinglePublicationSAH() throws IOException {
Map<String, String> map = new HashMap<>();
String oaiDcXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/sah-oai_dc-2-xmlbundle2.xslt"), StandardCharsets.UTF_8);
map.put("oai_dc", oaiDcXsltString);
XsltTransformerOaiPmhBundlesStreamSource bss = new XsltTransformerOaiPmhBundlesStreamSource("http://sahjournal.com/index.php/sah/oai/", map);
Bundle bundle = bss.getBundle("oai:ojs.sahjournal.com:article/96");
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", "Studies in Arts and Humanities") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.pubstatus", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Toner, Ian") ) );
assertEquals(1, 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", "en", "A fast-paced, dark comedy about Danielle and Sarah who used to be best friends when they were kids. But they’re not kids anymore. Because they’re 11. Caught on the precipice of adulthood, two very different girls try to navigate the complex and terrifying political minefield that is the school playground, a world occupied by kids who don’t know any better and adults who really should. In doing so they find solace in an unexpected source - each other.A comic story about friendship, betrayal, loneliness, little break, big break, heartbreak, bike chasing and Penguins (the biscuit, not the flightless amphibian bird).") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "pl", "Sfera wartości i związane z nimi uwarunkowania polityki to zagadnienia aktualne w naukach społecznych. Autor prezentuje dobre praktyki w zakresie partnerstwa pomiędzy aktorami w procesie kreowania, realizacji i ewaluacji polityki publicznej, podkreślając ich fundamenty aksjologiczne. Ma to zwłaszcza zastosowanie wobec sektora wiedzy jako obszaru szczególnie wrażliwego na gruncie instytucjonalnym ze względu na duże aspiracje zaangażowanych twórców. Artykuł przedstawia pojęcie sektora wiedzy na tle określeń powiązanych, takich jak: społeczeństwo wiedzy, społeczeństwo informacyjne, gospodarka oparta na wiedzy, zarządzanie wiedzą, a także formułuje pewne zalecenia dotyczące rozwoju tego sektora. Autor prezentuje strukturę podmiotową sektora wiedzy w ujęciu funkcjonalnym, z podkreśleniem postulatu większej integracji instytucjonalnej w działaniach prorozwojowych. W artykule prezentowane są normy konstytucyjne, a na ich tle postulowane zasady dialogu społecznego i partnerstwa jako zasady fundamentalne w sektorze wiedzy. Autor analizuje misję państwa, podkreślając znaczenie jego roli jako gwaranta tych reguł. Artykuł przedstawia instrumentarium polityki publicznej wobec sektora wiedzy, z podkreśleniem znaczenia zasad i dobrych praktyk we współdziałaniu realizatorów polityki publicznej z kreatorami wiedzy jako ich partnerami środowiskowymi.") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.abstract") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.issn", "2009-8278") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.url", "http://sahjournal.com/index.php/sah/article/view/96") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.identifier.url") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.language", "en") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.rights.licence", "20") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issue", "1") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issuetopic", "Post-Snowden Internet Policy") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "95-136") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.source.pageinfo") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.volume", "3") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "public policy") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "knowledge sector") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "norms") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "good practices") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "surveillance") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "Animalia") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "en", "Constitutional Norms and Good Practices Dedicated to The Implementation of Public Policy Towards The Knowledge Sector") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title.alternative") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.18193/sah.v3i1.96") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "IRL") ) );
Set<InputStream> fileSet = bundle.getContents();
assertTrue( fileSet.size() == 1);
LOG.info("---------------------------------------");
bundle = bss.getBundle("oai:ojs.sahjournal.com:article/126");
LOG.info("{}", bundle);
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", "Studies in Arts and Humanities") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.pubstatus", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Tobin, Feena") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Roinn na NuaGhaeilge, Coláiste na hOllscoile Corcaigh") ) );
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", "2018") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "en", "Do bhí Dubhghlas de hÍde mar chuid de mhionlach in Éirinn agus é ag fás aníos mar fhear óg Protastúnach. Ach shocraigh sé dul leis an nGaeilge, teanga a bhain go traidisiúnta go príomha le Caitlicigh na hÉireann agus leis an ísealaicme. Níor tógadh le Gaeilge é ach lean sé air ag plé léi agus ag cur chun cinn na teangan ach cén fáth?Is trí shúil a chaitheamh ar a chín lae ón luaththréimhse seo ina shaol spéisiúil is féidir tuiscint a fháil ar na cúiseanna gur thug sé fé seo. Rugadh de hÍde in 1860 agus chuaigh sé i mbun pinn in 1874 agus é 14 bliain d’aois. Is í an tréimhse sin ina shaol nuair a bhí sé ina chónaí sa bhaile i nDún Gar i gContae Ros Comáin a bheidh fé chaibidil san alt seo - an tréimhse réamhChraoibhíneach, d’fhéadfá a rá.An rud atá i gceist leis an dteideal ná an t-ainm cleite a thug sé air féin ‘An Craoibhín Aoibhinn’ agus imeartas focal maidir leis an mbrí atá leis an ainm úd.###Dubhghlas de hÍde was part of the Protestant minority in Ireland during his youth. Despite this he decided to master Irish, a language typically associated with Irish Catholics of the lower classes. He was not brought up with Irish but went on to spend his life promoting the language – what led him to this?Through analysis of his diaries in the earlier part of his life an understanding can be gained of the reasons for this. De hÍde was born in 1860 and he began writing his diary in 1874, aged 14. The article will discuss this early period of his life which he spent in Frenchpark in County Roscommon – the pre-‘Craoibhín’ period you could call it!The title refers to his self-appointed pen-name ‘An Craoibhín Aoibhinn’ (The Delightful Little Branch) and contains a pun on the meaning of this name.") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "pl", "Sfera wartości i związane z nimi uwarunkowania polityki to zagadnienia aktualne w naukach społecznych. Autor prezentuje dobre praktyki w zakresie partnerstwa pomiędzy aktorami w procesie kreowania, realizacji i ewaluacji polityki publicznej, podkreślając ich fundamenty aksjologiczne. Ma to zwłaszcza zastosowanie wobec sektora wiedzy jako obszaru szczególnie wrażliwego na gruncie instytucjonalnym ze względu na duże aspiracje zaangażowanych twórców. Artykuł przedstawia pojęcie sektora wiedzy na tle określeń powiązanych, takich jak: społeczeństwo wiedzy, społeczeństwo informacyjne, gospodarka oparta na wiedzy, zarządzanie wiedzą, a także formułuje pewne zalecenia dotyczące rozwoju tego sektora. Autor prezentuje strukturę podmiotową sektora wiedzy w ujęciu funkcjonalnym, z podkreśleniem postulatu większej integracji instytucjonalnej w działaniach prorozwojowych. W artykule prezentowane są normy konstytucyjne, a na ich tle postulowane zasady dialogu społecznego i partnerstwa jako zasady fundamentalne w sektorze wiedzy. Autor analizuje misję państwa, podkreślając znaczenie jego roli jako gwaranta tych reguł. Artykuł przedstawia instrumentarium polityki publicznej wobec sektora wiedzy, z podkreśleniem znaczenia zasad i dobrych praktyk we współdziałaniu realizatorów polityki publicznej z kreatorami wiedzy jako ich partnerami środowiskowymi.") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.abstract") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.issn", "2009-8278") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.url", "http://sahjournal.com/index.php/sah/article/view/126") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.identifier.url") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.language", "en") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.rights.licence", "20") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issue", "1") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issuetopic", "Post-Snowden Internet Policy") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "73-79") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.source.pageinfo") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.volume", "4") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Irish language") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Cultural identity") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Nationalism") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Hyde, Douglas, 1860-1949") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Protestantism") ) );
assertEquals(5, metadata.stream().filter(m -> m.getKey().equals("dc.subject.other") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "Fás an Chraoibhín") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "en", "Constitutional Norms and Good Practices Dedicated to The Implementation of Public Policy Towards The Knowledge Sector") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title.alternative") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.18193/sah.v4i1.126") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "IRL") ) );
fileSet = bundle.getContents();
assertTrue( fileSet.size() == 1);
LOG.info("---------------------------------------");
bundle = bss.getBundle("oai:ojs.sahjournal.com:article/198");
LOG.info("{}", bundle);
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", "Studies in Arts and Humanities") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.pubstatus", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Liston, Katie") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Byrne, Helena") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "O’Riordan, Maeve") ) );
assertEquals(3, metadata.stream().filter(m -> m.getKey().equals("dc.contributor.author") ).count() );
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.date.issued", "2021") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "en", "Do bhí Dubhghlas de hÍde mar chuid de mhionlach in Éirinn agus é ag fás aníos mar fhear óg Protastúnach. Ach shocraigh sé dul leis an nGaeilge, teanga a bhain go traidisiúnta go príomha le Caitlicigh na hÉireann agus leis an ísealaicme. Níor tógadh le Gaeilge é ach lean sé air ag plé léi agus ag cur chun cinn na teangan ach cén fáth?Is trí shúil a chaitheamh ar a chín lae ón luaththréimhse seo ina shaol spéisiúil is féidir tuiscint a fháil ar na cúiseanna gur thug sé fé seo. Rugadh de hÍde in 1860 agus chuaigh sé i mbun pinn in 1874 agus é 14 bliain d’aois. Is í an tréimhse sin ina shaol nuair a bhí sé ina chónaí sa bhaile i nDún Gar i gContae Ros Comáin a bheidh fé chaibidil san alt seo - an tréimhse réamhChraoibhíneach, d’fhéadfá a rá.An rud atá i gceist leis an dteideal ná an t-ainm cleite a thug sé air féin ‘An Craoibhín Aoibhinn’ agus imeartas focal maidir leis an mbrí atá leis an ainm úd.###Dubhghlas de hÍde was part of the Protestant minority in Ireland during his youth. Despite this he decided to master Irish, a language typically associated with Irish Catholics of the lower classes. He was not brought up with Irish but went on to spend his life promoting the language – what led him to this?Through analysis of his diaries in the earlier part of his life an understanding can be gained of the reasons for this. De hÍde was born in 1860 and he began writing his diary in 1874, aged 14. The article will discuss this early period of his life which he spent in Frenchpark in County Roscommon – the pre-‘Craoibhín’ period you could call it!The title refers to his self-appointed pen-name ‘An Craoibhín Aoibhinn’ (The Delightful Little Branch) and contains a pun on the meaning of this name.") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "pl", "Sfera wartości i związane z nimi uwarunkowania polityki to zagadnienia aktualne w naukach społecznych. Autor prezentuje dobre praktyki w zakresie partnerstwa pomiędzy aktorami w procesie kreowania, realizacji i ewaluacji polityki publicznej, podkreślając ich fundamenty aksjologiczne. Ma to zwłaszcza zastosowanie wobec sektora wiedzy jako obszaru szczególnie wrażliwego na gruncie instytucjonalnym ze względu na duże aspiracje zaangażowanych twórców. Artykuł przedstawia pojęcie sektora wiedzy na tle określeń powiązanych, takich jak: społeczeństwo wiedzy, społeczeństwo informacyjne, gospodarka oparta na wiedzy, zarządzanie wiedzą, a także formułuje pewne zalecenia dotyczące rozwoju tego sektora. Autor prezentuje strukturę podmiotową sektora wiedzy w ujęciu funkcjonalnym, z podkreśleniem postulatu większej integracji instytucjonalnej w działaniach prorozwojowych. W artykule prezentowane są normy konstytucyjne, a na ich tle postulowane zasady dialogu społecznego i partnerstwa jako zasady fundamentalne w sektorze wiedzy. Autor analizuje misję państwa, podkreślając znaczenie jego roli jako gwaranta tych reguł. Artykuł przedstawia instrumentarium polityki publicznej wobec sektora wiedzy, z podkreśleniem znaczenia zasad i dobrych praktyk we współdziałaniu realizatorów polityki publicznej z kreatorami wiedzy jako ich partnerami środowiskowymi.") ) );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.abstract") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.issn", "2009-8278") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.url", "http://sahjournal.com/index.php/sah/article/view/198") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.identifier.url") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.language", "en") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.rights.licence", "20") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issue", "1") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issuetopic", "Post-Snowden Internet Policy") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "1-6") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.source.pageinfo") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.volume", "7") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Irish language") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Cultural identity") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Nationalism") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Hyde, Douglas, 1860-1949") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Protestantism") ) );
// assertEquals(5, metadata.stream().filter(m -> m.getKey().equals("dc.subject.other") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "Editorial") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "en", "Constitutional Norms and Good Practices Dedicated to The Implementation of Public Policy Towards The Knowledge Sector") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title.alternative") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.18193/sah.v7i1.198") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "IRL") ) );
assertTrue( metadata.contains( new SimpleMetadatum("ssoar.urn.registration", "false") ) );
fileSet = bundle.getContents();
assertTrue( fileSet.size() == 1);
}
@Test
public void getSinglePublicationDoabooks() throws IOException {
Map<String, String> map = new HashMap<>();
......@@ -2157,11 +2301,11 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
@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 xMetaDissPlusXsltString = IOUtils.toString(
// getClass().
// getClassLoader().
// getResourceAsStream("xslt/fqs-nlm-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
// map.put("nlm", xMetaDissPlusXsltString);
String oaiDcXsltString = IOUtils.toString(
getClass().
......@@ -2174,7 +2318,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
// 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");
Bundle bundle = bss.getBundle("oai:ojs.qualitative-research.net:article/2671");
LOG.info("{}", bundle);
Set<Metadatum> metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
......@@ -2222,7 +2366,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title.alternative") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.17169/fqs-18.2.2671") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.urn", "urn:nbn:de:0114-fqs170243") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.dda.reference", "http://www.qualitative-research.net/index.php/fqs/oai/@@oai:www.qualitative-research.net:article/2671") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.dda.reference", "http://www.qualitative-research.net/index.php/fqs/oai/@@oai:ojs.qualitative-research.net:article/2671") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "DEU") ) );
}
......
<?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:when test="$inputLanguage = 'spa' or $inputLanguage = 'ES' or $inputLanguage = 'es-ES' or $inputLanguage = 'esp'">
<xsl:value-of select="'es'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$inputLanguage" />
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:stylesheet version="2.0"
xpath-default-namespace="http://www.openarchives.org/OAI/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:if
test="starts-with(oai:OAI-PMH/oai:GetRecord/oai:record/oai:header/oai:setSpec, '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: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.source.journal'" />
<xsl:with-param name="language" select="''" />
<!-- xsl:with-param name="value" select="'Forum Qualitative Sozialforschung
/ Forum: Qualitative Social Research'"/ -->
<xsl:with-param name="value" select="'132'" />
</xsl:call-template>
<!-- xsl:call-template name="new-metadatum"> <xsl:with-param name="key"
select="'internal.identifier.journal'"/> <xsl:with-param name="language"
select="''"/> <xsl:with-param name="value" select="'1690'"/> </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>
<!-- <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="'false'"/> </xsl:call-template> -->
<xsl:choose>
<xsl:when
test="contains(./dc:type[@xml:lang='en-US'], 'Editorial')">
<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="'2'" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<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:otherwise>
</xsl:choose>
<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="'false'" />
</xsl:call-template>
<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="'1438-5627'" />
</xsl:call-template>
<!-- xsl:call-template name="new-metadatum"> <xsl:with-param name="key"
select="'internal.identifier.ddc'"/> <xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'300'"/> </xsl:call-template> <xsl:call-template
name="new-metadatum"> <xsl:with-param name="key" select="'dc.subject.ddc'"/>
<xsl:with-param name="language" select="''"/> <xsl:with-param name="value"
select="'300'"/> </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></xsl:apply-templates>
</xsl:template>
<xsl:template match="dc:language">
<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:template>
<xsl:template match="dc:creator">
<xsl:choose>
<xsl:when test="contains(text(), ';')">
<xsl:variable name="tokenizedAuthors"
select="tokenize(text(),';')" />
<xsl:for-each select="$tokenizedAuthors">
<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="normalize-space(.)" />
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<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:otherwise>
</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:description">
<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="normalize-space(replace(text(),'[»«]','&quot;'))" />
</xsl:call-template>
<xsl:variable name="maybeUrn"
select="zoai:extractUrnFromFqsAbstract(text() )" />
<xsl:if test="$maybeUrn != ''">
<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="$maybeUrn" />
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:rights">
<xsl:choose>
<xsl:when
test="text() = 'https://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="text() = 'https://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="text() = 'https://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:when test="contains(text(),'creativecommons.org')">
<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="text()" />
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:source[@xml:lang='en-US']">
<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:variable name="issue"
select="substring-before(substring-after(text(),'No.'),'(')" />
<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="normalize-space($issue)" />
</xsl:call-template>
</xsl:if>
<xsl:variable name="volume"
select="substring-before(substring-after(text(),'Vol. '),' ')" />
<xsl:if test="$volume != '' and matches ($volume, '\d+')">
<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($volume)" />
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:subject">