code formatting

This commit is contained in:
Claudio Atzori 2023-03-01 10:22:13 +01:00
parent 9c59dac859
commit 16ad42e8f3
1 changed files with 4 additions and 3 deletions

View File

@ -657,12 +657,13 @@ object DataciteToOAFTransformation {
val target = DHPUtils.generateUnresolvedIdentifier(r.relatedIdentifier, r.relatedIdentifierType) val target = DHPUtils.generateUnresolvedIdentifier(r.relatedIdentifier, r.relatedIdentifierType)
relation(id, target, subRelType, r.relationType, date) relation(id, target, subRelType, r.relationType, date)
}) })
val citationRels:List[Relation] = rels val citationRels: List[Relation] = rels
.filter(r => .filter(r =>
(r.relatedIdentifierType.equalsIgnoreCase("doi") || (r.relatedIdentifierType.equalsIgnoreCase("doi") ||
r.relatedIdentifierType.equalsIgnoreCase("pmid") || r.relatedIdentifierType.equalsIgnoreCase("pmid") ||
r.relatedIdentifierType.equalsIgnoreCase("arxiv")) && r.relatedIdentifierType.equalsIgnoreCase("arxiv")) &&
(r.relationType.toLowerCase.contains("cite") || r.relationType.toLowerCase.contains("reference"))) (r.relationType.toLowerCase.contains("cite") || r.relationType.toLowerCase.contains("reference"))
)
.map(r => { .map(r => {
r.relationType match { r.relationType match {
case ModelConstants.CITES | ModelConstants.REFERENCES => case ModelConstants.CITES | ModelConstants.REFERENCES =>
@ -677,7 +678,7 @@ object DataciteToOAFTransformation {
citationRels ::: bidirectionalRels citationRels ::: bidirectionalRels
} }
def relation(source:String, target:String, subRelType:String, relClass:String, date:String): Relation = { def relation(source: String, target: String, subRelType: String, relClass: String, date: String): Relation = {
val rel = new Relation val rel = new Relation
rel.setCollectedfrom(List(DATACITE_COLLECTED_FROM).asJava) rel.setCollectedfrom(List(DATACITE_COLLECTED_FROM).asJava)
rel.setDataInfo(dataInfo) rel.setDataInfo(dataInfo)