From d465f0eec9e53a234affccbc32d4b287aa2aba38 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Mon, 3 Aug 2020 18:03:27 +0200 Subject: [PATCH] added fulltext to result --- .../dhp/oa/graph/dump/ResultMapper.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java index 8db71167a..c806edeb9 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java @@ -124,17 +124,14 @@ public class ResultMapper implements Serializable { break; } - Optional> oAuthor = Optional.ofNullable(input.getAuthor()); - if (oAuthor.isPresent()) { - // List authorList = new ArrayList<>(); - out - .setAuthor( - oAuthor - .get() - .stream() - .map(oa -> getAuthor(oa)) - .collect(Collectors.toList())); - } + + Optional + .ofNullable(input.getFulltext()) + .ifPresent(fts -> out.setFulltext(fts.stream().map(ft -> ft.getValue()).collect(Collectors.toList()))); + + Optional + .ofNullable(input.getAuthor()) + .ifPresent(ats -> out.setAuthor(ats.stream().map(at -> getAuthor(at)).collect(Collectors.toList()))); // I do not map Access Right UNKNOWN or OTHER