From b9dddbfe543f4efb9b6a5fd6d7acffc02ec4c440 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 31 Jul 2023 17:52:56 +0200 Subject: [PATCH] rule out records with NULL dataInfo, except for Relations --- .../oaf/utils/GraphCleaningFunctions.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/GraphCleaningFunctions.java b/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/GraphCleaningFunctions.java index 7af85fc4a..2ba805e1e 100644 --- a/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/GraphCleaningFunctions.java +++ b/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/GraphCleaningFunctions.java @@ -228,20 +228,20 @@ public class GraphCleaningFunctions extends CleaningFunctions { } public static boolean filter(T value) { - if (Boolean.TRUE - .equals( - Optional - .ofNullable(value) - .map( - o -> Optional - .ofNullable(o.getDataInfo()) - .map( - d -> Optional - .ofNullable(d.getInvisible()) - .orElse(true)) - .orElse(false)) - .orElse(true))) { - return true; + if (!(value instanceof Relation) && (Boolean.TRUE + .equals( + Optional + .ofNullable(value) + .map( + o -> Optional + .ofNullable(o.getDataInfo()) + .map( + d -> Optional + .ofNullable(d.getInvisible()) + .orElse(true)) + .orElse(false)) + .orElse(true)))) { + return true; } if (value instanceof Datasource) {