From 801763a0fa854ba5bb74d6b4c2c958089f2d8f70 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Tue, 29 Jun 2021 19:07:23 +0200 Subject: [PATCH] there is no more the need to lower case the doi since it is done in the first step. Also changed the creation of the id by using the factory --- .../eu/dnetlib/doiboost/mag/MagDataModel.scala | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/mag/MagDataModel.scala b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/mag/MagDataModel.scala index e8c283a7a2..fd96290242 100644 --- a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/mag/MagDataModel.scala +++ b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/mag/MagDataModel.scala @@ -196,8 +196,8 @@ case object ConversionUtil { val authors = inputParams._2 val pub = new Publication - pub.setPid(List(createSP(paper.Doi.toLowerCase, "doi", ModelConstants.DNET_PID_TYPES)).asJava) - pub.setOriginalId(List(paper.PaperId.toString, paper.Doi.toLowerCase).asJava) + pub.setPid(List(createSP(paper.Doi, "doi", ModelConstants.DNET_PID_TYPES)).asJava) + pub.setOriginalId(List(paper.PaperId.toString, paper.Doi).asJava) //IMPORTANT //The old method result.setId(generateIdentifier(result, doi)) @@ -258,11 +258,14 @@ case object ConversionUtil { val description = inputParams._2 val pub = new Publication - pub.setPid(List(createSP(paper.Doi.toLowerCase, "doi", ModelConstants.DNET_PID_TYPES)).asJava) - pub.setOriginalId(List(paper.PaperId.toString, paper.Doi.toLowerCase).asJava) + pub.setPid(List(createSP(paper.Doi, "doi", ModelConstants.DNET_PID_TYPES)).asJava) + pub.setOriginalId(List(paper.PaperId.toString, paper.Doi).asJava) - //Set identifier as 50 | doiboost____::md5(DOI) - pub.setId(generateIdentifier(pub, paper.Doi.toLowerCase)) + //IMPORTANT + //The old method result.setId(generateIdentifier(result, doi)) + //will be replaced using IdentifierFactory + + pub.setId(IdentifierFactory.createDOIBoostIdentifier(pub)) val mainTitles = createSP(paper.PaperTitle, "main title", ModelConstants.DNET_DATACITE_TITLE) val originalTitles = createSP(paper.OriginalTitle, "alternative title", ModelConstants.DNET_DATACITE_TITLE)