From 98f37c8d81222bce8cb4870850e65dcf52fc375a Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Tue, 19 Oct 2021 16:14:40 +0200 Subject: [PATCH] WIP: worflow nodes for including Scholexplorer records in the RAW graph --- .../dhp/oa/graph/raw/CopyHdfsOafApplication.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/CopyHdfsOafApplication.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/CopyHdfsOafApplication.java index 2e0611475..c0accd25a 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/CopyHdfsOafApplication.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/CopyHdfsOafApplication.java @@ -101,24 +101,15 @@ public class CopyHdfsOafApplication extends AbstractMigrationApplication { .as(Encoders.kryo(Oaf.class)); // dispatch each entity type individually in the respective graph subdirectory in append mode - for(Map.Entry e : ModelSupport.entityTypes.entrySet()) { + for(Map.Entry e : ModelSupport.oafTypes.entrySet()) { oaf - .filter((FilterFunction) o -> o.getClass().getSimpleName().toLowerCase().equals(e.getKey().toString())) + .filter((FilterFunction) o -> o.getClass().getSimpleName().toLowerCase().equals(e.getKey())) .map((MapFunction) OBJECT_MAPPER::writeValueAsString, Encoders.bean(e.getValue())) .write() .option("compression", "gzip") .mode(SaveMode.Append) .text(outputPath + "/" + e.getKey()); } - - oaf - .flatMap((FlatMapFunction) o -> { - Relation rel = (Relation) o; - List rels = Lists.newArrayList(); - rels.add(getInverse(rel, vocs)); - - return rels.iterator(); - }, Encoders.bean(Relation.class)); } }