Commit 408b0473 authored by Steinberg, Jan's avatar Steinberg, Jan

added region - journal of ERSA

parent 08239d2f
......@@ -262,6 +262,13 @@ public class ContentResolver {
}
}
// workaround for openjournals.wu-wien.ac.at/ojs redundant http and https urls
Set<String> maybeUniWienHttpsUrls = contentsUrlStrings.stream().filter(str -> str.startsWith("https://openjournals.wu-wien.ac.at/ojs")).collect(Collectors.toSet());
if (maybeUniWienHttpsUrls.size() >= 1) {
contentsUrlStrings = maybeUniWienHttpsUrls;
}
return contentsUrlStrings;
}
......
......@@ -69,7 +69,7 @@ jhipster:
# ===================================================================
ingester:
endpoint: http://ssoar.svko-dda-test.gesis.intra/rest
endpoint: https://ssoar.svko-dda-test.gesis.intra/rest
email: dummy-editor@example.com
password: dummy-editor
targetCollection: 11
......@@ -6,6 +6,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
......@@ -817,15 +818,26 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "MISC") ) );
}
// UPDATE 2018-05-04 REGION currently does not provide nlm metadata prefix
@Test
public void getSinglePublicationRegion() throws IOException {
Map<String, String> map = new HashMap<>();
String xMetaDissPlusXsltString = IOUtils.toString(
/*
// UPDATE 2018-05-04 REGION currently does not provide nlm metadata prefix
String nlmXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/region-nlm-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("nlm", xMetaDissPlusXsltString);
map.put("nlm", nlmXsltString);
*/
String oaiMarcXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/region-oai_marc-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("oai_marc", oaiMarcXsltString);
String oaiDcXsltString = IOUtils.toString(
getClass().
......@@ -833,7 +845,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
getResourceAsStream("xslt/region-oai_dc-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("oai_dc", oaiDcXsltString);
XsltTransformerOaiPmhBundlesStreamSource bss = new XsltTransformerOaiPmhBundlesStreamSource("http://openjournals.wu.ac.at/ojs/index.php/region/oai/", map);
XsltTransformerOaiPmhBundlesStreamSource bss = new XsltTransformerOaiPmhBundlesStreamSource("https://openjournals.wu-wien.ac.at/ojs/index.php/region/oai/", map);
Bundle bundle = bss.getBundle("oai:ojs.openjournals.wu.ac.at:article/121");
......@@ -855,7 +867,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "en", "We study the association between fiscal policy and subjective wellbeing using fiscal data on 34 countries across 129 country-years, combined with over 170,000 people’s subjective wellbeing scores. While past research has found that ‘distortionary taxes’ (e.g. income taxes) are associated with slow growth relative to ‘non-distortionary’ taxes (GST/VAT), we find that distortionary taxes are associated with higher levels of subjective wellbeing than non-distortionary taxes. This relationship holds when we control for macro-economic variables and country fixed effects. If this relationship is causal, it would offer an explanation as to why governments pursue these policies that harm economic growth. We find that richer people’s subjective wellbeing is less harmed by indirect taxes than people with lower incomes, while “unproductive expenditure” is associated with higher wellbeing for the middle class relative to others, possibly reflecting middle class capture. We see little evidence for differential effects of fiscal policy on people living in different sized settlements. Devolving a portion of expenditure to subnational government is associated with higher subjective wellbeing but devolving tax collection to subnational government is associated with monotonically lower subjective wellbeing.") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.abstract") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.issn", "2409-5370") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.url", "http://openjournals.wu.ac.at/ojs/index.php/region/article/view/121") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.url", "https://openjournals.wu-wien.ac.at/ojs/index.php/region/article/view/121") ) );
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", "32") ) );
......@@ -864,16 +876,29 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "43-69") ) );
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", "Subjective wellbeing") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Fiscal policy") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Decentralised government") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Subjective wellbeing") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Fiscal policy") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "en", "Decentralised government") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "Subjective Wellbeing Impacts of National and Subnational Fiscal Policies") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://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("internal.dda.reference", "https://openjournals.wu-wien.ac.at/ojs/index.php/region/oai/@@oai:ojs.openjournals.wu.ac.at:article/121") ) );
// assertFalse( metadata.contains( new SimpleMetadatum("internal.dda.reference", "https://openjournals.wu-wien.ac.at/ojs/index.php/region/oai@@oai:ojs.openjournals.wu.ac.at:article/121") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "AUT") ) );
Set<InputStream> fileSet = bundle.getContents();
assertEquals( 1, fileSet.size());
LOG.info("---------------------------------------");
bundle = bss.getBundle("oai:ojs.openjournals.wu.ac.at:article/111");
metadata = bundle.getMetadata();
assertTrue( metadata.contains( new SimpleMetadatum("internal.dda.reference", "https://openjournals.wu-wien.ac.at/ojs/index.php/region/oai/@@oai:ojs.openjournals.wu.ac.at:article/111") ) );
// assertFalse( metadata.contains( new SimpleMetadatum("internal.dda.reference", "https://openjournals.wu-wien.ac.at/ojs/index.php/region/oai@@oai:ojs.openjournals.wu.ac.at:article/111") ) );
fileSet = bundle.getContents();
assertEquals( 1, fileSet.size());
LOG.info("---------------------------------------");
bundle = bss.getBundle("oai:ojs.openjournals.wu.ac.at:article/188");
LOG.info("{}", bundle);
metadata = bundle.getMetadata();
......@@ -881,7 +906,21 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
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") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issuetopic", "Special Issue: Well-being in cities and regions: measurement, analysis and policy practices") ) );
fileSet = bundle.getContents();
assertEquals( 1, fileSet.size());
LOG.info("---------------------------------------");
bundle = bss.getBundle("oai:ojs.openjournals.wu.ac.at:article/18");
fileSet = bundle.getContents();
assertEquals( 1, fileSet.size());
LOG.info("---------------------------------------");
bundle = bss.getBundle("oai:ojs.openjournals.wu.ac.at:article/176");
fileSet = bundle.getContents();
assertEquals( 1, fileSet.size());
}
......
This diff is collapsed.
Markdown is supported
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