From a2169ccf07d558a6c7143c8e0b543dd76bde6f3c Mon Sep 17 00:00:00 2001 From: Sandro La Bruzzo Date: Tue, 12 Jan 2021 14:42:30 +0100 Subject: [PATCH] // implemented Ticket #6281 added pid to Instance in doiBoost --- .../main/java/eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala | 3 +++ .../src/main/java/eu/dnetlib/doiboost/mag/MagDataModel.scala | 3 +++ .../src/main/java/eu/dnetlib/doiboost/uw/UnpayWallToOAF.scala | 3 +++ 3 files changed, 9 insertions(+) diff --git a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala index 1e52e93c10..79aa7a586e 100644 --- a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala +++ b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala @@ -172,6 +172,9 @@ case object Crossref2Oaf { instance.setLicense(l.head) + // Ticket #6281 added pid to Instance + instance.setPid(result.getPid.asScala.filter(p => p.getQualifier.getClassid.equalsIgnoreCase("doi")).asJava) + val has_review = (json \ "relation" \"has-review" \ "id") if(has_review != JNothing) { 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 e0ff274210..910fad0e20 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 @@ -171,6 +171,9 @@ case object ConversionUtil { else i.setUrl(List(s"https://academic.microsoft.com/#/detail/${extractMagIdentifier(pub.getOriginalId.asScala)}").asJava) + // Ticket #6281 added pid to Instance + i.setPid(pub.getPid.asScala.filter(p => p.getQualifier.getClassid.equalsIgnoreCase("doi")).asJava) + i.setCollectedfrom(createMAGCollectedFrom()) pub.setInstance(List(i).asJava) pub 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 c368c45a36..a26f57f0fc 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 @@ -56,6 +56,9 @@ object UnpayWallToOAF { i.setAccessright(getOpenAccessQualifier()) i.setUrl(List(oaLocation.url.get).asJava) + // Ticket #6281 added pid to Instance + i.setPid(pub.getPid.asScala.filter(p => p.getQualifier.getClassid.equalsIgnoreCase("doi")).asJava) + if (oaLocation.license.isDefined) i.setLicense(asField(oaLocation.license.get)) pub.setInstance(List(i).asJava)