From bdc8f993d0086bf57e024ec9845e024a4ad0b229 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 19 Sep 2022 15:28:03 +0200 Subject: [PATCH] [Patch Hosted By] check also the presence of datasource.officialname.value --- .../dhp/oa/graph/hostedbymap/SparkProduceHostedByMap.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/scala/eu/dnetlib/dhp/oa/graph/hostedbymap/SparkProduceHostedByMap.scala b/dhp-workflows/dhp-graph-mapper/src/main/scala/eu/dnetlib/dhp/oa/graph/hostedbymap/SparkProduceHostedByMap.scala index 781228f79..5a808a505 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/scala/eu/dnetlib/dhp/oa/graph/hostedbymap/SparkProduceHostedByMap.scala +++ b/dhp-workflows/dhp-graph-mapper/src/main/scala/eu/dnetlib/dhp/oa/graph/hostedbymap/SparkProduceHostedByMap.scala @@ -6,6 +6,7 @@ import eu.dnetlib.dhp.common.HdfsSupport import eu.dnetlib.dhp.oa.graph.hostedbymap.model.{DOAJModel, UnibiGoldModel} import eu.dnetlib.dhp.schema.oaf.Datasource import org.apache.commons.io.{FileUtils, IOUtils} +import org.apache.commons.lang3.StringUtils import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.{FileSystem, Path} import org.apache.hadoop.io.compress.GzipCodec @@ -113,7 +114,11 @@ object SparkProduceHostedByMap { } def oaToHostedbyItemType(dats: Datasource): HostedByItemType = { - if (dats.getJournal != null && dats.getOfficialname != null) { + if ( + dats.getJournal != null && dats.getOfficialname != null && + StringUtils.isNotBlank(dats.getOfficialname.getValue) + ) { + return getHostedByItemType( dats.getId, dats.getOfficialname.getValue,