diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscBulkTag.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscBulkTag.java index 99ff92223..24520ff26 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscBulkTag.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscBulkTag.java @@ -117,8 +117,9 @@ public class SparkEoscBulkTag implements Serializable { } private static R enrich(R value, List hostedByList) { - if (value.getInstance().stream().anyMatch(i -> hostedByList.contains(i.getHostedby().getKey())) || - (value.getEoscifguidelines() != null && value.getEoscifguidelines().size() > 0)) { + if (value.getInstance().stream().anyMatch(i -> (hostedByList.contains(i.getHostedby().getKey())) || + (value.getEoscifguidelines() != null && value.getEoscifguidelines().size() > 0)) && + !value.getContext().stream().anyMatch(c -> c.getId().equals("eosc"))) { Context context = new Context(); context.setId("eosc"); context.setDataInfo(Arrays.asList(OafMapperUtils