[Patch Hosted By] check also the presence of datasource.officialname.value

This commit is contained in:
Claudio Atzori 2022-09-19 15:28:03 +02:00
parent ec87149cb3
commit bdc8f993d0
1 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import eu.dnetlib.dhp.common.HdfsSupport
import eu.dnetlib.dhp.oa.graph.hostedbymap.model.{DOAJModel, UnibiGoldModel} import eu.dnetlib.dhp.oa.graph.hostedbymap.model.{DOAJModel, UnibiGoldModel}
import eu.dnetlib.dhp.schema.oaf.Datasource import eu.dnetlib.dhp.schema.oaf.Datasource
import org.apache.commons.io.{FileUtils, IOUtils} import org.apache.commons.io.{FileUtils, IOUtils}
import org.apache.commons.lang3.StringUtils
import org.apache.hadoop.conf.Configuration import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path} import org.apache.hadoop.fs.{FileSystem, Path}
import org.apache.hadoop.io.compress.GzipCodec import org.apache.hadoop.io.compress.GzipCodec
@ -113,7 +114,11 @@ object SparkProduceHostedByMap {
} }
def oaToHostedbyItemType(dats: Datasource): HostedByItemType = { 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( return getHostedByItemType(
dats.getId, dats.getId,
dats.getOfficialname.getValue, dats.getOfficialname.getValue,