From 0f1a4f6637d087808708b8321e354bd2e78ac9e1 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Mon, 9 Nov 2020 16:07:17 +0100 Subject: [PATCH] added collectedfrom information on record --- .../clean/authorpids/PrepareResultsSparkJob.java | 4 +++- .../dhp/oa/graph/clean/authorpids/ResultInfo.java | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/PrepareResultsSparkJob.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/PrepareResultsSparkJob.java index 7a7d97c3dd..a8597cce6c 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/PrepareResultsSparkJob.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/PrepareResultsSparkJob.java @@ -73,10 +73,12 @@ public class PrepareResultsSparkJob implements Serializable { result.createOrReplaceTempView("result"); - String query = "select auth.name name, auth.surname surname, auth.fullname fullname, pIde.value orcid, id " + + String query = "select auth.name name, auth.surname surname, auth.fullname fullname, pIde.value orcid, id, cf.value collectedfrom" + + "from result " + "lateral view explode(author) a as auth " + "lateral view explode(auth.pid)p as pIde " + + "lateral view explode (collectedfrom) c as cf " + "where pIde.qualifier.classid = 'orcid'"; spark diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/ResultInfo.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/ResultInfo.java index 768a63d164..cd8581e846 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/ResultInfo.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/ResultInfo.java @@ -9,6 +9,15 @@ public class ResultInfo implements Serializable { private String surname; private String fullname; private String orcid; + private String collectedfrom; + + public String getCollectedfrom() { + return collectedfrom; + } + + public void setCollectedfrom(String collectedfrom) { + this.collectedfrom = collectedfrom; + } public String getId() { return id; @@ -50,7 +59,4 @@ public class ResultInfo implements Serializable { this.orcid = orcid; } - public void removeOrcid() { - this.orcid = ""; - } }