From 576efc1857fb1c96bd9979efa1cf6c8450a8f6bc Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 10 Jun 2024 15:22:33 +0200 Subject: [PATCH] hostedby patching to work with the updated Crossref contents --- .../hostedbymap/SparkApplyHostedByMapToResult.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/scala/eu/dnetlib/dhp/oa/graph/hostedbymap/SparkApplyHostedByMapToResult.scala b/dhp-workflows/dhp-graph-mapper/src/main/scala/eu/dnetlib/dhp/oa/graph/hostedbymap/SparkApplyHostedByMapToResult.scala index 803f95fc1..db7edf53e 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/scala/eu/dnetlib/dhp/oa/graph/hostedbymap/SparkApplyHostedByMapToResult.scala +++ b/dhp-workflows/dhp-graph-mapper/src/main/scala/eu/dnetlib/dhp/oa/graph/hostedbymap/SparkApplyHostedByMapToResult.scala @@ -27,10 +27,12 @@ object SparkApplyHostedByMapToResult { val inst: Instance = i.head patchInstance(p, ei, inst) - } else if (i.size == 2) { - if (i.map(ii => ii.getCollectedfrom.getValue).contains("UnpayWall")) { - val inst: Instance = i.filter(ii => "Crossref".equals(ii.getCollectedfrom.getValue)).head - patchInstance(p, ei, inst) + } else { + val cf = i.map(ii => ii.getCollectedfrom.getValue) + if (cf.contains("Crossref")) { + i.foreach(ii => { + patchInstance(p, ei, ii) + }) } } }