From 232dce83db69de7860ebf98a86addd1fafb7d432 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Thu, 20 May 2021 14:40:22 +0200 Subject: [PATCH] fixes #6701: xpath for titles to support both datacite and Guidelines v4 mapping --- .../dhp/oa/graph/raw/OdfToOafMapper.java | 2 +- .../dnetlib/dhp/oa/graph/raw/MappersTest.java | 45 ++++++++++ .../dhp/oa/graph/raw/odf_bielefeld.xml | 90 +++++++++++++++++++ 3 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_bielefeld.xml diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OdfToOafMapper.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OdfToOafMapper.java index e5b477209..121805bb7 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OdfToOafMapper.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OdfToOafMapper.java @@ -28,7 +28,7 @@ public class OdfToOafMapper extends AbstractMdRecordToOafMapper { @Override protected List prepareTitles(final Document doc, final DataInfo info) { return prepareListStructProps( - doc, "//*[local-name()='titles']/*[local-name()='title']", MAIN_TITLE_QUALIFIER, info); + doc, "//*[local-name()='titles']/*[local-name()='title']|//*[local-name()='resource']/*[local-name()='title']", MAIN_TITLE_QUALIFIER, info); } @Override diff --git a/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MappersTest.java b/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MappersTest.java index 254972e12..9a64aac9e 100644 --- a/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MappersTest.java +++ b/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MappersTest.java @@ -327,6 +327,51 @@ public class MappersTest { assertEquals(r2.getValidationDate(), "2020-01-01"); } + @Test + void testOdfBielefeld() throws IOException { + final String xml = IOUtils.toString(getClass().getResourceAsStream("odf_bielefeld.xml")); + + final List list = new OdfToOafMapper(vocs, false).processMdRecord(xml); + + assertEquals(1, list.size()); + assertTrue(list.get(0) instanceof Publication); + + final Publication p = (Publication) list.get(0); + + assertValidId(p.getId()); + assertTrue(p.getOriginalId().size() == 1); + assertEquals("oai:pub.uni-bielefeld.de:2949739", p.getOriginalId().get(0)); + assertValidId(p.getCollectedfrom().get(0).getKey()); + assertTrue(p.getAuthor().size() > 0); + + final Optional author = p + .getAuthor() + .stream() + .findFirst(); + assertTrue(author.isPresent()); + + assertEquals("Potwarka, Luke R.", author.get().getFullname()); + assertEquals("Potwarka", author.get().getSurname()); + assertEquals("Luke R.", author.get().getName()); + + assertTrue(p.getSubject().size() > 0); + assertTrue(p.getInstance().size() > 0); + + assertNotNull(p.getTitle()); + assertFalse(p.getTitle().isEmpty()); + + assertNotNull(p.getInstance()); + assertTrue(p.getInstance().size() > 0); + p + .getInstance() + .stream() + .forEach(i -> { + assertNotNull(i.getAccessright()); + assertEquals("OPEN", i.getAccessright().getClassid()); + }); + assertEquals("UNKNOWN", p.getInstance().get(0).getRefereed().getClassid()); + } + @Test void testOpentrial() throws IOException { final String xml = IOUtils.toString(getClass().getResourceAsStream("odf_opentrial.xml")); diff --git a/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_bielefeld.xml b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_bielefeld.xml new file mode 100644 index 000000000..51413b633 --- /dev/null +++ b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_bielefeld.xml @@ -0,0 +1,90 @@ + + + + od______2294::3319684c321620512ddebd65f0e44dcf + oai:pub.uni-bielefeld.de:2949739 + 2021-05-12T23:41:23.636Z + od______2294 + oai:pub.uni-bielefeld.de:2949739 + 2021-02-01T11:07:07Z + journal_article + doc-type:article + ddc:796 + journal_articleFtxt + open_access + 2021-05-12T23:51:25.559Z + + + + 10.3390/su13010069 + + urn:nbn:de:0070-pub-29497390 + https://pub.uni-bielefeld.de/record/2949739 + + + https://pub.uni-bielefeld.de/record/2949739.json + 2071-1050 + + Policy makers often legitimize bids for major sport events and public funding of elite sports by trickle-down effects, suggesting that hosting events, sporting success, and athlete role models inspire the population to participate themselves in sport and physical activity. According to previous review articles, empirical evidence of trickle-down effects are mixed, with several studies citing marginal or no effect. The purpose of this study is to apply a realist synthesis approach to evaluate under which conditions trickle-down effects occur (i.e., what works for whom under which circumstances?). Using rapid evidence assessment methodology, 58 empirical articles were identified in the search process and critically analyzed through the lens of realist synthesis evaluation. The analysis identified six conditions under which trickle-down effects have occurred: Event leveraging initiatives, capacity of community sport to cater for new participants, live spectating experiences, consumption possibilities on television or other media, and communities housing event venues. The findings have implications for the sustainability of sport policy decisions and public finance, as the likelihood of trickle-down effects increases with integrated planning and sustainable spending related to the above six conditions. + + eng + MDPI + application/pdf + Conditions under Which Trickle-Down Effects Occur: A Realist Synthesis Approach + + + Potwarka, Luke R. + + + Wicker, Pamela + + + 2021 + open access + + 796 + demonstration effect + sport participation legacy + sport event + evaluation + + + 11 B + + + 0001 + 2021-01-01 + OPEN + https://creativecommons.org/licenses/by/4.0/ + eng + + + https://pub.uni-bielefeld.de/download/2949739/2949794 + + + + + http%3A%2F%2Fpub.uni-bielefeld.de%2Foai + oai:pub.uni-bielefeld.de:2949739 + 2021-02-01T11:07:07Z + + + + + false + false + 0.9 + + + + + \ No newline at end of file