From 8b8ffe82dcf81fa5858b049773064023360d1fd5 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Tue, 29 Jun 2021 18:41:39 +0200 Subject: [PATCH] added step of normalization for the doi --- .../main/java/eu/dnetlib/doiboost/uw/UnpayWallToOAF.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/uw/UnpayWallToOAF.scala b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/uw/UnpayWallToOAF.scala index a7f97aaf80..cc758bcae3 100644 --- a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/uw/UnpayWallToOAF.scala +++ b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/uw/UnpayWallToOAF.scala @@ -3,6 +3,7 @@ package eu.dnetlib.doiboost.uw import eu.dnetlib.dhp.schema.common.ModelConstants import eu.dnetlib.dhp.schema.oaf.utils.IdentifierFactory import eu.dnetlib.dhp.schema.oaf.{AccessRight, Instance, OpenAccessRoute, Publication} +import eu.dnetlib.doiboost.DoiBoostMappingUtil import org.json4s import org.json4s.DefaultFormats import org.json4s.jackson.JsonMethods.parse @@ -53,7 +54,10 @@ object UnpayWallToOAF { implicit lazy val formats: DefaultFormats.type = org.json4s.DefaultFormats lazy val json: json4s.JValue = parse(input) - val doi = (json \"doi").extract[String] + val doi = DoiBoostMappingUtil.normalizeDoi((json \"doi").extract[String]) + + if(doi == null) + return null val is_oa = (json\ "is_oa").extract[Boolean]