diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/H2020Classification.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/H2020Classification.java new file mode 100644 index 000000000..4a61663b8 --- /dev/null +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/H2020Classification.java @@ -0,0 +1,82 @@ + +package eu.dnetlib.dhp.schema.dump.oaf.graph; + +import java.io.Serializable; + +/** + * To store information about the classification for the project. The classification depends on the programme. For example + * H2020-EU.3.4.5.3 can be classified as + * H2020-EU.3. => Societal Challenges (level1) + * H2020-EU.3.4. => Transport (level2) + * H2020-EU.3.4.5. => CLEANSKY2 (level3) + * H2020-EU.3.4.5.3. => IADP Fast Rotorcraft (level4) + * + * We decided to explicitly represent up to three levels in the classification. + * + * H2020Classification has the following parameters: + * - private Programme programme to store the information about the programme related to this classification + * - private String level1 to store the information about the level 1 of the classification (Priority or Pillar of the EC) + * - private String level2 to store the information about the level2 af the classification (Objectives (?)) + * - private String level3 to store the information about the level3 of the classification + * - private String classification to store the entire classification related to the programme + */ +public class H2020Classification implements Serializable { + private Programme programme; + + private String level1; + private String level2; + private String level3; + + private String classification; + + public Programme getProgramme() { + return programme; + } + + public void setProgramme(Programme programme) { + this.programme = programme; + } + + public String getLevel1() { + return level1; + } + + public void setLevel1(String level1) { + this.level1 = level1; + } + + public String getLevel2() { + return level2; + } + + public void setLevel2(String level2) { + this.level2 = level2; + } + + public String getLevel3() { + return level3; + } + + public void setLevel3(String level3) { + this.level3 = level3; + } + + public String getClassification() { + return classification; + } + + public void setClassification(String classification) { + this.classification = classification; + } + + public static H2020Classification newInstance(String programme_code, String programme_description, String level1, + String level2, String level3, String classification) { + H2020Classification h2020classification = new H2020Classification(); + h2020classification.programme = Programme.newInstance(programme_code, programme_description); + h2020classification.level1 = level1; + h2020classification.level2 = level2; + h2020classification.level3 = level3; + h2020classification.classification = classification; + return h2020classification; + } +} diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java index 25f106da5..054e4d2df 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java @@ -4,8 +4,6 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; import java.io.Serializable; import java.util.List; -import eu.dnetlib.dhp.schema.dump.oaf.KeyValue; - /** * This is the class representing the Project in the model used for the dumps of the whole graph. At the moment the dump * of the Projects differs from the other dumps because we do not create relations between Funders (Organization) and @@ -33,7 +31,7 @@ import eu.dnetlib.dhp.schema.dump.oaf.KeyValue; * - private List funding to store the list of funder of the project * - private String summary to store the summary of the project * - private Granted granted to store the granted amount - * - private List programme to store the list of programmes the project is related to + * - private List h2020classification to store the list of H2020 classifications the project is related to */ public class Project implements Serializable { @@ -62,7 +60,7 @@ public class Project implements Serializable { private Granted granted; - private List programme; + private List h2020Classifications; public String getId() { return id; @@ -184,12 +182,11 @@ public class Project implements Serializable { this.granted = granted; } - public List getProgramme() { - return programme; + public List getH2020Classifications() { + return h2020Classifications; } - public void setProgramme(List programme) { - this.programme = programme; + public void setH2020Classifications(List h2020Classifications) { + this.h2020Classifications = h2020Classifications; } - } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/H2020Classification.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/H2020Classification.java new file mode 100644 index 000000000..219bdc00d --- /dev/null +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/H2020Classification.java @@ -0,0 +1,88 @@ + +package eu.dnetlib.dhp.schema.oaf; + +import java.io.Serializable; +import java.util.Objects; + +/** + * To store information about the classification for the project. The classification depends on the programme. For example + * H2020-EU.3.4.5.3 can be classified as + * H2020-EU.3. => Societal Challenges (level1) + * H2020-EU.3.4. => Transport (level2) + * H2020-EU.3.4.5. => CLEANSKY2 (level3) + * H2020-EU.3.4.5.3. => IADP Fast Rotorcraft (level4) + * + * We decided to explicitly represent up to three levels in the classification. + * + * H2020Classification has the following parameters: + * - private Programme programme to store the information about the programme related to this classification + * - private String level1 to store the information about the level 1 of the classification (Priority or Pillar of the EC) + * - private String level2 to store the information about the level2 af the classification (Objectives (?)) + * - private String level3 to store the information about the level3 of the classification + * - private String classification to store the entire classification related to the programme + */ + +public class H2020Classification implements Serializable { + private H2020Programme h2020Programme; + private String level1; + private String level2; + private String level3; + + private String classification; + + public H2020Programme getH2020Programme() { + return h2020Programme; + } + + public void setH2020Programme(H2020Programme h2020Programme) { + this.h2020Programme = h2020Programme; + } + + public String getLevel1() { + return level1; + } + + public void setLevel1(String level1) { + this.level1 = level1; + } + + public String getLevel2() { + return level2; + } + + public void setLevel2(String level2) { + this.level2 = level2; + } + + public String getLevel3() { + return level3; + } + + public void setLevel3(String level3) { + this.level3 = level3; + } + + public String getClassification() { + return classification; + } + + public void setClassification(String classification) { + this.classification = classification; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + H2020Classification h2020classification = (H2020Classification) o; + + return Objects.equals(level1, h2020classification.level1) && + Objects.equals(level2, h2020classification.level2) && + Objects.equals(level3, h2020classification.level3) && + Objects.equals(classification, h2020classification.classification) && + h2020Programme.equals(h2020classification.h2020Programme); + } +} diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Programme.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/H2020Programme.java similarity index 57% rename from dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Programme.java rename to dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/H2020Programme.java index 00dc32fbc..aacb228db 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Programme.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/H2020Programme.java @@ -4,7 +4,14 @@ package eu.dnetlib.dhp.schema.oaf; import java.io.Serializable; import java.util.Objects; -public class Programme implements Serializable { +/** + * To store information about the ec programme for the project. It has the following parameters: + * - private String code to store the code of the programme + * - private String description to store the description of the programme + */ + + +public class H2020Programme implements Serializable { private String code; private String description; @@ -31,8 +38,8 @@ public class Programme implements Serializable { if (o == null || getClass() != o.getClass()) return false; - Programme programme = (Programme) o; - return Objects.equals(code, programme.code); + H2020Programme h2020Programme = (H2020Programme) o; + return Objects.equals(code, h2020Programme.code); } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Project.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Project.java index 1fcfb305e..b698c957d 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Project.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Project.java @@ -58,7 +58,35 @@ public class Project extends OafEntity implements Serializable { private Float fundedamount; - private List programme; + private String h2020topiccode; + + private String h2020topicdescription; + + private List h2020classification; + + public String getH2020topicdescription() { + return h2020topicdescription; + } + + public void setH2020topicdescription(String h2020topicdescription) { + this.h2020topicdescription = h2020topicdescription; + } + + public String getH2020topiccode() { + return h2020topiccode; + } + + public void setH2020topiccode(String h2020topiccode) { + this.h2020topiccode = h2020topiccode; + } + + public List getH2020classification() { + return h2020classification; + } + + public void setH2020classification(List h2020classification) { + this.h2020classification = h2020classification; + } public Field getWebsiteurl() { return websiteurl; @@ -268,14 +296,6 @@ public class Project extends OafEntity implements Serializable { this.fundedamount = fundedamount; } - public List getProgramme() { - return programme; - } - - public void setProgramme(List programme) { - this.programme = programme; - } - @Override public void mergeFrom(OafEntity e) { super.mergeFrom(e); @@ -331,7 +351,9 @@ public class Project extends OafEntity implements Serializable { ? p.getFundedamount() : fundedamount; - programme = mergeLists(programme, p.getProgramme()); + // programme = mergeLists(programme, p.getProgramme()); + + h2020classification = mergeLists(h2020classification, p.getH2020classification()); mergeOAFDataInfo(e); } diff --git a/dhp-workflows/dhp-aggregation/pom.xml b/dhp-workflows/dhp-aggregation/pom.xml index a1bc1c483..cf0fa0efe 100644 --- a/dhp-workflows/dhp-aggregation/pom.xml +++ b/dhp-workflows/dhp-aggregation/pom.xml @@ -66,6 +66,19 @@ + + + org.apache.poi + poi-ooxml + + + + + org.apache.commons + commons-compress + + + diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgramme.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgramme.java index c6dab13a0..2cf023fb9 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgramme.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgramme.java @@ -4,11 +4,13 @@ package eu.dnetlib.dhp.actionmanager.project; import static eu.dnetlib.dhp.common.SparkSessionSupport.runWithSparkSession; import java.util.HashMap; +import java.util.Map; import java.util.Optional; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.spark.SparkConf; +import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.function.MapFunction; import org.apache.spark.sql.*; import org.slf4j.Logger; @@ -16,11 +18,79 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; -import eu.dnetlib.dhp.actionmanager.project.csvutils.CSVProgramme; +import eu.dnetlib.dhp.actionmanager.project.utils.CSVProgramme; import eu.dnetlib.dhp.application.ArgumentApplicationParser; import eu.dnetlib.dhp.common.HdfsSupport; import scala.Tuple2; +/** + * Among all the programmes provided in the csv file, selects those in H2020 framework that have an english title. + * + * The title is then handled to get the programme description at a certain level. The set of programme titles will then + * be used to associate a classification for the programme. + * + * The programme code describes an hierarchy that can be exploited to provide the classification. To determine the hierarchy + * the code can be split by '.'. If the length of the splitted code is less than or equal to 2 it can be directly used + * as the classification: H2020-EU -> Horizon 2020 Framework Programme (It will never be repeated), + * H2020-EU.1. -> Excellent science, H2020-EU.2. -> Industrial leadership etc. + * + * The codes are ordered and for all of them the concatenation of all the titles (from the element in position 1 of + * the splitted code) handled as below is used to create the classification. For example: + * + * H2020-EU.1.1 -> Excellent science | European Research Council (ERC) + * from H2020-EU.1. -> Excellence science and H2020-EU.1.1. -> European Research Council (ERC) + * + * H2020-EU.3.1.3.1. -> Societal challenges | Health, demographic change and well-being | Treating and managing disease | Treating disease, including developing regenerative medicine + * from H2020-EU.3. -> Societal challenges, + * H2020-EU.3.1. -> Health, demographic change and well-being + * H2020-EU.3.1.3 -> Treating and managing disease + * H2020-EU.3.1.3.1. -> Treating disease, including developing regenerative medicine + * + * The classification up to level three, will be split in dedicated variables, while the complete classification will be stored + * in a variable called classification and provided as shown above. + * + * The programme title is not give in a standardized way: + * + * - Sometimes associated to the higher level in the hierarchy we can find Priority in title other times it is not the + * case. Since it is not uniform, we removed priority from the handled titles: + * + * H2020-EU.1. -> PRIORITY 'Excellent science' + * H2020-EU.2. -> PRIORITY 'Industrial leadership' + * H2020-EU.3. -> PRIORITY 'Societal challenges + * + * will become + * + * H2020-EU.1. -> Excellent science + * H2020-EU.2. -> Industrial leadership + * H2020-EU.3. -> Societal challenges + * + * - Sometimes the title of the parent is repeated in the title for the code, but it is not always the case, so, titles + * associated to previous levels in the hierarchy are removed from the code title. + * + * H2020-EU.1.2. -> EXCELLENT SCIENCE - Future and Emerging Technologies (FET) + * H2020-EU.2.2. -> INDUSTRIAL LEADERSHIP - Access to risk finance + * H2020-EU.3.4. -> SOCIETAL CHALLENGES - Smart, Green And Integrated Transport + * + * will become + * + * H2020-EU.1.2. -> Future and Emerging Technologies (FET) + * H2020-EU.2.2. -> Access to risk finance + * H2020-EU.3.4. -> Smart, Green And Integrated Transport + * + * This holds at all levels in the hierarchy. Hence + * + * H2020-EU.2.1.2. -> INDUSTRIAL LEADERSHIP - Leadership in enabling and industrial technologies – Nanotechnologies + * + * will become + * + * H2020-EU.2.1.2. -> Nanotechnologies + * + * - Euratom is not given in the way the other programmes are: H2020-EU. but H2020-Euratom- . So we need to write + * specific code for it + * + * + * + */ public class PrepareProgramme { private static final Logger log = LoggerFactory.getLogger(PrepareProgramme.class); @@ -69,47 +139,127 @@ public class PrepareProgramme { private static void exec(SparkSession spark, String programmePath, String outputPath) { Dataset programme = readPath(spark, programmePath, CSVProgramme.class); - programme + JavaRDD h2020Programmes = programme .toJavaRDD() - .filter(p -> !p.getCode().contains("FP7")) + .filter(p -> p.getFrameworkProgramme().trim().equalsIgnoreCase("H2020")) .mapToPair(csvProgramme -> new Tuple2<>(csvProgramme.getCode(), csvProgramme)) .reduceByKey((a, b) -> { - if (StringUtils.isEmpty(a.getShortTitle())) { - if (StringUtils.isEmpty(b.getShortTitle())) { - if (StringUtils.isEmpty(a.getTitle())) { - if (StringUtils.isNotEmpty(b.getTitle())) { - a.setShortTitle(b.getTitle()); - a.setLanguage(b.getLanguage()); - } - } else {// notIsEmpty a.getTitle - if (StringUtils.isEmpty(b.getTitle())) { - a.setShortTitle(a.getTitle()); - } else { - if (b.getLanguage().equalsIgnoreCase("en")) { - a.setShortTitle(b.getTitle()); - a.setLanguage(b.getLanguage()); - } else { - a.setShortTitle(a.getTitle()); - } - } - } - } else {// not isEmpty b.getShortTitle - a.setShortTitle(b.getShortTitle()); - // a.setLanguage(b.getLanguage()); + if (!a.getLanguage().equals("en")) { + if (b.getLanguage().equalsIgnoreCase("en")) { + a.setTitle(b.getTitle()); + a.setLanguage(b.getLanguage()); } } + if (StringUtils.isEmpty(a.getShortTitle())) { + if (!StringUtils.isEmpty(b.getShortTitle())) { + a.setShortTitle(b.getShortTitle()); + } + } + return a; }) .map(p -> { CSVProgramme csvProgramme = p._2(); - if (StringUtils.isEmpty(csvProgramme.getShortTitle())) { - csvProgramme.setShortTitle(csvProgramme.getTitle()); + String programmeTitle = csvProgramme.getTitle().trim(); + if (programmeTitle.length() > 8 && programmeTitle.substring(0, 8).equalsIgnoreCase("PRIORITY")) { + programmeTitle = programmeTitle.substring(9); + if (programmeTitle.charAt(0) == '\'') { + programmeTitle = programmeTitle.substring(1); + } + if (programmeTitle.charAt(programmeTitle.length() - 1) == '\'') { + programmeTitle = programmeTitle.substring(0, programmeTitle.length() - 1); + } + csvProgramme.setTitle(programmeTitle); } - return OBJECT_MAPPER.writeValueAsString(csvProgramme); - }) - .saveAsTextFile(outputPath); + return csvProgramme; + }); + prepareClassification(h2020Programmes); + + h2020Programmes.map(csvProgramme -> OBJECT_MAPPER.writeValueAsString(csvProgramme)) + .saveAsTextFile(outputPath); + + + + } + + + private static void prepareClassification(JavaRDD h2020Programmes) { + Object[] codedescription = h2020Programmes + .map(value -> new Tuple2<>(value.getCode(), value.getTitle())) + .collect() + .toArray(); + + for (int i = 0; i < codedescription.length - 1; i++) { + for (int j = i + 1; j < codedescription.length; j++) { + Tuple2 t2i = (Tuple2) codedescription[i]; + Tuple2 t2j = (Tuple2) codedescription[j]; + if (t2i._1().compareTo(t2j._1()) > 0) { + Tuple2 temp = t2i; + codedescription[i] = t2j; + codedescription[j] = temp; + } + } + } + + Map map = new HashMap<>(); + for (int j = 0; j < codedescription.length; j++) { + Tuple2 entry = (Tuple2) codedescription[j]; + String ent = entry._1(); + if (ent.contains("Euratom-")) { + ent = ent.replace("-Euratom-", ".Euratom."); + } + String[] tmp = ent.split("\\."); + if (tmp.length <= 2) { + map.put(entry._1(), entry._2()); + + } else { + if (ent.endsWith(".")) { + ent = ent.substring(0, ent.length() - 1); + } + String key = ent.substring(0, ent.lastIndexOf(".") + 1); + if (key.contains("Euratom")) { + key = key.replace(".Euratom.", "-Euratom-"); + ent = ent.replace(".Euratom.", "-Euratom-"); + if (key.endsWith("-")) { + key = key.substring(0, key.length() - 1); + } + } + String current = entry._2(); + if (!ent.contains("Euratom")) { + + String parent; + String tmp_key = tmp[0] + "."; + for (int i = 1; i < tmp.length - 1; i++) { + tmp_key += tmp[i] + "."; + parent = map.get(tmp_key).toLowerCase().trim(); + if (parent.contains("|")) { + parent = parent.substring(parent.lastIndexOf("|") + 1).trim(); + } + if (current.trim().length() > parent.length() + && current.toLowerCase().trim().substring(0, parent.length()).equals(parent)) { + current = current.substring(parent.length() + 1); + if (current.trim().charAt(0) == '-' || current.trim().charAt(0) == '–') { + current = current.trim().substring(1).trim(); + } + + } + } + + } + map.put(ent + ".", map.get(key) + " | " + current); + + } + + } + h2020Programmes.foreach(csvProgramme -> { + if (!csvProgramme.getCode().endsWith(".") && !csvProgramme.getCode().contains("Euratom") + && !csvProgramme.getCode().equals("H2020-EC")) + csvProgramme.setClassification(map.get(csvProgramme.getCode() + ".")); + else + csvProgramme.setClassification(map.get(csvProgramme.getCode())); + }); } public static Dataset readPath( diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjects.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjects.java index 78aed1a69..e5cae0ff7 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjects.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjects.java @@ -6,9 +6,7 @@ import static eu.dnetlib.dhp.common.SparkSessionSupport.runWithSparkSession; import java.util.*; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; import org.apache.spark.SparkConf; -import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.function.FlatMapFunction; import org.apache.spark.api.java.function.MapFunction; import org.apache.spark.sql.Dataset; @@ -20,12 +18,16 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; -import eu.dnetlib.dhp.actionmanager.project.csvutils.CSVProgramme; -import eu.dnetlib.dhp.actionmanager.project.csvutils.CSVProject; +import eu.dnetlib.dhp.actionmanager.project.utils.CSVProgramme; +import eu.dnetlib.dhp.actionmanager.project.utils.CSVProject; import eu.dnetlib.dhp.application.ArgumentApplicationParser; import eu.dnetlib.dhp.common.HdfsSupport; import scala.Tuple2; +/** + * Selects only the relevant information collected with the projects: project grant agreement, project programme code and + * project topic code for the projects that are also collected from OpenAIRE. + */ public class PrepareProjects { private static final Logger log = LoggerFactory.getLogger(PrepareProgramme.class); @@ -97,10 +99,14 @@ public class PrepareProjects { if (csvProject.isPresent()) { String[] programme = csvProject.get().getProgramme().split(";"); + String topic = csvProject.get().getTopics(); + Arrays .stream(programme) .forEach(p -> { CSVProject proj = new CSVProject(); + proj.setTopics(topic); + proj.setProgramme(p); proj.setId(csvProject.get().getId()); csvProjectList.add(proj); diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/ProjectSubset.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/ProjectSubset.java index 2fccbc516..c51c10876 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/ProjectSubset.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/ProjectSubset.java @@ -3,10 +3,14 @@ package eu.dnetlib.dhp.actionmanager.project; import java.io.Serializable; +/** + * Class to store the grande agreement (code) of the collected projects + */ public class ProjectSubset implements Serializable { private String code; + public String getCode() { return code; } @@ -14,4 +18,5 @@ public class ProjectSubset implements Serializable { public void setCode(String code) { this.code = code; } + } diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/ReadProjectsFromDB.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/ReadProjectsFromDB.java index 2d541d2f9..2bba9fb60 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/ReadProjectsFromDB.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/ReadProjectsFromDB.java @@ -25,6 +25,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import eu.dnetlib.dhp.application.ArgumentApplicationParser; import eu.dnetlib.dhp.common.DbClient; +/** + * queries the OpenAIRE database to get the grant agreement of projects collected from corda__h2020. The code collected + * are written on hdfs using the ProjectSubset model + */ public class ReadProjectsFromDB implements Closeable { private final DbClient dbClient; @@ -33,7 +37,7 @@ public class ReadProjectsFromDB implements Closeable { private final BufferedWriter writer; private final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - private final static String query = "SELECT code " + + private final static String query = "SELECT code " + "from projects where id like 'corda__h2020%' "; public static void main(final String[] args) throws Exception { @@ -72,7 +76,6 @@ public class ReadProjectsFromDB implements Closeable { try { ProjectSubset p = new ProjectSubset(); p.setCode(rs.getString("code")); - return Arrays.asList(p); } catch (final Exception e) { diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/SparkAtomicActionJob.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/SparkAtomicActionJob.java index 1023e2d19..f2375e799 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/SparkAtomicActionJob.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/SparkAtomicActionJob.java @@ -3,47 +3,54 @@ package eu.dnetlib.dhp.actionmanager.project; import static eu.dnetlib.dhp.common.SparkSessionSupport.runWithSparkSession; -import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.Objects; import java.util.Optional; -import java.util.function.Consumer; import org.apache.commons.io.IOUtils; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.SequenceFile; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.SequenceFileOutputFormat; -import org.apache.hadoop.mapred.TextOutputFormat; import org.apache.spark.SparkConf; import org.apache.spark.api.java.function.MapFunction; import org.apache.spark.api.java.function.MapGroupsFunction; -import org.apache.spark.rdd.SequenceFileRDDFunctions; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Encoders; -import org.apache.spark.sql.SaveMode; import org.apache.spark.sql.SparkSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; -import eu.dnetlib.dhp.actionmanager.project.csvutils.CSVProgramme; -import eu.dnetlib.dhp.actionmanager.project.csvutils.CSVProject; +import eu.dnetlib.dhp.actionmanager.project.utils.CSVProgramme; +import eu.dnetlib.dhp.actionmanager.project.utils.CSVProject; +import eu.dnetlib.dhp.actionmanager.project.utils.EXCELTopic; import eu.dnetlib.dhp.application.ArgumentApplicationParser; import eu.dnetlib.dhp.common.HdfsSupport; import eu.dnetlib.dhp.schema.action.AtomicAction; import eu.dnetlib.dhp.schema.common.ModelSupport; -import eu.dnetlib.dhp.schema.oaf.Programme; +import eu.dnetlib.dhp.schema.oaf.H2020Classification; +import eu.dnetlib.dhp.schema.oaf.H2020Programme; import eu.dnetlib.dhp.schema.oaf.Project; import eu.dnetlib.dhp.utils.DHPUtils; -import scala.Function1; import scala.Tuple2; -import scala.runtime.BoxedUnit; +/** + * Class that makes the ActionSet. To prepare the AS two joins are needed + * + * 1. join betweem the collected project subset and the programme extenden with the classification on the grant agreement. + * For each entry a + * eu.dnetlib.dhp.Project entity is created and the information about H2020Classification is set together with the + * h2020topiccode variable + * 2. join between the output of the previous step and the topic information on the topic code. Each time a match is + * found the h2020topicdescription variable is set. + * + * To produce one single entry for each project code a step of groupoing is needed: each project can be associated to more + * than one programme. + * + * + */ public class SparkAtomicActionJob { private static final Logger log = LoggerFactory.getLogger(SparkAtomicActionJob.class); private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); @@ -77,6 +84,9 @@ public class SparkAtomicActionJob { final String programmePath = parser.get("programmePath"); log.info("programmePath {}: ", programmePath); + final String topicPath = parser.get("topicPath"); + log.info("topic path {}: ", topicPath); + SparkConf conf = new SparkConf(); runWithSparkSession( @@ -88,6 +98,7 @@ public class SparkAtomicActionJob { spark, projectPath, programmePath, + topicPath, outputPath); }); } @@ -98,31 +109,53 @@ public class SparkAtomicActionJob { private static void getAtomicActions(SparkSession spark, String projectPatH, String programmePath, + String topicPath, String outputPath) { Dataset project = readPath(spark, projectPatH, CSVProject.class); Dataset programme = readPath(spark, programmePath, CSVProgramme.class); + Dataset topic = readPath(spark, topicPath, EXCELTopic.class); - project + Dataset aaproject = project .joinWith(programme, project.col("programme").equalTo(programme.col("code")), "left") - .map(c -> { - CSVProject csvProject = c._1(); - Optional csvProgramme = Optional.ofNullable(c._2()); - if (csvProgramme.isPresent()) { - Project p = new Project(); - p - .setId( - createOpenaireId( - ModelSupport.entityIdPrefix.get("project"), - "corda__h2020", csvProject.getId())); - Programme pm = new Programme(); - pm.setCode(csvProject.getProgramme()); - pm.setDescription(csvProgramme.get().getShortTitle()); - p.setProgramme(Arrays.asList(pm)); - return p; - } + .map((MapFunction, Project>) c -> { - return null; + CSVProject csvProject = c._1(); + Optional ocsvProgramme = Optional.ofNullable(c._2()); + + return Optional + .ofNullable(c._2()) + .map(csvProgramme -> { + Project pp = new Project(); + pp + .setId( + createOpenaireId( + ModelSupport.entityIdPrefix.get("project"), + "corda__h2020", csvProject.getId())); + pp.setH2020topiccode(csvProject.getTopics()); + H2020Programme pm = new H2020Programme(); + H2020Classification h2020classification = new H2020Classification(); + pm.setCode(csvProject.getProgramme()); + h2020classification.setClassification(ocsvProgramme.get().getClassification()); + h2020classification.setH2020Programme(pm); + setLevelsAndProgramme(h2020classification, ocsvProgramme.get().getClassification()); + pp.setH2020classification(Arrays.asList(h2020classification)); + + return pp; + }) + .orElse(null); + + }, Encoders.bean(Project.class)); + + aaproject + .joinWith(topic, aaproject.col("h2020topiccode").equalTo(topic.col("code"))) + .map((MapFunction, Project>) p -> { + Optional op = Optional.ofNullable(p._2()); + Project rp = p._1(); + if (op.isPresent()) { + rp.setH2020topicdescription(op.get().getTitle()); + } + return rp; }, Encoders.bean(Project.class)) .filter(Objects::nonNull) .groupByKey( @@ -144,6 +177,18 @@ public class SparkAtomicActionJob { } + private static void setLevelsAndProgramme(H2020Classification h2020Classification, String classification) { + String[] tmp = classification.split(" \\| "); + h2020Classification.setLevel1(tmp[0]); + if (tmp.length > 1) { + h2020Classification.setLevel2(tmp[1]); + } + if (tmp.length > 2) { + h2020Classification.setLevel3(tmp[2]); + } + h2020Classification.getH2020Programme().setDescription(tmp[tmp.length - 1]); + } + public static Dataset readPath( SparkSession spark, String inputPath, Class clazz) { return spark diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/CSVProgramme.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/CSVProgramme.java deleted file mode 100644 index a9069e510..000000000 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/CSVProgramme.java +++ /dev/null @@ -1,52 +0,0 @@ - -package eu.dnetlib.dhp.actionmanager.project.csvutils; - -import java.io.Serializable; - -public class CSVProgramme implements Serializable { - private String rcn; - private String code; - private String title; - private String shortTitle; - private String language; - - public String getRcn() { - return rcn; - } - - public void setRcn(String rcn) { - this.rcn = rcn; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getShortTitle() { - return shortTitle; - } - - public void setShortTitle(String shortTitle) { - this.shortTitle = shortTitle; - } - - public String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language; - } -} diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/CSVParser.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/CSVParser.java similarity index 88% rename from dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/CSVParser.java rename to dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/CSVParser.java index ef29a6b6a..8bdce903b 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/CSVParser.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/CSVParser.java @@ -1,5 +1,5 @@ -package eu.dnetlib.dhp.actionmanager.project.csvutils; +package eu.dnetlib.dhp.actionmanager.project.utils; import java.io.IOException; import java.util.ArrayList; @@ -10,6 +10,9 @@ import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVRecord; import org.apache.commons.lang.reflect.FieldUtils; +/** + * Reads a generic csv and maps it into classes that mirror its schema + */ public class CSVParser { public List parse(String csvFile, String classForName) diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/CSVProgramme.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/CSVProgramme.java new file mode 100644 index 000000000..6f9a59087 --- /dev/null +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/CSVProgramme.java @@ -0,0 +1,137 @@ + +package eu.dnetlib.dhp.actionmanager.project.utils; + +import java.io.Serializable; + +/** + * The model for the programme csv file + */ +public class CSVProgramme implements Serializable { + private String parentProgramme; + private String frameworkProgramme; + private String startDate; + private String endDate; + private String objective; + private String subjects; + private String legalBasis; + private String call; + private String rcn; + private String code; + + private String title; + private String shortTitle; + private String language; + private String classification; + + public String getClassification() { + return classification; + } + + public void setClassification(String classification) { + this.classification = classification; + } + + public String getRcn() { + return rcn; + } + + public void setRcn(String rcn) { + this.rcn = rcn; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getShortTitle() { + return shortTitle; + } + + public void setShortTitle(String shortTitle) { + this.shortTitle = shortTitle; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public String getParentProgramme() { + return parentProgramme; + } + + public void setParentProgramme(String parentProgramme) { + this.parentProgramme = parentProgramme; + } + + public String getFrameworkProgramme() { + return frameworkProgramme; + } + + public void setFrameworkProgramme(String frameworkProgramme) { + this.frameworkProgramme = frameworkProgramme; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getObjective() { + return objective; + } + + public void setObjective(String objective) { + this.objective = objective; + } + + public String getSubjects() { + return subjects; + } + + public void setSubjects(String subjects) { + this.subjects = subjects; + } + + public String getLegalBasis() { + return legalBasis; + } + + public void setLegalBasis(String legalBasis) { + this.legalBasis = legalBasis; + } + + public String getCall() { + return call; + } + + public void setCall(String call) { + this.call = call; + } +} diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/CSVProject.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/CSVProject.java similarity index 97% rename from dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/CSVProject.java rename to dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/CSVProject.java index ff18c6260..268d5f28c 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/CSVProject.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/CSVProject.java @@ -1,8 +1,11 @@ -package eu.dnetlib.dhp.actionmanager.project.csvutils; +package eu.dnetlib.dhp.actionmanager.project.utils; import java.io.Serializable; +/** + * the mmodel for the projects csv file + */ public class CSVProject implements Serializable { private String rcn; private String id; diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/EXCELParser.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/EXCELParser.java new file mode 100644 index 000000000..0f83499e4 --- /dev/null +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/EXCELParser.java @@ -0,0 +1,75 @@ + +package eu.dnetlib.dhp.actionmanager.project.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.reflect.FieldUtils; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.openxml4j.opc.OPCPackage; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.DataFormatter; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +/** + * Reads a generic excel file and maps it into classes that mirror its schema + */ +public class EXCELParser { + + public List parse(InputStream file, String classForName) + throws ClassNotFoundException, IOException, IllegalAccessException, InstantiationException, + InvalidFormatException { + + // OPCPackage pkg = OPCPackage.open(httpConnector.getInputSourceAsStream(URL)); + OPCPackage pkg = OPCPackage.open(file); + XSSFWorkbook wb = new XSSFWorkbook(pkg); + + XSSFSheet sheet = wb.getSheet("cordisref-H2020topics"); + + List ret = new ArrayList<>(); + + DataFormatter dataFormatter = new DataFormatter(); + Iterator rowIterator = sheet.rowIterator(); + List headers = new ArrayList<>(); + int count = 0; + while (rowIterator.hasNext()) { + Row row = rowIterator.next(); + + if (count == 0) { + Iterator cellIterator = row.cellIterator(); + + while (cellIterator.hasNext()) { + Cell cell = cellIterator.next(); + headers.add(dataFormatter.formatCellValue(cell)); + } + } else { + Class clazz = Class.forName("eu.dnetlib.dhp.actionmanager.project.utils.EXCELTopic"); + final Object cc = clazz.newInstance(); + + for (int i = 0; i < headers.size(); i++) { + Cell cell = row.getCell(i); + String value = dataFormatter.formatCellValue(cell); + FieldUtils.writeField(cc, headers.get(i), dataFormatter.formatCellValue(cell), true); + + } + + EXCELTopic et = (EXCELTopic) cc; + if (StringUtils.isNotBlank(et.getRcn())) { + ret.add((R) cc); + } + + } + + count += 1; + } + + return ret; + } + +} diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/EXCELTopic.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/EXCELTopic.java new file mode 100644 index 000000000..5607df118 --- /dev/null +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/EXCELTopic.java @@ -0,0 +1,127 @@ + +package eu.dnetlib.dhp.actionmanager.project.utils; + +import java.io.Serializable; + +/** + * the model class for the topic excel file + */ +public class EXCELTopic implements Serializable { + private String rcn; + private String language; + private String code; + private String parentProgramme; + private String frameworkProgramme; + private String startDate; + private String endDate; + private String title; + private String shortTitle; + private String objective; + private String subjects; + private String legalBasis; + private String call; + + public String getRcn() { + return rcn; + } + + public void setRcn(String rcn) { + this.rcn = rcn; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getParentProgramme() { + return parentProgramme; + } + + public void setParentProgramme(String parentProgramme) { + this.parentProgramme = parentProgramme; + } + + public String getFrameworkProgramme() { + return frameworkProgramme; + } + + public void setFrameworkProgramme(String frameworkProgramme) { + this.frameworkProgramme = frameworkProgramme; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getShortTitle() { + return shortTitle; + } + + public void setShortTitle(String shortTitle) { + this.shortTitle = shortTitle; + } + + public String getObjective() { + return objective; + } + + public void setObjective(String objective) { + this.objective = objective; + } + + public String getSubjects() { + return subjects; + } + + public void setSubjects(String subjects) { + this.subjects = subjects; + } + + public String getLegalBasis() { + return legalBasis; + } + + public void setLegalBasis(String legalBasis) { + this.legalBasis = legalBasis; + } + + public String getCall() { + return call; + } + + public void setCall(String call) { + this.call = call; + } +} diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/ReadCSV.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/ReadCSV.java similarity index 95% rename from dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/ReadCSV.java rename to dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/ReadCSV.java index 2b72b229a..9dac34a15 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/csvutils/ReadCSV.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/ReadCSV.java @@ -1,5 +1,5 @@ -package eu.dnetlib.dhp.actionmanager.project.csvutils; +package eu.dnetlib.dhp.actionmanager.project.utils; import java.io.BufferedWriter; import java.io.Closeable; @@ -20,6 +20,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import eu.dnetlib.dhp.actionmanager.project.httpconnector.HttpConnector; import eu.dnetlib.dhp.application.ArgumentApplicationParser; +/** + * Applies the parsing of a csv file and writes the Serialization of it in hdfs + */ public class ReadCSV implements Closeable { private static final Log log = LogFactory.getLog(ReadCSV.class); private final Configuration conf; diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/ReadExcel.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/ReadExcel.java new file mode 100644 index 000000000..23b58f2a0 --- /dev/null +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/utils/ReadExcel.java @@ -0,0 +1,98 @@ + +package eu.dnetlib.dhp.actionmanager.project.utils; + +import java.io.*; +import java.nio.charset.StandardCharsets; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FSDataOutputStream; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import eu.dnetlib.dhp.actionmanager.project.httpconnector.HttpConnector; +import eu.dnetlib.dhp.application.ArgumentApplicationParser; + +/** + * Applies the parsing of an excel file and writes the Serialization of it in hdfs + */ + +public class ReadExcel implements Closeable { + private static final Log log = LogFactory.getLog(ReadCSV.class); + private final Configuration conf; + private final BufferedWriter writer; + private final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + private InputStream excelFile; + + public static void main(final String[] args) throws Exception { + final ArgumentApplicationParser parser = new ArgumentApplicationParser( + IOUtils + .toString( + ReadCSV.class + .getResourceAsStream( + "/eu/dnetlib/dhp/actionmanager/project/parameters.json"))); + + parser.parseArgument(args); + + final String fileURL = parser.get("fileURL"); + final String hdfsPath = parser.get("hdfsPath"); + final String hdfsNameNode = parser.get("hdfsNameNode"); + final String classForName = parser.get("classForName"); + + try (final ReadExcel readExcel = new ReadExcel(hdfsPath, hdfsNameNode, fileURL)) { + + log.info("Getting Excel file..."); + readExcel.execute(classForName); + + } + } + + public void execute(final String classForName) throws Exception { + EXCELParser excelParser = new EXCELParser(); + excelParser + .parse(excelFile, classForName) + .stream() + .forEach(p -> write(p)); + + } + + @Override + public void close() throws IOException { + writer.close(); + } + + public ReadExcel( + final String hdfsPath, + final String hdfsNameNode, + final String fileURL) + throws Exception { + this.conf = new Configuration(); + this.conf.set("fs.defaultFS", hdfsNameNode); + HttpConnector httpConnector = new HttpConnector(); + FileSystem fileSystem = FileSystem.get(this.conf); + Path hdfsWritePath = new Path(hdfsPath); + FSDataOutputStream fsDataOutputStream = null; + if (fileSystem.exists(hdfsWritePath)) { + fileSystem.delete(hdfsWritePath, false); + } + fsDataOutputStream = fileSystem.create(hdfsWritePath); + + this.writer = new BufferedWriter(new OutputStreamWriter(fsDataOutputStream, StandardCharsets.UTF_8)); + this.excelFile = httpConnector.getInputSourceAsStream(fileURL); + ; + } + + protected void write(final Object p) { + try { + writer.write(OBJECT_MAPPER.writeValueAsString(p)); + writer.newLine(); + } catch (final Exception e) { + throw new RuntimeException(e); + } + } + +} diff --git a/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/action_set_parameters.json b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/action_set_parameters.json index a0856e10e..180142044 100644 --- a/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/action_set_parameters.json +++ b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/action_set_parameters.json @@ -17,6 +17,12 @@ "paramDescription": "the URL from where to get the programme file", "paramRequired": true }, + { + "paramName": "tp", + "paramLongName": "topicPath", + "paramDescription": "the URL from where to get the topic file", + "paramRequired": true + }, { "paramName": "o", "paramLongName": "outputPath", diff --git a/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/oozie_app/config-default.xml b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/oozie_app/config-default.xml index fe82ae194..a1755f329 100644 --- a/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/oozie_app/config-default.xml +++ b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/oozie_app/config-default.xml @@ -31,6 +31,10 @@ spark2SqlQueryExecutionListeners com.cloudera.spark.lineage.NavigatorQueryListener + + oozie.launcher.mapreduce.user.classpath.first + true + sparkExecutorNumber 4 diff --git a/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/oozie_app/workflow.xml b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/oozie_app/workflow.xml index 1e3445675..c710c8b55 100644 --- a/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/oozie_app/workflow.xml +++ b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/actionmanager/project/oozie_app/workflow.xml @@ -10,6 +10,10 @@ the url where to get the programme file + + topicFileURL + the url where to get the topic file + outputPath path where to store the action set @@ -33,11 +37,11 @@ - eu.dnetlib.dhp.actionmanager.project.csvutils.ReadCSV + eu.dnetlib.dhp.actionmanager.project.utils.ReadCSV --hdfsNameNode${nameNode} --fileURL${projectFileURL} --hdfsPath${workingDir}/projects - --classForNameeu.dnetlib.dhp.actionmanager.project.csvutils.CSVProject + --classForNameeu.dnetlib.dhp.actionmanager.project.utils.CSVProject @@ -45,11 +49,23 @@ - eu.dnetlib.dhp.actionmanager.project.csvutils.ReadCSV + eu.dnetlib.dhp.actionmanager.project.utils.ReadCSV --hdfsNameNode${nameNode} --fileURL${programmeFileURL} --hdfsPath${workingDir}/programme - --classForNameeu.dnetlib.dhp.actionmanager.project.csvutils.CSVProgramme + --classForNameeu.dnetlib.dhp.actionmanager.project.utils.CSVProgramme + + + + + + + + eu.dnetlib.dhp.actionmanager.project.utils.ReadExcel + --hdfsNameNode${nameNode} + --fileURL${topicFileURL} + --hdfsPath${workingDir}/topic + --classForNameeu.dnetlib.dhp.actionmanager.project.utils.EXCELTopic @@ -136,6 +152,7 @@ --projectPath${workingDir}/preparedProjects --programmePath${workingDir}/preparedProgramme + --topicPath${workingDir}/topic --outputPath${outputPath} diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/CSVParserTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/CSVParserTest.java index 17fdd4511..da5beecf9 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/CSVParserTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/CSVParserTest.java @@ -1,27 +1,16 @@ package eu.dnetlib.dhp.actionmanager.project; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; import java.util.List; import org.apache.commons.io.IOUtils; -import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import eu.dnetlib.dhp.actionmanager.project.csvutils.CSVParser; +import eu.dnetlib.dhp.actionmanager.project.utils.CSVParser; public class CSVParserTest { - private static Path workingDir; - - @BeforeAll - public static void beforeAll() throws IOException { - workingDir = Files.createTempDirectory(CSVParserTest.class.getSimpleName()); - - } - @Test public void readProgrammeTest() throws Exception { @@ -33,9 +22,10 @@ public class CSVParserTest { CSVParser csvParser = new CSVParser(); - List pl = csvParser.parse(programmecsv, "eu.dnetlib.dhp.actionmanager.project.csvutils.CSVProgramme"); + List pl = csvParser.parse(programmecsv, "eu.dnetlib.dhp.actionmanager.project.utils.CSVProgramme"); - System.out.println(pl.size()); + Assertions.assertEquals(24, pl.size()); } + } diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/EXCELParserTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/EXCELParserTest.java new file mode 100644 index 000000000..fdc577687 --- /dev/null +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/EXCELParserTest.java @@ -0,0 +1,42 @@ + +package eu.dnetlib.dhp.actionmanager.project; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import eu.dnetlib.dhp.actionmanager.project.httpconnector.CollectorServiceException; +import eu.dnetlib.dhp.actionmanager.project.httpconnector.HttpConnector; +import eu.dnetlib.dhp.actionmanager.project.utils.EXCELParser; + +public class EXCELParserTest { + + private static Path workingDir; + private HttpConnector httpConnector = new HttpConnector(); + private static final String URL = "http://cordis.europa.eu/data/reference/cordisref-H2020topics.xlsx"; + + @BeforeAll + public static void beforeAll() throws IOException { + workingDir = Files.createTempDirectory(CSVParserTest.class.getSimpleName()); + + } + + @Test + public void test1() throws CollectorServiceException, IOException, InvalidFormatException, ClassNotFoundException, + IllegalAccessException, InstantiationException { + + EXCELParser excelParser = new EXCELParser(); + + List pl = excelParser + .parse(httpConnector.getInputSourceAsStream(URL), "eu.dnetlib.dhp.actionmanager.project.utils.ExcelTopic"); + + Assertions.assertEquals(3837, pl.size()); + + } +} diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgrammeTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareH2020ProgrammeTest.java similarity index 53% rename from dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgrammeTest.java rename to dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareH2020ProgrammeTest.java index 7f890a8a3..c5801bccc 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgrammeTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareH2020ProgrammeTest.java @@ -21,29 +21,29 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; -import eu.dnetlib.dhp.actionmanager.project.csvutils.CSVProgramme; +import eu.dnetlib.dhp.actionmanager.project.utils.CSVProgramme; -public class PrepareProgrammeTest { +public class PrepareH2020ProgrammeTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - private static final ClassLoader cl = eu.dnetlib.dhp.actionmanager.project.PrepareProgrammeTest.class + private static final ClassLoader cl = PrepareH2020ProgrammeTest.class .getClassLoader(); private static SparkSession spark; private static Path workingDir; private static final Logger log = LoggerFactory - .getLogger(eu.dnetlib.dhp.actionmanager.project.PrepareProgrammeTest.class); + .getLogger(PrepareH2020ProgrammeTest.class); @BeforeAll public static void beforeAll() throws IOException { workingDir = Files - .createTempDirectory(eu.dnetlib.dhp.actionmanager.project.PrepareProgrammeTest.class.getSimpleName()); + .createTempDirectory(PrepareH2020ProgrammeTest.class.getSimpleName()); log.info("using work dir {}", workingDir); SparkConf conf = new SparkConf(); - conf.setAppName(eu.dnetlib.dhp.actionmanager.project.PrepareProgrammeTest.class.getSimpleName()); + conf.setAppName(PrepareH2020ProgrammeTest.class.getSimpleName()); conf.setMaster("local[*]"); conf.set("spark.driver.host", "localhost"); @@ -54,7 +54,7 @@ public class PrepareProgrammeTest { spark = SparkSession .builder() - .appName(PrepareProgrammeTest.class.getSimpleName()) + .appName(PrepareH2020ProgrammeTest.class.getSimpleName()) .config(conf) .getOrCreate(); } @@ -88,7 +88,60 @@ public class PrepareProgrammeTest { Dataset verificationDataset = spark.createDataset(tmp.rdd(), Encoders.bean(CSVProgramme.class)); - Assertions.assertEquals(0, verificationDataset.filter("shortTitle =''").count()); + Assertions.assertEquals(0, verificationDataset.filter("title =''").count()); + + Assertions.assertEquals(0, verificationDataset.filter("classification = ''").count()); + + Assertions + .assertEquals( + "Societal challenges | Smart, Green And Integrated Transport | CLEANSKY2 | IADP Fast Rotorcraft", + verificationDataset + .filter("code = 'H2020-EU.3.4.5.3.'") + .select("classification") + .collectAsList() + .get(0) + .getString(0)); + + Assertions + .assertEquals( + "Euratom | Indirect actions | European Fusion Development Agreement", + verificationDataset + .filter("code = 'H2020-Euratom-1.9.'") + .select("classification") + .collectAsList() + .get(0) + .getString(0)); + + Assertions + .assertEquals( + "Industrial leadership | Leadership in enabling and industrial technologies | Advanced manufacturing and processing | New sustainable business models", + verificationDataset + .filter("code = 'H2020-EU.2.1.5.4.'") + .select("classification") + .collectAsList() + .get(0) + .getString(0)); + + Assertions + .assertEquals( + "Excellent science | Future and Emerging Technologies (FET) | FET Open", + verificationDataset + .filter("code = 'H2020-EU.1.2.1.'") + .select("classification") + .collectAsList() + .get(0) + .getString(0)); + + Assertions + .assertEquals( + "Industrial leadership | Leadership in enabling and industrial technologies | Biotechnology", + verificationDataset + .filter("code = 'H2020-EU.2.1.4.'") + .select("classification") + .collectAsList() + .get(0) + .getString(0)); + } } diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjectTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjectTest.java index 5ff88e46f..0db3485f5 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjectTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjectTest.java @@ -21,8 +21,7 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; -import eu.dnetlib.dhp.actionmanager.project.csvutils.CSVProgramme; -import eu.dnetlib.dhp.actionmanager.project.csvutils.CSVProject; +import eu.dnetlib.dhp.actionmanager.project.utils.CSVProject; public class PrepareProjectTest { diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/SparkUpdateProjectTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/SparkUpdateProjectTest.java index 718cd8ebe..cfda7e718 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/SparkUpdateProjectTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/SparkUpdateProjectTest.java @@ -4,12 +4,16 @@ package eu.dnetlib.dhp.actionmanager.project; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.List; import org.apache.commons.io.FileUtils; import org.apache.hadoop.io.Text; import org.apache.spark.SparkConf; import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.JavaSparkContext; +import org.apache.spark.sql.Dataset; +import org.apache.spark.sql.Encoders; +import org.apache.spark.sql.Row; import org.apache.spark.sql.SparkSession; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; @@ -73,10 +77,13 @@ public class SparkUpdateProjectTest { Boolean.FALSE.toString(), "-programmePath", getClass() - .getResource("/eu/dnetlib/dhp/actionmanager/project/preparedProgramme_whole.json.gz") + .getResource( + "/eu/dnetlib/dhp/actionmanager/project/preparedProgramme_classification_whole.json.gz") .getPath(), "-projectPath", getClass().getResource("/eu/dnetlib/dhp/actionmanager/project/prepared_projects.json").getPath(), + "-topicPath", + getClass().getResource("/eu/dnetlib/dhp/actionmanager/project/topic.json.gz").getPath(), "-outputPath", workingDir.toString() + "/actionSet" }); @@ -88,7 +95,231 @@ public class SparkUpdateProjectTest { .map(value -> OBJECT_MAPPER.readValue(value._2().toString(), AtomicAction.class)) .map(aa -> ((Project) aa.getPayload())); - Assertions.assertEquals(14, tmp.count()); + Assertions.assertEquals(15, tmp.count()); + + Dataset verificationDataset = spark.createDataset(tmp.rdd(), Encoders.bean(Project.class)); + verificationDataset.createOrReplaceTempView("project"); + + Dataset execverification = spark + .sql( + "SELECT id, class classification, h2020topiccode, h2020topicdescription FROM project LATERAL VIEW EXPLODE(h2020classification) c as class "); + + Assertions + .assertEquals( + "H2020-EU.3.4.7.", + execverification + .filter("id = '40|corda__h2020::2c7298913008865ba784e5c1350a0aa5'") + .select("classification.h2020Programme.code") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "SESAR JU", + execverification + .filter("id = '40|corda__h2020::2c7298913008865ba784e5c1350a0aa5'") + .select("classification.h2020Programme.description") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Societal challenges", + execverification + .filter("id = '40|corda__h2020::2c7298913008865ba784e5c1350a0aa5'") + .select("classification.level1") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Smart, Green And Integrated Transport", + execverification + .filter("id = '40|corda__h2020::2c7298913008865ba784e5c1350a0aa5'") + .select("classification.level2") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "SESAR JU", + execverification + .filter("id = '40|corda__h2020::2c7298913008865ba784e5c1350a0aa5'") + .select("classification.level3") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Societal challenges | Smart, Green And Integrated Transport | SESAR JU", + execverification + .filter("id = '40|corda__h2020::2c7298913008865ba784e5c1350a0aa5'") + .select("classification.classification") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "SESAR-ER4-31-2019", + execverification + .filter("id = '40|corda__h2020::2c7298913008865ba784e5c1350a0aa5'") + .select("h2020topiccode") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "U-space", + execverification + .filter("id = '40|corda__h2020::2c7298913008865ba784e5c1350a0aa5'") + .select("h2020topicdescription") + .collectAsList() + .get(0) + .getString(0)); + + Assertions + .assertEquals( + "H2020-EU.1.3.2.", + execverification + .filter("id = '40|corda__h2020::1a1f235fdd06ef14790baec159aa1202'") + .select("classification.h2020Programme.code") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Nurturing excellence by means of cross-border and cross-sector mobility", + execverification + .filter("id = '40|corda__h2020::1a1f235fdd06ef14790baec159aa1202'") + .select("classification.h2020Programme.description") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Excellent science", + execverification + .filter("id = '40|corda__h2020::1a1f235fdd06ef14790baec159aa1202'") + .select("classification.level1") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Marie Skłodowska-Curie Actions", + execverification + .filter("id = '40|corda__h2020::1a1f235fdd06ef14790baec159aa1202'") + .select("classification.level2") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Nurturing excellence by means of cross-border and cross-sector mobility", + execverification + .filter("id = '40|corda__h2020::1a1f235fdd06ef14790baec159aa1202'") + .select("classification.level3") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Excellent science | Marie Skłodowska-Curie Actions | Nurturing excellence by means of cross-border and cross-sector mobility", + execverification + .filter("id = '40|corda__h2020::1a1f235fdd06ef14790baec159aa1202'") + .select("classification.classification") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "MSCA-IF-2019", + execverification + .filter("id = '40|corda__h2020::1a1f235fdd06ef14790baec159aa1202'") + .select("h2020topiccode") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Individual Fellowships", + execverification + .filter("id = '40|corda__h2020::1a1f235fdd06ef14790baec159aa1202'") + .select("h2020topicdescription") + .collectAsList() + .get(0) + .getString(0)); + + Assertions + .assertTrue( + execverification + .filter("id = '40|corda__h2020::a657c271769fec90b60c1f2dbc25f4d5'") + .select("classification.h2020Programme.code") + .collectAsList() + .get(0) + .getString(0) + .equals("H2020-EU.2.1.4.") || + execverification + .filter("id = '40|corda__h2020::a657c271769fec90b60c1f2dbc25f4d5'") + .select("classification.h2020Programme.code") + .collectAsList() + .get(1) + .getString(0) + .equals("H2020-EU.2.1.4.")); + Assertions + .assertTrue( + execverification + .filter("id = '40|corda__h2020::a657c271769fec90b60c1f2dbc25f4d5'") + .select("classification.h2020Programme.code") + .collectAsList() + .get(0) + .getString(0) + .equals("H2020-EU.3.2.6.") || + execverification + .filter("id = '40|corda__h2020::a657c271769fec90b60c1f2dbc25f4d5'") + .select("classification.h2020Programme.code") + .collectAsList() + .get(1) + .getString(0) + .equals("H2020-EU.3.2.6.")); + Assertions + .assertEquals( + "Biotechnology", + execverification + .filter( + "id = '40|corda__h2020::a657c271769fec90b60c1f2dbc25f4d5' and classification.h2020Programme.code = 'H2020-EU.2.1.4.'") + .select("classification.h2020Programme.description") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Bio-based Industries Joint Technology Initiative (BBI-JTI)", + execverification + .filter( + "id = '40|corda__h2020::a657c271769fec90b60c1f2dbc25f4d5' and classification.h2020Programme.code = 'H2020-EU.3.2.6.'") + .select("classification.h2020Programme.description") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "BBI-2019-SO3-D4", + execverification + .filter("id = '40|corda__h2020::a657c271769fec90b60c1f2dbc25f4d5'") + .select("h2020topiccode") + .collectAsList() + .get(0) + .getString(0)); + Assertions + .assertEquals( + "Demonstrate bio-based pesticides and/or biostimulant agents for sustainable increase in agricultural productivity", + execverification + .filter("id = '40|corda__h2020::a657c271769fec90b60c1f2dbc25f4d5'") + .select("h2020topicdescription") + .collectAsList() + .get(0) + .getString(0)); } } diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/httpconnector/HttpConnectorTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/httpconnector/HttpConnectorTest.java index 51a7019ca..8bcf08906 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/httpconnector/HttpConnectorTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/httpconnector/HttpConnectorTest.java @@ -13,7 +13,7 @@ public class HttpConnectorTest { private static final Log log = LogFactory.getLog(HttpConnectorTest.class); private static HttpConnector connector; - private static final String URL = "http://cordis.europa.eu/data/reference/cordisref-H2020programmes.csv"; + private static final String URL = "http://cordis.europa.eu/data/reference/cordisref-H2020topics.xlsx"; private static final String URL_MISCONFIGURED_SERVER = "https://www.alexandria.unisg.ch/cgi/oai2?verb=Identify"; private static final String URL_GOODSNI_SERVER = "https://air.unimi.it/oai/openaire?verb=Identify"; diff --git a/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/preparedProgramme_classification_whole.json.gz b/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/preparedProgramme_classification_whole.json.gz new file mode 100644 index 000000000..d40bac8c6 Binary files /dev/null and b/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/preparedProgramme_classification_whole.json.gz differ diff --git a/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/prepared_projects.json b/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/prepared_projects.json index b8805b2db..058ce8877 100644 --- a/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/prepared_projects.json +++ b/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/prepared_projects.json @@ -3,7 +3,7 @@ {"rcn":"229281","id":"896300","acronym":"STRETCH","status":"SIGNED","programme":"H2020-EU.1.3.2.","topics":"MSCA-IF-2019","frameworkProgramme":"H2020","title":"Smart Textiles for RETrofitting and Monitoring of Cultural Heritage Buildings","startDate":"2020-09-01","endDate":"2022-08-31","projectUrl":"","objective":"This project aims to develop novel techniques using smart multifunctional materials for the combined seismic-plus-energy retrofitting, and Structural Health Monitoring (SHM) of the European cultural heritage buildings (CHB). The need for upgrading the existing old and CHB is becoming increasingly important for the EU countries, due to: (1) their poor structural performance during recent earthquakes (e.g. Italy, Greece) or other natural hazards (e.g. extreme weather conditions) that have resulted in significant economic losses, and loss of human lives; and (2) their low energy performance which increases significantly their energy consumption (buildings are responsible for 40% of EU energy consumption). Moreover, the SHM of the existing buildings is crucial for assessing continuously their structural integrity and thus to provide information for planning cost effective and sustainable maintenance decisions. Since replacing the old buildings with new is not financially feasible, and even it is not allowed for CHB, their lifetime extension requires considering simultaneously both structural and energy retrofitting. It is noted that the annual cost of repair and maintenance of existing European building stock is estimated to be about 50% of the total construction budget, currently standing at more than €300 billion. To achieve cost effectiveness, STRETCH explores a novel approach, which integrates technical textile reinforcement with thermal insulation systems and strain sensors to provide simultaneous structural-plus-energy retrofitting combined with SHM, tailored for masonry cultural heritage building envelopes. The effectiveness of the proposed retrofitting system will be validated experimentally and analytically. Moreover, draft guidelines and recommendations for determining future research on the use of smart composite materials for the concurrent retrofitting (structural-plus-energy) and SHM of the existing cultural heritage buildings envelopes will be proposed.","totalCost":"183473,28","ecMaxContribution":"183473,28","call":"H2020-MSCA-IF-2019","fundingScheme":"MSCA-IF-EF-ST","coordinator":"JRC -JOINT RESEARCH CENTRE- EUROPEAN COMMISSION","coordinatorCountry":"BE","participants":"","participantCountries":"","subjects":""} {"rcn":"229265","id":"892890","acronym":"RhythmicPrediction","status":"SIGNED","programme":"H2020-EU.1.3.2.","topics":"MSCA-IF-2019","frameworkProgramme":"H2020","title":"Rhythmic prediction in speech perception: are our brain waves in sync with our native language?","startDate":"2021-01-01","endDate":"2022-12-31","projectUrl":"","objective":"Speech has rhythmic properties that widely differ across languages. When we listen to foreign languages, we may perceive them to be more musical, or rather more rap-like than our own. Even if we are unaware of it, the rhythm and melody of language, i.e. prosody, reflects its linguistic structure. On the one hand, prosody emphasizes content words and new information with stress and accents. On the other hand, it is aligned to phrase edges, marking them with boundary tones. Prosody hence helps the listener to focus on important words and to chunk sentences into phrases, and phrases into words. In fact, prosody is even used predictively, for instance to time the onset of the next word, the next piece of new information, or the total remaining length of the utterance, so the listener can seamlessly start their own speaking turn. \nSo, the listener, or rather their brain, is actively predicting when important speech events will happen, using prosody. How prosodic rhythms are exploited to predict speech timing, however, is unclear. No link between prosody and neural predictive processing has yet been empirically made. One hypothesis is that rhythm, such as the alternation of stressed and unstressed syllables, helps listeners time their attention. Similar behavior is best captured by the notion of an internal oscillator which can be set straight by attentional spikes. While neuroscientific evidence for the relation of neural oscillators to speech processing is starting to emerge, no link to the use of prosody nor predictive listening exists, yet. Furthermore, it is still unknown how native language knowledge affects cortical oscillations, and how oscillations are affected by cross-linguistic differences in rhythmic structure. The current project combines the standing knowledge of prosodic typology with the recent advances in neuroscience on cortical oscillations, to investigate the role of internal oscillators on native prosody perception, and active speech prediction.","totalCost":"191149,44","ecMaxContribution":"191149,44","call":"H2020-MSCA-IF-2019","fundingScheme":"MSCA-IF-EF-ST","coordinator":"UNIVERSITE DE GENEVE","coordinatorCountry":"CH","participants":"","participantCountries":"","subjects":""} {"rcn":"229235","id":"886828","acronym":"ASAP","status":"SIGNED","programme":"H2020-EU.1.3.2.","topics":"MSCA-IF-2019","frameworkProgramme":"H2020","title":"Advanced Solutions for Asphalt Pavements","startDate":"2021-09-01","endDate":"2023-08-31","projectUrl":"","objective":"The Advanced Solutions for Asphalt Pavements (ASAP) project involves the development of a unique road paving technology which will use a bio-bitumen rejuvenator to rejuvenate aged asphalt bitumen. This technology will help to extend the lifespan of asphalt pavements (roads) and will reduce the environmental and economic impact of roads and road maintenance processes. Recycling and self-healing processes will replace fossil fuel dependent technology. Self-healing will involve rejuvenating aged asphalt bitumen using a bio-rejuvenator developed using microalgae oils (rejuvenating bio-oil). Microalgae has been selected because of its fast growth, versatility and ability to survive within hostile environments, such as wastewater. \n\nASAP will utilise microalgae, cultivated within the wastewater treatment process, as a source of the rejuvenating bio-oil. The solvent (Soxhlet) processes will be used to extract the oil from the microalgae. To ensure the efficiency of the oil extraction process, an ultrasonication process will be used to pre-treat the microalgae. The suitability of rejuvenating bio-oil as a replacement for the bitumen rejuvenator (fossil fuel based) will be ascertained via a series of standard bituminous and accelerated tests. A rejuvenator-binder diffusion numerical model will be developed, based on the Delft Lattice concrete diffusion model, to determine the conditions required for rejuvenation to occur and to ascertain the healing rate of the asphalt binder. These parameters will facilitate the selection and optimisation of the asphalt self-healing systems (specifically the amount of bio-oil rejuvenator and time required) to achieve full rejuvenation. \n\nThis novel approach will benchmark the effectiveness of this intervention against existing asphalt design and maintenance processes and assess feasibility. The ASAP project presents an opportunity to revolutionise road design and maintenance processes and reduce its environmental and financial costs.","totalCost":"187572,48","ecMaxContribution":"187572,48","call":"H2020-MSCA-IF-2019","fundingScheme":"MSCA-IF-EF-ST","coordinator":"NEDERLANDSE ORGANISATIE VOOR TOEGEPAST NATUURWETENSCHAPPELIJK ONDERZOEK TNO","coordinatorCountry":"NL","participants":"","participantCountries":"","subjects":""} -{"rcn":null,"id":"886776","acronym":null,"status":null,"programme":"H2020-EU.2.1.4.","topics":null,"frameworkProgramme":"H2020","title":"BIO-Based pESTicides production for sustainable agriculture management plan","startDate":"2020-05-01","endDate":"2023-04-30","projectUrl":"","objective":"The BIOBESTicide project will validate and demonstrate the production of an effective and cost-efficient biopesticide. The demonstration will be based on an innovative bio-based value chain starting from the valorisation of sustainable biomasses, i.e. beet pulp and sugar molasses and will exploit the properties of the oomycete Pythium oligandrum strain I-5180 to increase natural plant defenses, to produce an highly effective and eco-friendly biopesticide solution for vine plants protection. \nBIOVITIS, the project coordinator, has developed, at laboratory level (TRL4), an effective method to biocontrol one of the major causes of worldwide vineyards destruction, the Grapevine Trunk Diseases (GTDs). The protection system is based on the oomycete Pythium oligandrum strain I-5180 that, at applied at optimal time and concentration, colonises the root of vines and stimulates the natural plant defences against GTDs, providing a protection that ranges between 40% and 60%. \nBIOBESTicide project will respond to the increasing demands for innovative solutions for crop protection agents, transferring the technology to a DEMO Plant able to produce more than 10 T of a high-quality oomycete-based biopesticide product per year (TRL7). \nThe BIOBESTicide project will validate the efficiency of the formulated product on vineyards of different geographical areas.\nTo assure the safety of products under both health and environmental points of view, a full and complete approval dossier for Pythium oligandrum strain I-5180 will be submitted in all the European countries. \nA Life Cycle Sustainability Assessment (LCSA) will be conducted to assess the environmental, economic and social impacts of the developed products.\nThe adoption of the effective and cost-efficient biopesticide will have significant impacts with a potential ROI of 30 % in just 5 years and a total EBITDA of more than € 6,400,000.","totalCost":"4402772,5","ecMaxContribution":"3069653","call":"H2020-BBI-JTI-2019","fundingScheme":"BBI-IA-DEMO","coordinator":"BIOVITIS","coordinatorCountry":"FR","participants":"MERCIER FRERES SARL;FUNDACION TECNALIA RESEARCH & INNOVATION;LAMBERTI SPA;EURION CONSULTING;CIAOTECH Srl;STOWARZYSZENIE ZACHODNIOPOMORSKI KLASTER CHEMICZNY ZIELONA CHEMIA;NORDZUCKER AG;INSTITUT NATIONAL DE RECHERCHE POUR L'AGRICULTURE, L'ALIMENTATION ET L'ENVIRONNEMENT;INSTITUT FRANCAIS DE LA VIGNE ET DU VIN","participantCountries":"FR;ES;IT;PL;DE","subjects":""} +{"rcn":null,"id":"886776","acronym":null,"status":null,"programme":"H2020-EU.2.1.4.","topics":"BBI-2019-SO3-D4","frameworkProgramme":"H2020","title":"BIO-Based pESTicides production for sustainable agriculture management plan","startDate":"2020-05-01","endDate":"2023-04-30","projectUrl":"","objective":"The BIOBESTicide project will validate and demonstrate the production of an effective and cost-efficient biopesticide. The demonstration will be based on an innovative bio-based value chain starting from the valorisation of sustainable biomasses, i.e. beet pulp and sugar molasses and will exploit the properties of the oomycete Pythium oligandrum strain I-5180 to increase natural plant defenses, to produce an highly effective and eco-friendly biopesticide solution for vine plants protection. \nBIOVITIS, the project coordinator, has developed, at laboratory level (TRL4), an effective method to biocontrol one of the major causes of worldwide vineyards destruction, the Grapevine Trunk Diseases (GTDs). The protection system is based on the oomycete Pythium oligandrum strain I-5180 that, at applied at optimal time and concentration, colonises the root of vines and stimulates the natural plant defences against GTDs, providing a protection that ranges between 40% and 60%. \nBIOBESTicide project will respond to the increasing demands for innovative solutions for crop protection agents, transferring the technology to a DEMO Plant able to produce more than 10 T of a high-quality oomycete-based biopesticide product per year (TRL7). \nThe BIOBESTicide project will validate the efficiency of the formulated product on vineyards of different geographical areas.\nTo assure the safety of products under both health and environmental points of view, a full and complete approval dossier for Pythium oligandrum strain I-5180 will be submitted in all the European countries. \nA Life Cycle Sustainability Assessment (LCSA) will be conducted to assess the environmental, economic and social impacts of the developed products.\nThe adoption of the effective and cost-efficient biopesticide will have significant impacts with a potential ROI of 30 % in just 5 years and a total EBITDA of more than € 6,400,000.","totalCost":"4402772,5","ecMaxContribution":"3069653","call":"H2020-BBI-JTI-2019","fundingScheme":"BBI-IA-DEMO","coordinator":"BIOVITIS","coordinatorCountry":"FR","participants":"MERCIER FRERES SARL;FUNDACION TECNALIA RESEARCH & INNOVATION;LAMBERTI SPA;EURION CONSULTING;CIAOTECH Srl;STOWARZYSZENIE ZACHODNIOPOMORSKI KLASTER CHEMICZNY ZIELONA CHEMIA;NORDZUCKER AG;INSTITUT NATIONAL DE RECHERCHE POUR L'AGRICULTURE, L'ALIMENTATION ET L'ENVIRONNEMENT;INSTITUT FRANCAIS DE LA VIGNE ET DU VIN","participantCountries":"FR;ES;IT;PL;DE","subjects":""} {"rcn":null,"id":"886776","acronym":null,"status":null,"programme":"H2020-EU.3.2.6.","topics":"BBI-2019-SO3-D4","frameworkProgramme":"H2020","title":"BIO-Based pESTicides production for sustainable agriculture management plan","startDate":"2020-05-01","endDate":"2023-04-30","projectUrl":"","objective":"The BIOBESTicide project will validate and demonstrate the production of an effective and cost-efficient biopesticide. The demonstration will be based on an innovative bio-based value chain starting from the valorisation of sustainable biomasses, i.e. beet pulp and sugar molasses and will exploit the properties of the oomycete Pythium oligandrum strain I-5180 to increase natural plant defenses, to produce an highly effective and eco-friendly biopesticide solution for vine plants protection. \nBIOVITIS, the project coordinator, has developed, at laboratory level (TRL4), an effective method to biocontrol one of the major causes of worldwide vineyards destruction, the Grapevine Trunk Diseases (GTDs). The protection system is based on the oomycete Pythium oligandrum strain I-5180 that, at applied at optimal time and concentration, colonises the root of vines and stimulates the natural plant defences against GTDs, providing a protection that ranges between 40% and 60%. \nBIOBESTicide project will respond to the increasing demands for innovative solutions for crop protection agents, transferring the technology to a DEMO Plant able to produce more than 10 T of a high-quality oomycete-based biopesticide product per year (TRL7). \nThe BIOBESTicide project will validate the efficiency of the formulated product on vineyards of different geographical areas.\nTo assure the safety of products under both health and environmental points of view, a full and complete approval dossier for Pythium oligandrum strain I-5180 will be submitted in all the European countries. \nA Life Cycle Sustainability Assessment (LCSA) will be conducted to assess the environmental, economic and social impacts of the developed products.\nThe adoption of the effective and cost-efficient biopesticide will have significant impacts with a potential ROI of 30 % in just 5 years and a total EBITDA of more than € 6,400,000.","totalCost":"4402772,5","ecMaxContribution":"3069653","call":"H2020-BBI-JTI-2019","fundingScheme":"BBI-IA-DEMO","coordinator":"BIOVITIS","coordinatorCountry":"FR","participants":"MERCIER FRERES SARL;FUNDACION TECNALIA RESEARCH & INNOVATION;LAMBERTI SPA;EURION CONSULTING;CIAOTECH Srl;STOWARZYSZENIE ZACHODNIOPOMORSKI KLASTER CHEMICZNY ZIELONA CHEMIA;NORDZUCKER AG;INSTITUT NATIONAL DE RECHERCHE POUR L'AGRICULTURE, L'ALIMENTATION ET L'ENVIRONNEMENT;INSTITUT FRANCAIS DE LA VIGNE ET DU VIN","participantCountries":"FR;ES;IT;PL;DE","subjects":""} {"rcn":"229276","id":"895426","acronym":"DisMoBoH","status":"SIGNED","programme":"H2020-EU.1.3.2.","topics":"MSCA-IF-2019","frameworkProgramme":"H2020","title":"Dissecting the molecular building principles of locally formed transcriptional hubs","startDate":"2021-09-01","endDate":"2023-08-31","projectUrl":"","objective":"Numerous DNA variants have already been identified that modulate inter-individual molecular traits – most prominently gene expression. However, since finding mechanistic interpretations relating genotype to phenotype has proven challenging, the focus has shifted to higher-order regulatory features, i.e. chromatin accessibility, transcription factor (TF) binding and 3D chromatin interactions. This revealed at least two enhancer types: “lead” enhancers in which the presence of genetic variants modulates the activity of entire chromatin domains, and “dependent” ones in which variants induce subtle changes, affecting DNA accessibility, but not transcription. Although cell type-specific TFs are likely important, it remains unclear which sequence features are required to establish such enhancer hierarchies, and under which circumstances genetic variation results in altered enhancer-promoter contacts and differential gene expression. Here, we propose to investigate the molecular mechanisms that link DNA variation to TF binding, chromatin topology, and gene expression response. We will leverage data on enhancer hierarchy and sequence-specific TF binding to identify the sequence signatures that define “lead” enhancers. The results will guide the design of a synthetic locus that serves as an in vivo platform to systematically vary the building blocks of local transcriptional units: i) DNA sequence – including variations in TF binding site affinity and syntax, ii) molecular interactions between TFs, and iii) chromatin conformation. To validate our findings, we will perform optical reconstruction of chromatin architecture for a select number of DNA variants. By simultaneously perturbing co-dependent features, this proposal will provide novel mechanistic insights into the formation of local transcriptional hubs.","totalCost":"191149,44","ecMaxContribution":"191149,44","call":"H2020-MSCA-IF-2019","fundingScheme":"MSCA-IF-EF-RI","coordinator":"ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE","coordinatorCountry":"CH","participants":"","participantCountries":"","subjects":""} {"rcn":"229288","id":"898218","acronym":"devUTRs","status":"SIGNED","programme":"H2020-EU.1.3.2.","topics":"MSCA-IF-2019","frameworkProgramme":"H2020","title":"Uncovering the roles of 5′UTRs in translational control during early zebrafish development","startDate":"2021-09-01","endDate":"2023-08-31","projectUrl":"","objective":"Following fertilisation, metazoan embryos are transcriptionally silent, and embryogenesis is controlled by maternally deposited factors. Developmental progression requires the synthesis of new mRNAs and proteins in a coordinated fashion. Many posttranscriptional mechanisms regulate the fate of maternal mRNAs, but it is less understood how translational control shapes early embryogenesis. In eukaryotes, translation starts at the mRNA 5′ end, consisting of the 5′ cap and 5′ untranslated region (UTR). Protein synthesis is primarily regulated at the translation initiation step by elements within the 5′UTR. However, the role of 5′UTRs in regulating the dynamics of mRNA translation during vertebrate embryogenesis remains unexplored. For example, all vertebrate ribosomal protein (RP) mRNAs harbor a conserved terminal oligopyrimidine tract (TOP) in their 5′UTR. RP levels must be tightly controlled to ensure proper organismal development, but if and how the TOP motif mediates RP mRNA translational regulation during embryogenesis is unclear. Overall, we lack a systematic understanding of the regulatory information contained in 5′UTRs. In this work, I aim to uncover the 5′UTR in vivo rules for mRNA translational regulation during zebrafish embryogenesis. I propose to apply imaging and biochemical approaches to characterise the role of the TOP motif in RP mRNA translational regulation during embryogenesis and identify the trans-acting factor(s) that bind(s) to it (Aim 1). To systematically assess the contribution of 5′UTRs to mRNA translational regulation during zebrafish embryogenesis, I will couple a massively parallel reporter assay of 5′UTRs to polysome profiling (Aim 2). By integrating the translational behaviour of 5′UTR reporters throughout embryogenesis with sequence-based regression models, I anticipate to uncover novel cis-regulatory elements in 5′UTRs with developmental roles.","totalCost":"191149,44","ecMaxContribution":"191149,44","call":"H2020-MSCA-IF-2019","fundingScheme":"MSCA-IF-EF-ST","coordinator":"UNIVERSITAT BASEL","coordinatorCountry":"CH","participants":"","participantCountries":"","subjects":""} @@ -13,4 +13,5 @@ {"rcn":"229239","id":"887259","acronym":"ALEHOOP","status":"SIGNED","programme":"H2020-EU.2.1.4.","topics":"BBI-2019-SO3-D3","frameworkProgramme":"H2020","title":"Biorefineries for the valorisation of macroalgal residual biomass and legume processing by-products to obtain new protein value chains for high-value food and feed applications","startDate":"2020-06-01","endDate":"2024-05-31","projectUrl":"","objective":"ALEHOOP provides the demonstration at pilot scale of both sustainable macroalgae and legume-based biorefineries for the recovery of low-cost dietary proteins from alga-based and plant residual biomass and their validation to meet market requirements of consumers and industry in the food and feed sectors. In these sectors, consumers are demanding affordable functional natural proteins from alternative sources and industry is demanding low-cost bio-based protein formulations with better performance and higher sustainability. \nCurrent protein demand for the 7.3 billion inhabitants of the world is approximately 202 Mt. Due to the rise in meat consumption more proteins are therefore required for animal feeding. To satisfy the current protein demand, Europe imports over 30 Mt of soy from the Americas each year mainly for animal feeding, entailing 95% dependency of EU on imported soy. Current sources of proteins are becoming unsustainable from an economic and environmental perspective for Europe resulting in concerns for sustainability and food security and leading to search for new alternative proteins. \nALEHOOP addresses the obtaining of proteins from green macroalgal blooms, brown seaweed by-products from algae processors and legume processing by-products (peas, lupines, beans and lentils) as alternative protein sources for animal feeding (case of green seaweed) and food applications (case of brown seaweed and legume by-products), since they are low cost and under-exploited biomass that do not compete with traditional food crops for space and resources. This will reduce EU´s dependency on protein imports and contribute to our raw material security. The new proteins will be validated in foods for elderly, sporty and overweight people, vegetarians and healthy consumers as well as for animal feed creating cross-sectorial interconnection between these value chains and supporting the projected business plan.","totalCost":"6718370","ecMaxContribution":"5140274,41","call":"H2020-BBI-JTI-2019","fundingScheme":"BBI-IA-DEMO","coordinator":"CONTACTICA S.L.","coordinatorCountry":"ES","participants":"CENTIV GMBH;ALGINOR ASA;FUNDACION TECNALIA RESEARCH & INNOVATION;INDUKERN,S.A.;ASOCIACION NACIONAL DE FABRICANTES DE CONSERVAS DE PESCADOS Y MARISCOS-CENTRO TECNICO NACIONAL DE CONSERVACION DE PRODUCTOS DE LA PESCA;BIOZOON GMBH;EIGEN VERMOGEN VAN HET INSTITUUT VOOR LANDBOUW- EN VISSERIJONDERZOEK;BIOSURYA SL;VYZKUMNY USTAV VETERINARNIHO LEKARSTVI;NUTRITION SCIENCES;TECHNOLOGICAL UNIVERSITY DUBLIN;GARLAN, S.COOP.;ISANATUR SPAIN SL;UNIVERSIDAD DE VIGO;UNIVERSIDAD DE CADIZ","participantCountries":"DE;NO;ES;BE;CZ;IE","subjects":""} {"rcn":"229239","id":"887259","acronym":"ALEHOOP","status":"SIGNED","programme":"H2020-EU.3.2.6.","topics":"BBI-2019-SO3-D3","frameworkProgramme":"H2020","title":"Biorefineries for the valorisation of macroalgal residual biomass and legume processing by-products to obtain new protein value chains for high-value food and feed applications","startDate":"2020-06-01","endDate":"2024-05-31","projectUrl":"","objective":"ALEHOOP provides the demonstration at pilot scale of both sustainable macroalgae and legume-based biorefineries for the recovery of low-cost dietary proteins from alga-based and plant residual biomass and their validation to meet market requirements of consumers and industry in the food and feed sectors. In these sectors, consumers are demanding affordable functional natural proteins from alternative sources and industry is demanding low-cost bio-based protein formulations with better performance and higher sustainability. \nCurrent protein demand for the 7.3 billion inhabitants of the world is approximately 202 Mt. Due to the rise in meat consumption more proteins are therefore required for animal feeding. To satisfy the current protein demand, Europe imports over 30 Mt of soy from the Americas each year mainly for animal feeding, entailing 95% dependency of EU on imported soy. Current sources of proteins are becoming unsustainable from an economic and environmental perspective for Europe resulting in concerns for sustainability and food security and leading to search for new alternative proteins. \nALEHOOP addresses the obtaining of proteins from green macroalgal blooms, brown seaweed by-products from algae processors and legume processing by-products (peas, lupines, beans and lentils) as alternative protein sources for animal feeding (case of green seaweed) and food applications (case of brown seaweed and legume by-products), since they are low cost and under-exploited biomass that do not compete with traditional food crops for space and resources. This will reduce EU´s dependency on protein imports and contribute to our raw material security. The new proteins will be validated in foods for elderly, sporty and overweight people, vegetarians and healthy consumers as well as for animal feed creating cross-sectorial interconnection between these value chains and supporting the projected business plan.","totalCost":"6718370","ecMaxContribution":"5140274,41","call":"H2020-BBI-JTI-2019","fundingScheme":"BBI-IA-DEMO","coordinator":"CONTACTICA S.L.","coordinatorCountry":"ES","participants":"CENTIV GMBH;ALGINOR ASA;FUNDACION TECNALIA RESEARCH & INNOVATION;INDUKERN,S.A.;ASOCIACION NACIONAL DE FABRICANTES DE CONSERVAS DE PESCADOS Y MARISCOS-CENTRO TECNICO NACIONAL DE CONSERVACION DE PRODUCTOS DE LA PESCA;BIOZOON GMBH;EIGEN VERMOGEN VAN HET INSTITUUT VOOR LANDBOUW- EN VISSERIJONDERZOEK;BIOSURYA SL;VYZKUMNY USTAV VETERINARNIHO LEKARSTVI;NUTRITION SCIENCES;TECHNOLOGICAL UNIVERSITY DUBLIN;GARLAN, S.COOP.;ISANATUR SPAIN SL;UNIVERSIDAD DE VIGO;UNIVERSIDAD DE CADIZ","participantCountries":"DE;NO;ES;BE;CZ;IE","subjects":""} {"rcn":"229258","id":"892834","acronym":"DENVPOC","status":"SIGNED","programme":"H2020-EU.1.3.2.","topics":"MSCA-IF-2019","frameworkProgramme":"H2020","title":"qPCR Microfluidics point-of-care platform for dengue diagnosis","startDate":"2020-05-18","endDate":"2022-05-17","projectUrl":"","objective":"As a result of Global climate change and fast urbanization, global outbreaks of Dengue (DENV)/ Zika(ZIKV)/Chikungunya(CHIKV) virus have the potential to occur. The most common pathway of these infections in humans is through the female Aedes mosquito vector. DENV is an exanthematous febrile disease with varied clinical manifestations and progressions . Due to similarities in symptoms between DENV and ZIKV and CHIKV, it is difficult to make a differential diagnosis, impeding appropriate, timely medical intervention. Furthermore, cross-reactivity with ZIKV, which was recently related to microcephaly, is a serious issue. In 2016, in Brazil alone, there were 4180 microcephaly cases reported instead of 163 cases, more in line with yearly expected projections , , Thus, the sooner an accurate diagnostic which differentiates DENV from the other manifestations is critical; most especially at the early stages of the infection, to have a reliable diagnosis in pregnant women. In 2016, the OMS emergency committee declared that the outbreaks and the potentially resultant neurological disorders in Brazil were an important international state of emergency in public health, as a result of the associated secondary effects; these diseases became a Global concern. This project allows developing a highly and fast Multiplex qPCR POC platform by using FASTGENE technology with a minimal amount of patient serotype. It would reduce the time of analysis (30 to 90’ for a standard) and costs. Additionally, the sample preprocessing and thermalization will shorten real-time PCR amplification time and will be integrated within the microfluidic systems. This platform can result in a commercialized product whereupon a main market target would be pregnant women and people living or traveling through/from outbreak risk areas.","totalCost":"196707,84","ecMaxContribution":"196707,84","call":"H2020-MSCA-IF-2019","fundingScheme":"MSCA-IF-EF-SE","coordinator":"BFORCURE","coordinatorCountry":"FR","participants":"","participantCountries":"","subjects":""} -{"rcn":"229280","id":"895716","acronym":"DoMiCoP","status":"SIGNED","programme":"H2020-EU.1.3.2.","topics":"MSCA-IF-2019","frameworkProgramme":"H2020","title":"The Diffusion of Migration Control Practice. Actors, Processes and Effects.","startDate":"2021-03-01","endDate":"2023-02-28","projectUrl":"","objective":"DoMiCoP develops new understandings and perspectives to study migration control in practice in the European Union by asking one main question: how and why do communities of practice develop and diffuse the knowledge required to put migration control into action? Unlike the nexus between expert knowledge, epistemic communities and policy formulation, the nexus between everyday knowledge, communities of practice and policy implementation has not yet received systematic scholarly attention. My project bridges that gap by focusing on intermediate arenas in which communities of practice take shape most notably the meetings and trainings that gather state and non-state actors involved in putting asylum, detention and removal into practice. By building on field-based methodologies (interviews and participant observations), DoMiCoP sheds ethnographic light on the role that ‘learning from abroad’ plays in the implementation of migration control in the EU. My project’s aim is threefold: 1) Identifying arenas at intermediate levels in which communities of practice take shape; 2) Analysing the communities of practice by focusing on the configurations of actors and organizations involved, the motivations underlying their involvement, the process of knowledge development in interaction, the conflicts and negotiations; 3) Revealing the role of non-state organizations (private for profit and not-for-profit). From a theoretical point of view, this project goes beyond the classical view of the implementation as a test to assess the effectiveness of policy transfers towards an analysis of policy transfer at that level of policy-making. From an empirical point of view, the project expands knowledge about less-studied venues of policy-making and provides original thick descriptions. From a methodological point of view, the project engages with qualitative methods for the study of policy diffusion and aims at responding to their main challenges through participant observation.","totalCost":"163673,28","ecMaxContribution":"163673,28","call":"H2020-MSCA-IF-2019","fundingScheme":"MSCA-IF-EF-ST","coordinator":"EUROPEAN UNIVERSITY INSTITUTE","coordinatorCountry":"IT","participants":"","participantCountries":"","subjects":""} \ No newline at end of file +{"rcn":"229280","id":"895716","acronym":"DoMiCoP","status":"SIGNED","programme":"H2020-EU.1.3.2.","topics":"MSCA-IF-2019","frameworkProgramme":"H2020","title":"The Diffusion of Migration Control Practice. Actors, Processes and Effects.","startDate":"2021-03-01","endDate":"2023-02-28","projectUrl":"","objective":"DoMiCoP develops new understandings and perspectives to study migration control in practice in the European Union by asking one main question: how and why do communities of practice develop and diffuse the knowledge required to put migration control into action? Unlike the nexus between expert knowledge, epistemic communities and policy formulation, the nexus between everyday knowledge, communities of practice and policy implementation has not yet received systematic scholarly attention. My project bridges that gap by focusing on intermediate arenas in which communities of practice take shape most notably the meetings and trainings that gather state and non-state actors involved in putting asylum, detention and removal into practice. By building on field-based methodologies (interviews and participant observations), DoMiCoP sheds ethnographic light on the role that ‘learning from abroad’ plays in the implementation of migration control in the EU. My project’s aim is threefold: 1) Identifying arenas at intermediate levels in which communities of practice take shape; 2) Analysing the communities of practice by focusing on the configurations of actors and organizations involved, the motivations underlying their involvement, the process of knowledge development in interaction, the conflicts and negotiations; 3) Revealing the role of non-state organizations (private for profit and not-for-profit). From a theoretical point of view, this project goes beyond the classical view of the implementation as a test to assess the effectiveness of policy transfers towards an analysis of policy transfer at that level of policy-making. From an empirical point of view, the project expands knowledge about less-studied venues of policy-making and provides original thick descriptions. From a methodological point of view, the project engages with qualitative methods for the study of policy diffusion and aims at responding to their main challenges through participant observation.","totalCost":"163673,28","ecMaxContribution":"163673,28","call":"H2020-MSCA-IF-2019","fundingScheme":"MSCA-IF-EF-ST","coordinator":"EUROPEAN UNIVERSITY INSTITUTE","coordinatorCountry":"IT","participants":"","participantCountries":"","subjects":""} +{"rcn":"230066","id":"883730","acronym":"SOLSPACE","status":"SIGNED","programme":"H2020-EU.1.1.","topics":"ERC-2019-ADG","frameworkProgramme":"H2020","title":"Enhancing Global Clean Energy Services Using Orbiting Solar Reflectors", "startDate":"2021-03-01","endDate":"2025-11-30","projectUrl":"","objective":"fake", "totalCost":"2496392","ecMaxContribution":"2496392","call":"ERC-2019-ADG","fundingScheme":"ERC-ADG","coordinator":"UNIVERSITY OF GLASGOW","coordinatorCountry":"UK","participants":"","participantCountries":"","subjects":""} diff --git a/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/topic.json.gz b/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/topic.json.gz new file mode 100644 index 000000000..623c92427 Binary files /dev/null and b/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/topic.json.gz differ diff --git a/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/whole_programme.json.gz b/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/whole_programme.json.gz index 85440ceed..60c3bf05a 100644 Binary files a/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/whole_programme.json.gz and b/dhp-workflows/dhp-aggregation/src/test/resources/eu/dnetlib/dhp/actionmanager/project/whole_programme.json.gz differ diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/DumpProducts.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/DumpProducts.java index c97d2d72a..8a6c91395 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/DumpProducts.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/DumpProducts.java @@ -11,6 +11,7 @@ import java.util.Set; import java.util.stream.Collectors; import org.apache.spark.SparkConf; +import org.apache.spark.api.java.function.MapFunction; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Encoders; import org.apache.spark.sql.SaveMode; @@ -57,7 +58,7 @@ public class DumpProducts implements Serializable { Utils .readPath(spark, inputPath, inputClazz) - .map(value -> execMap(value, communityMap, graph), Encoders.bean(outputClazz)) + .map((MapFunction) value -> execMap(value, communityMap, graph), Encoders.bean(outputClazz)) .filter(Objects::nonNull) .write() .mode(SaveMode.Overwrite) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpGraphEntities.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpGraphEntities.java index 86421cff5..3851c5d35 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpGraphEntities.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpGraphEntities.java @@ -9,6 +9,7 @@ import java.util.*; import java.util.stream.Collectors; import org.apache.spark.SparkConf; +import org.apache.spark.api.java.function.MapFunction; import org.apache.spark.sql.Encoders; import org.apache.spark.sql.SaveMode; import org.apache.spark.sql.SparkSession; @@ -88,7 +89,9 @@ public class DumpGraphEntities implements Serializable { Class inputClazz) { Utils .readPath(spark, inputPath, inputClazz) - .map(d -> mapDatasource((eu.dnetlib.dhp.schema.oaf.Datasource) d), Encoders.bean(Datasource.class)) + .map( + (MapFunction) d -> mapDatasource((eu.dnetlib.dhp.schema.oaf.Datasource) d), + Encoders.bean(Datasource.class)) .filter(Objects::nonNull) .write() .mode(SaveMode.Overwrite) @@ -100,7 +103,9 @@ public class DumpGraphEntities implements Serializable { Class inputClazz) { Utils .readPath(spark, inputPath, inputClazz) - .map(p -> mapProject((eu.dnetlib.dhp.schema.oaf.Project) p), Encoders.bean(Project.class)) + .map( + (MapFunction) p -> mapProject((eu.dnetlib.dhp.schema.oaf.Project) p), + Encoders.bean(Project.class)) .write() .mode(SaveMode.Overwrite) .option("compression", "gzip") @@ -374,13 +379,17 @@ public class DumpGraphEntities implements Serializable { } project - .setProgramme( + .setH2020Classifications( Optional - .ofNullable(p.getProgramme()) + .ofNullable(p.getH2020classification()) .map( - programme -> programme + classification -> classification .stream() - .map(pg -> Programme.newInstance(pg.getCode(), pg.getDescription())) + .map( + c -> H2020Classification + .newInstance( + c.getH2020Programme().getCode(), c.getH2020Programme().getDescription(), + c.getLevel1(), c.getLevel2(), c.getLevel3(), c.getClassification())) .collect(Collectors.toList())) .orElse(new ArrayList<>())); @@ -442,7 +451,9 @@ public class DumpGraphEntities implements Serializable { Class inputClazz) { Utils .readPath(spark, inputPath, inputClazz) - .map(o -> mapOrganization((eu.dnetlib.dhp.schema.oaf.Organization) o), Encoders.bean(Organization.class)) + .map( + (MapFunction) o -> mapOrganization((eu.dnetlib.dhp.schema.oaf.Organization) o), + Encoders.bean(Organization.class)) .write() .mode(SaveMode.Overwrite) .option("compression", "gzip") diff --git a/pom.xml b/pom.xml index bd2a85667..03c69108d 100644 --- a/pom.xml +++ b/pom.xml @@ -431,6 +431,21 @@ ${common.compress.version} + + + org.apache.commons + commons-csv + ${common.csv.version} + + + + + + org.apache.poi + poi-ooxml + ${apache.poi.version} + + org.json4s json4s-jackson_2.11 @@ -666,8 +681,10 @@ 3.1.1 7.5.0 4.7.2 - 1.1 + 1.20 3.5.3 4.13.0 + 1.8 + 4.1.2