From 0892cad4e86cab1fdbdcf9a48bd2b26669cce8a1 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Mon, 5 Jul 2021 16:21:42 +0200 Subject: [PATCH] the normalization of the content of value was not visible outside the block. Moved doi normalization operation while returning value --- .../main/java/eu/dnetlib/doiboost/orcid/ORCIDToOAF.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/ORCIDToOAF.scala b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/ORCIDToOAF.scala index 0f6dc4885..1cd3f7028 100644 --- a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/ORCIDToOAF.scala +++ b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/ORCIDToOAF.scala @@ -83,9 +83,8 @@ object ORCIDToOAF { JObject(extIds) <- json \ "workDetail" \"extIds" JField("type", JString(typeValue)) <- extIds JField("value", JString(value)) <- extIds - normalized_value: String = DoiBoostMappingUtil.normalizeDoi(value) - if "doi".equalsIgnoreCase(typeValue) && normalized_value != null - } yield (typeValue, normalized_value) + if "doi".equalsIgnoreCase(typeValue) + } yield (typeValue, DoiBoostMappingUtil.normalizeDoi(value)) if (doi.nonEmpty) { return doi.map(l =>OrcidWork(oid, l._2)) } @@ -103,7 +102,7 @@ object ORCIDToOAF { def convertTOOAF(input:ORCIDItem) :Publication = { val doi = input.doi val pub:Publication = new Publication - pub.setPid(List(createSP(doi.toLowerCase, "doi", ModelConstants.DNET_PID_TYPES)).asJava) + pub.setPid(List(createSP(doi, "doi", ModelConstants.DNET_PID_TYPES)).asJava) pub.setDataInfo(generateDataInfo()) pub.setId(IdentifierFactory.createDOIBoostIdentifier(pub))