From 1425d810a864206b373fa5fe76fdf519b0c00e41 Mon Sep 17 00:00:00 2001 From: Alessia Bardi Date: Mon, 19 Oct 2020 17:46:14 +0200 Subject: [PATCH] testing mapping --- .../dnetlib/dhp/oa/graph/raw/MappersTest.java | 33 +++++- .../dhp/oa/graph/raw/oaf_claim_crossref.xml | 68 ++++++++++++ .../dnetlib/dhp/oa/graph/raw/odf_nakala.xml | 86 ++++++++------- .../dnetlib/dhp/oa/graph/raw/odf_record.xml | 102 ++++++++++++++++++ 4 files changed, 244 insertions(+), 45 deletions(-) create mode 100644 dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/oaf_claim_crossref.xml create mode 100644 dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_record.xml 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 2c10f8f58..af9fadb5a 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 @@ -304,9 +304,40 @@ public class MappersTest { assertValidId(d.getCollectedfrom().get(0).getKey()); assertTrue(StringUtils.isNotBlank(d.getTitle().get(0).getValue())); assertEquals(1, d.getAuthor().size()); - assertEquals(0, d.getSubject().size()); + assertEquals(1, d.getSubject().size()); assertEquals(1, d.getInstance().size()); assertEquals(1, d.getPid().size()); + assertNotNull(d.getInstance().get(0).getUrl()); + } + + @Test + void testClaimFromCrossref() throws IOException { + final String xml = IOUtils.toString(getClass().getResourceAsStream("oaf_claim_crossref.xml")); + final List list = new OafToOafMapper(vocs, false).processMdRecord(xml); + + System.out.println("***************"); + System.out.println(new ObjectMapper().writeValueAsString(list)); + System.out.println("***************"); + + final Publication p = (Publication) list.get(0); + assertValidId(p.getId()); + assertValidId(p.getCollectedfrom().get(0).getKey()); + System.out.println(p.getTitle().get(0).getValue()); + assertTrue(StringUtils.isNotBlank(p.getTitle().get(0).getValue())); + } + + @Test + void testODFRecord() throws IOException { + final String xml = IOUtils.toString(getClass().getResourceAsStream("odf_record.xml")); + List list = new OdfToOafMapper(vocs, false).processMdRecord(xml); + System.out.println("***************"); + System.out.println(new ObjectMapper().writeValueAsString(list)); + System.out.println("***************"); + final Dataset p = (Dataset) list.get(0); + assertValidId(p.getId()); + assertValidId(p.getCollectedfrom().get(0).getKey()); + System.out.println(p.getTitle().get(0).getValue()); + assertTrue(StringUtils.isNotBlank(p.getTitle().get(0).getValue())); } private void assertValidId(final String id) { diff --git a/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/oaf_claim_crossref.xml b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/oaf_claim_crossref.xml new file mode 100644 index 000000000..8f69a5e2d --- /dev/null +++ b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/oaf_claim_crossref.xml @@ -0,0 +1,68 @@ + + +
+ userclaim___::7f0f7807f17db50e5c2b5c452ccaf06d + userclaim___::7f0f7807f17db50e5c2b5c452ccaf06d + 2020-08-06T07:04:09.62Z + + + + + + 2020-08-06T07:20:57.911Z + openaire____ +
+ + A case report of serious haemolysis in a glucose-6-phosphate dehydrogenase-deficient COVID-19 patient receiving hydroxychloroquine + Maillart, E. + Leemans, S. + Van Noten, H. + Vandergraesen, T. + Mahadeb, B. + Salaouatchi, M. T. + De Bels, D. + Clevenbergh, P. + + http://dx.doi.org/10.1080/23744235.2020.1774644 + + Informa UK Limited + Crossref + Infectious Diseases + Microbiology (medical) + General Immunology and Microbiology + Infectious Diseases + General Medicine + journal-article + 0001 + 2020-06-04 + + UNKNOWN + + + 10.1080/23744235.2020.1774644 + Infectious Diseases + + + + + file%3A%2F%2F%2Fsrv%2Fclaims%2Frecords%2Fpublication%2Fcrossref + + + + + + + false + false + 0.9 + + + + +
\ No newline at end of file diff --git a/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_nakala.xml b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_nakala.xml index 105d0c413..7796e4c37 100644 --- a/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_nakala.xml +++ b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_nakala.xml @@ -1,77 +1,75 @@ + xmlns:oaf="http://namespace.openaire.eu/oaf" + xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - r3f5b9831893::cca7367159bc3ff90cd2f75bf9dc21c4 - oai:nakala.fr:hdl_11280_847e01df - 2020-08-01T00:16:24.742Z + xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"> + r3f5b9831893::01a497c6c6b44289c52dcdf22b6c0fc0 + oai:nakala.fr:hdl_11280_50f302c6 + 2020-10-03T06:06:52.228Z r3f5b9831893 - oai:nakala.fr:hdl_11280_847e01df - 2020-06-08T01:01:38Z - hdl_11280_2b09fc10 - hdl_11280_c1bc48d0 - hdl_11280_57c8db3a - 2020-08-01T00:31:35.625Z + oai:nakala.fr:hdl_11280_50f302c6 + 2020-09-19T23:56:08Z + hdl_11280_96355742 + hdl_11280_26914437 + hdl_11280_86561837 + 2020-10-19T15:39:52.151Z - 277 - http://hdl.handle.net/11280/847e01df - - http://hdl.handle.net/http://hdl.handle.net/11280/847e01df - - http://nakala.fr/data/11280/847e01df - + http://nakala.fr/data/11280/50f302c6 + 11280/50f302c6 + - DHAAP + Desbrosse, Xavier - - CVP_Notice277-1 place du Docteur Antoine Béclère _PHO02.jpg + + Les rues Stalingrad en France (1945-2013) - - Hôpital Saint-Antoine. Fragment de dalle funéraire trouvée en décembre 1932. Paris (XIIème arr.). Photographie d'Albert Citerne (1876-1970). Plaque de verre, 1932. Département Histoire de l'Architecture et Archéologie de Paris. - Nfa_1146 - Hôpital Saint-Antoine. Fragment de dalle funéraire trouvée en décembre 1932. Paris (XIIème arr.). Photographie d'Albert Citerne (1876-1970). Plaque de verre, 1932. Département Histoire de l'Architecture et Archéologie de Paris. + + Rues – Noms -- France + + + Cette carte appartient à la collection « Guerre froide vue d’en bas » élaborée dans le cadre de l’enquête 2009-2013 du réseau des correspondants départementaux de l’IHTP « La Guerre froide vue d’en bas : 1947-1967 », enquête conduite sous la direction de Philippe Buton Professeur d’Histoire contemporaine à l’Université de Reims, d’Olivier Büttner Ingénieur de Recherche IHTP-CNRS et de Michel Hastings, Professeur de Science politique à l’Institut d’Etudes Politiques de Lille. - Nakala by Huma-Num - + IHTP-CNRS + - DHAAP, Pôle Archéologique + (CNRS), Institut d'Histoire du Temps Présent (IHTP) - Centre National de la Recherche Scientifique - - 1932 + + 2013 - StillImage - - - + Carte + + + France + + - http://hdl.handle.net/11280/847e01df + 11280/50f302c6 + 0025 - OPEN + UNKNOWN und + xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"> - - https%3A%2F%2Fwww.nakala.fr%2Foai_oa%2F11280%2F8892ab4b - oai:nakala.fr:hdl_11280_847e01df - 2020-06-08T01:01:38Z + + https%3A%2F%2Fwww.nakala.fr%2Foai_oa%2F11280%2F92c4d30b + oai:nakala.fr:hdl_11280_50f302c6 + 2020-09-19T23:56:08Z diff --git a/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_record.xml b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_record.xml new file mode 100644 index 000000000..e2d51a43d --- /dev/null +++ b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/odf_record.xml @@ -0,0 +1,102 @@ + + + + r3a507cdacc5::03b31980d9bb3c4609e6005c4a3baba6 + oai:lindat.mff.cuni.cz:11372/LRT-1844 + 2020-09-04T14:36:48.411Z + r3a507cdacc5 + oai:lindat.mff.cuni.cz:11372/LRT-1844 + 2016-12-07T11:10:30Z + hdl_11858_00-097C-0000-0007-710A-A + hdl_11858_00-097C-0000-0007-710B-8 + openaire_data + 2020-09-04T14:39:16.458Z + + + + 11372/LRT-1844 + + http://hdl.handle.net/11372/LRT-1844 + + + + Hercig, Tomáš + + + Brychcín, Tomáš + + + Svoboda, Lukáš + + + Konkol, Michal + + + Steinberger, Josef + + + + Restaurant Reviews CZ ABSA corpus v2 + + University of West Bohemia, Department of Computer Science and Engineering + 2016 + + + European Commission + info:eu-repo/grantAgreement/EC/FP7/630786 + + + + 2016 + 2016-12-07T11:10:30Z + 2016-12-07T11:10:30Z + + corpus + + + + + + Restaurant Reviews CZ ABSA - 2.15k reviews with their related target and category + + The work done is described in the paper: https://doi.org/10.13053/CyS-20-3-2469 + + + 11372/LRT-1844 + 2016-12-07 + 0021 + 2016-01-01 + OPEN + http://creativecommons.org/licenses/by-nc-sa/4.0/ + und + corda_______::630786 + + + + + + + https%3A%2F%2Flindat.mff.cuni.cz%2Frepository%2Foai%2Fopenaire_data + oai:lindat.mff.cuni.cz:11372/LRT-1844 + 2016-12-07T11:10:30Z + + + + + false + false + 0.9 + + + + +