From 33cb483c756808d9fc2363d5b27fdb5eeb35c355 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Fri, 1 Dec 2023 15:03:05 +0100 Subject: [PATCH] using objectSubType as originalType in Crossref2Oaf, code formatting --- .../dhp/datacite/DataciteToOAFTransformation.scala | 10 ++++++---- .../main/scala/eu/dnetlib/dhp/sx/bio/BioDBToOAF.scala | 1 - .../eu/dnetlib/dhp/sx/bio/pubmed/PubMedToOaf.scala | 5 ++--- .../eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/datacite/DataciteToOAFTransformation.scala b/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/datacite/DataciteToOAFTransformation.scala index ee3660918..7603715b9 100644 --- a/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/datacite/DataciteToOAFTransformation.scala +++ b/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/datacite/DataciteToOAFTransformation.scala @@ -176,7 +176,8 @@ object DataciteToOAFTransformation { vocabularies.getSynonymAsQualifier( ModelConstants.DNET_RESULT_TYPOLOGIES, typeQualifier.getClassid - ), resourceType + ), + resourceType ) } if (schemaOrg != null && schemaOrg.nonEmpty) { @@ -188,7 +189,8 @@ object DataciteToOAFTransformation { vocabularies.getSynonymAsQualifier( ModelConstants.DNET_RESULT_TYPOLOGIES, typeQualifier.getClassid - ), schemaOrg + ), + schemaOrg ) } @@ -203,7 +205,8 @@ object DataciteToOAFTransformation { vocabularies.getSynonymAsQualifier( ModelConstants.DNET_RESULT_TYPOLOGIES, typeQualifier.getClassid - ), resourceTypeGeneral + ), + resourceTypeGeneral ) } @@ -228,7 +231,6 @@ object DataciteToOAFTransformation { itm.setVocabularyName(ModelConstants.OPENAIRE_COAR_RESOURCE_TYPES_3_1) i.setInstanceTypeMapping(List(itm).asJava) - typeQualifiers._2.getClassname match { case "dataset" => val r = new OafDataset diff --git a/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/sx/bio/BioDBToOAF.scala b/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/sx/bio/BioDBToOAF.scala index 89bc8d948..df356548a 100644 --- a/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/sx/bio/BioDBToOAF.scala +++ b/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/sx/bio/BioDBToOAF.scala @@ -593,7 +593,6 @@ object BioDBToOAF { itm.setVocabularyName(ModelConstants.OPENAIRE_COAR_RESOURCE_TYPES_3_1) i.setInstanceTypeMapping(List(itm).asJava) - i.setCollectedfrom(collectedFromMap("ebi")) d.setInstance(List(i).asJava) i.setDateofacceptance( diff --git a/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/sx/bio/pubmed/PubMedToOaf.scala b/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/sx/bio/pubmed/PubMedToOaf.scala index f3f8b4f02..d59d73bd0 100644 --- a/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/sx/bio/pubmed/PubMedToOaf.scala +++ b/dhp-workflows/dhp-aggregation/src/main/scala/eu/dnetlib/dhp/sx/bio/pubmed/PubMedToOaf.scala @@ -195,7 +195,7 @@ object PubMedToOaf { pubmedInstance.setInstanceTypeMapping(List(itm).asJava) } else { val i_type = article.getPublicationTypes.asScala - .map(s => (s.getValue,getVocabularyTerm(ModelConstants.DNET_PUBLICATION_RESOURCE, vocabularies, s.getValue))) + .map(s => (s.getValue, getVocabularyTerm(ModelConstants.DNET_PUBLICATION_RESOURCE, vocabularies, s.getValue))) .find(q => q._2 != null) if (i_type.isDefined) { @@ -205,8 +205,7 @@ object PubMedToOaf { itm.setOriginalType(i_type.get._1) itm.setVocabularyName(ModelConstants.OPENAIRE_COAR_RESOURCE_TYPES_3_1) pubmedInstance.setInstanceTypeMapping(List(itm).asJava) - } - else + } else return null } val result = createResult(pubmedInstance.getInstancetype, vocabularies) diff --git a/dhp-workflows/dhp-doiboost/src/main/scala/eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala b/dhp-workflows/dhp-doiboost/src/main/scala/eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala index 65e395357..53576fc10 100644 --- a/dhp-workflows/dhp-doiboost/src/main/scala/eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala +++ b/dhp-workflows/dhp-doiboost/src/main/scala/eu/dnetlib/doiboost/crossref/Crossref2Oaf.scala @@ -107,7 +107,7 @@ case object Crossref2Oaf { .map(f => f.id) } - def mappingResult(result: Result, json: JValue, cobjCategory: String, originalType:String): Result = { + def mappingResult(result: Result, json: JValue, cobjCategory: String, originalType: String): Result = { implicit lazy val formats: DefaultFormats.type = org.json4s.DefaultFormats //MAPPING Crossref DOI into PID @@ -372,7 +372,7 @@ case object Crossref2Oaf { objectType, mappingCrossrefSubType.getOrElse(objectSubType, "0038 Other literature type") ) - mappingResult(result, json, cOBJCategory, originalType) + mappingResult(result, json, cOBJCategory, objectSubType) if (result == null || result.getId == null) return List()