From 5d3012eeb42ccaf87434753a82ae3811aea50d39 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Tue, 27 Oct 2020 16:14:18 +0100 Subject: [PATCH] changed code to dump only the programme list and not the classification list --- .../graph/dump/graph/DumpGraphEntities.java | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) 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 5e329c9783..3a86cebeba 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 @@ -8,6 +8,7 @@ import java.io.StringReader; import java.util.*; import java.util.stream.Collectors; +import eu.dnetlib.dhp.schema.oaf.H2020Programme; import org.apache.spark.SparkConf; import org.apache.spark.api.java.function.MapFunction; import org.apache.spark.sql.Encoders; @@ -378,20 +379,14 @@ public class DumpGraphEntities implements Serializable { } } - project - .setH2020Classifications( - Optional - .ofNullable(p.getH2020classification()) - .map( - classification -> classification - .stream() - .map( - c -> H2020Classification - .newInstance( - c.getH2020Programme().getCode(), c.getH2020Programme().getDescription(), - c.getLevel1(), c.getLevel2(), c.getLevel3(), c.getClassification())) - .collect(Collectors.toList())) - .orElse(new ArrayList<>())); + project.setH2020programme( + Optional.ofNullable(p.getH2020classification()) + .map(classification -> classification + .stream() + .map(c -> Programme.newInstance(c.getH2020Programme().getCode(), c.getH2020Programme().getDescription())).collect(Collectors.toList())) + .orElse(new ArrayList<>())); + + Optional>> ofundTree = Optional .ofNullable(p.getFundingtree());