diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/CleaningFunctions.java b/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/CleaningFunctions.java index afbe0cff6..6c7d3e915 100644 --- a/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/CleaningFunctions.java +++ b/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/CleaningFunctions.java @@ -152,7 +152,12 @@ public class CleaningFunctions { Optional .ofNullable(i.getPid()) .ifPresent(pid -> { - final Set pids = Sets.newHashSet(pid); + final Set pids = Sets + .newHashSet( + pid + .stream() + .filter(p -> StringUtils.isBlank(p.getValue())) + .collect(Collectors.toList())); final Set altIds = Sets.newHashSet(i.getAlternateIdentifier()); i.setAlternateIdentifier(Lists.newArrayList(Sets.difference(altIds, pids))); });