From f25407bbe24016355e782b1d5d6e7ccb6e23be97 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Fri, 11 Mar 2022 09:32:42 +0100 Subject: [PATCH 1/4] added mapping for datasource consent fields to integrate them in the graph --- .../graph/raw/MigrateDbEntitiesApplication.java | 3 +++ .../dnetlib/dhp/oa/graph/sql/queryDatasources.sql | 3 +++ .../raw/MigrateDbEntitiesApplicationTest.java | 3 +++ .../oa/graph/raw/datasources_resultset_entry.json | 15 +++++++++++++++ pom.xml | 2 +- 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/MigrateDbEntitiesApplication.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/MigrateDbEntitiesApplication.java index e453f7918..1f8c23ac3 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/MigrateDbEntitiesApplication.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/MigrateDbEntitiesApplication.java @@ -309,6 +309,9 @@ public class MigrateDbEntitiesApplication extends AbstractMigrationApplication i ds.setThematic(rs.getBoolean("thematic")); ds.setKnowledgegraph(rs.getBoolean("knowledgegraph")); ds.setContentpolicies(prepareListOfQualifiers(rs.getArray("contentpolicies"))); + ds.setConsenttermsofuse(rs.getBoolean("consenttermsofuse")); + ds.setFulltextdownload(rs.getBoolean("fulltextdownload")); + ds.setConsenttermsofusedate(rs.getDate("consenttermsofusedate").toString()); return Arrays.asList(ds); } catch (final Exception e) { diff --git a/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryDatasources.sql b/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryDatasources.sql index 98092e882..2623c65c4 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryDatasources.sql +++ b/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryDatasources.sql @@ -89,6 +89,9 @@ SELECT d.issn AS issnPrinted, d.eissn AS issnOnline, d.lissn AS issnLinking, + d.consenttermsofuse AS consenttermsofuse, + d.fulltextdownload AS fulltextdownload, + d.consenttermsofusedate AS consenttermsofusedate, de.jurisdiction||'@@@eosc:jurisdictions' AS jurisdiction, de.thematic AS thematic, de.knowledge_graph AS knowledgegraph, diff --git a/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MigrateDbEntitiesApplicationTest.java b/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MigrateDbEntitiesApplicationTest.java index b65bd9fd8..05ae5be74 100644 --- a/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MigrateDbEntitiesApplicationTest.java +++ b/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MigrateDbEntitiesApplicationTest.java @@ -100,6 +100,9 @@ public class MigrateDbEntitiesApplicationTest { assertEquals("Journal article", ds.getContentpolicies().get(0).getClassid()); assertEquals("eosc:contentpolicies", ds.getContentpolicies().get(0).getSchemeid()); + assertEquals(true, ds.getConsenttermsofuse()); + assertEquals(true, ds.getFulltextdownload()); + assertEquals("2022-03-11", ds.getConsenttermsofusedate()); } @Test diff --git a/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/datasources_resultset_entry.json b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/datasources_resultset_entry.json index 42b140306..11b884cde 100644 --- a/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/datasources_resultset_entry.json +++ b/dhp-workflows/dhp-graph-mapper/src/test/resources/eu/dnetlib/dhp/oa/graph/raw/datasources_resultset_entry.json @@ -268,5 +268,20 @@ "value": [ "Journal article@@@eosc:contentpolicies" ] + }, + { + "field": "consenttermsofuse", + "type": "boolean", + "value": true + }, + { + "field": "fulltextdownload", + "type": "boolean", + "value": true + }, + { + "field": "consenttermsofusedate", + "type": "date", + "value": "2022-03-11" } ] diff --git a/pom.xml b/pom.xml index 603a4cf1e..7a20a1652 100644 --- a/pom.xml +++ b/pom.xml @@ -797,7 +797,7 @@ 3.3.3 3.4.2 [2.12,3.0) - [2.10.29] + [2.10.30-SNAPSHOT] [4.0.3] [6.0.5] [3.1.6] From 7b8f85692e990abdc30e0f70e77f63bc95fbbe31 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Wed, 23 Mar 2022 17:20:23 +0100 Subject: [PATCH 2/4] [Enrichment country] fixed issues with parameters and workflow args --- .../input_countrypropagation_parameters.json | 6 ------ .../dhp/countrypropagation/oozie_app/workflow.xml | 9 ++++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/dhp-workflows/dhp-enrichment/src/main/resources/eu/dnetlib/dhp/countrypropagation/input_countrypropagation_parameters.json b/dhp-workflows/dhp-enrichment/src/main/resources/eu/dnetlib/dhp/countrypropagation/input_countrypropagation_parameters.json index e7a6bf5b0..f217e2458 100644 --- a/dhp-workflows/dhp-enrichment/src/main/resources/eu/dnetlib/dhp/countrypropagation/input_countrypropagation_parameters.json +++ b/dhp-workflows/dhp-enrichment/src/main/resources/eu/dnetlib/dhp/countrypropagation/input_countrypropagation_parameters.json @@ -5,12 +5,6 @@ "paramDescription": "the path of the sequencial file to read", "paramRequired": true }, - { - "paramName":"h", - "paramLongName":"hive_metastore_uris", - "paramDescription": "the hive metastore uris", - "paramRequired": false - }, { "paramName":"tn", "paramLongName":"resultTableName", diff --git a/dhp-workflows/dhp-enrichment/src/main/resources/eu/dnetlib/dhp/countrypropagation/oozie_app/workflow.xml b/dhp-workflows/dhp-enrichment/src/main/resources/eu/dnetlib/dhp/countrypropagation/oozie_app/workflow.xml index 85116e4cc..202c86a6d 100644 --- a/dhp-workflows/dhp-enrichment/src/main/resources/eu/dnetlib/dhp/countrypropagation/oozie_app/workflow.xml +++ b/dhp-workflows/dhp-enrichment/src/main/resources/eu/dnetlib/dhp/countrypropagation/oozie_app/workflow.xml @@ -110,7 +110,6 @@ --sourcePath${sourcePath} --whitelist${whitelist} --allowedtypes${allowedtypes} - --hive_metastore_uris${hive_metastore_uris} --outputPath${workingDir}/preparedInfo @@ -146,7 +145,7 @@ --sourcePath${sourcePath}/publication --outputPath${workingDir}/publication - --hive_metastore_uris${hive_metastore_uris} + --workingPath${workingDir}/workingP --resultTableNameeu.dnetlib.dhp.schema.oaf.Publication --preparedInfoPath${workingDir}/preparedInfo @@ -176,7 +175,7 @@ --sourcePath${sourcePath}/dataset --outputPath${workingDir}/dataset - --hive_metastore_uris${hive_metastore_uris} + --workingPath${workingDir}/workingD --resultTableNameeu.dnetlib.dhp.schema.oaf.Dataset --preparedInfoPath${workingDir}/preparedInfo @@ -206,7 +205,7 @@ --sourcePath${sourcePath}/otherresearchproduct --outputPath${workingDir}/otherresearchproduct - --hive_metastore_uris${hive_metastore_uris} + --workingPath${workingDir}/workingO --resultTableNameeu.dnetlib.dhp.schema.oaf.OtherResearchProduct --preparedInfoPath${workingDir}/preparedInfo @@ -236,7 +235,7 @@ --sourcePath${sourcePath}/software --outputPath${workingDir}/software - --hive_metastore_uris${hive_metastore_uris} + --workingPath${workingDir}/workingS --resultTableNameeu.dnetlib.dhp.schema.oaf.Software --preparedInfoPath${workingDir}/preparedInfo From 61319b2e8324d73620ed3618acd527333fbceef6 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Fri, 25 Mar 2022 16:38:33 +0100 Subject: [PATCH 3/4] updated dhp-schema version; set entity-level dataInfo before & after merging the fields from the group of duplicates --- .../eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java | 2 +- .../eu/dnetlib/dhp/oa/dedup/EntityMergerTest.java | 11 ++++++++++- pom.xml | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java b/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java index b8ae4ca02..d345cf98f 100644 --- a/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java +++ b/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java @@ -107,7 +107,7 @@ public class DedupRecordFactory { entity.setId(id); entity.setLastupdatetimestamp(ts); - entity.getDataInfo().setDeletedbyinference(false); + entity.setDataInfo(dataInfo); return entity; } diff --git a/dhp-workflows/dhp-dedup-openaire/src/test/java/eu/dnetlib/dhp/oa/dedup/EntityMergerTest.java b/dhp-workflows/dhp-dedup-openaire/src/test/java/eu/dnetlib/dhp/oa/dedup/EntityMergerTest.java index e86f91f99..aa3722ce5 100644 --- a/dhp-workflows/dhp-dedup-openaire/src/test/java/eu/dnetlib/dhp/oa/dedup/EntityMergerTest.java +++ b/dhp-workflows/dhp-dedup-openaire/src/test/java/eu/dnetlib/dhp/oa/dedup/EntityMergerTest.java @@ -77,7 +77,16 @@ class EntityMergerTest implements Serializable { // verify id assertEquals(dedupId, pub_merged.getId()); - assertEquals(pub_top.getJournal(), pub_merged.getJournal()); + assertEquals(pub_top.getJournal().getName(), pub_merged.getJournal().getName()); + assertEquals(pub_top.getJournal().getIssnOnline(), pub_merged.getJournal().getIssnOnline()); + assertEquals(pub_top.getJournal().getIssnLinking(), pub_merged.getJournal().getIssnLinking()); + assertEquals(pub_top.getJournal().getIssnPrinted(), pub_merged.getJournal().getIssnPrinted()); + assertEquals(pub_top.getJournal().getIss(), pub_merged.getJournal().getIss()); + assertEquals(pub_top.getJournal().getEp(), pub_merged.getJournal().getEp()); + assertEquals(pub_top.getJournal().getSp(), pub_merged.getJournal().getSp()); + assertEquals(pub_top.getJournal().getVol(), pub_merged.getJournal().getVol()); + assertEquals(pub_top.getJournal().getConferencedate(), pub_merged.getJournal().getConferencedate()); + assertEquals(pub_top.getJournal().getConferenceplace(), pub_merged.getJournal().getConferenceplace()); assertEquals("OPEN", pub_merged.getBestaccessright().getClassid()); assertEquals(pub_top.getResulttype(), pub_merged.getResulttype()); assertEquals(pub_top.getLanguage(), pub_merged.getLanguage()); diff --git a/pom.xml b/pom.xml index 86adee902..45265d5ba 100644 --- a/pom.xml +++ b/pom.xml @@ -797,7 +797,7 @@ 3.3.3 3.4.2 [2.12,3.0) - [2.10.29] + [2.10.31] [4.0.3] [6.0.5] [3.1.6] From 3610f1749ab7896cc72f131236a3455635200c65 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 28 Mar 2022 09:20:27 +0200 Subject: [PATCH 4/4] merged pom.xml from beta branch --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7a20a1652..45265d5ba 100644 --- a/pom.xml +++ b/pom.xml @@ -797,11 +797,11 @@ 3.3.3 3.4.2 [2.12,3.0) - [2.10.30-SNAPSHOT] + [2.10.31] [4.0.3] [6.0.5] [3.1.6] - [4.1.7] + [4.1.12] [2.6.1] 7.5.0 4.7.2