forked from D-Net/dnet-hadoop
mapping bioschema to oaf
This commit is contained in:
parent
446f81ee60
commit
2bc79c50f8
|
@ -42,7 +42,7 @@ object BioschemaToOAFTransformation {
|
||||||
PEDCollectedFrom.setDataInfo(DATA_INFO)
|
PEDCollectedFrom.setDataInfo(DATA_INFO)
|
||||||
|
|
||||||
Map(
|
Map(
|
||||||
"ped" -> PEDCollectedFrom
|
"ped" -> PEDCollectedFrom
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,11 +362,11 @@ object BioschemaToOAFTransformation {
|
||||||
result.setDateofacceptance(OafMapperUtils.field(i_date.get.get, null))
|
result.setDateofacceptance(OafMapperUtils.field(i_date.get.get, null))
|
||||||
result.getInstance().get(0).setDateofacceptance(OafMapperUtils.field(i_date.get.get, null))
|
result.getInstance().get(0).setDateofacceptance(OafMapperUtils.field(i_date.get.get, null))
|
||||||
} else if (publication_year != null) {
|
} else if (publication_year != null) {
|
||||||
result.setDateofacceptance(OafMapperUtils.field(s"01-01-$publication_year", null))
|
result.setDateofacceptance(OafMapperUtils.field(s"01-01-$publication_year", null))
|
||||||
result
|
result
|
||||||
.getInstance()
|
.getInstance()
|
||||||
.get(0)
|
.get(0)
|
||||||
.setDateofacceptance(OafMapperUtils.field(s"01-01-$publication_year", null))
|
.setDateofacceptance(OafMapperUtils.field(s"01-01-$publication_year", null))
|
||||||
}
|
}
|
||||||
|
|
||||||
result.setRelevantdate(
|
result.setRelevantdate(
|
||||||
|
@ -439,18 +439,18 @@ object BioschemaToOAFTransformation {
|
||||||
ModelConstants.DNET_ACCESS_MODES
|
ModelConstants.DNET_ACCESS_MODES
|
||||||
)
|
)
|
||||||
|
|
||||||
instance.setCollectedfrom(collectedFromMap("ped"))
|
instance.setCollectedfrom(collectedFromMap("ped"))
|
||||||
instance.setUrl(List(s"https://proteinensemble.org/$pid").asJava)
|
instance.setUrl(List(s"https://proteinensemble.org/$pid").asJava)
|
||||||
instance.setAccessright(access_rights_qualifier)
|
instance.setAccessright(access_rights_qualifier)
|
||||||
instance.setPid(result.getPid)
|
instance.setPid(result.getPid)
|
||||||
val license = accessRights
|
val license = accessRights
|
||||||
.find(r =>
|
.find(r =>
|
||||||
r.startsWith("http") && r.matches(
|
r.startsWith("http") && r.matches(
|
||||||
".*(/licenses|/publicdomain|unlicense\\.org/|/legal-and-data-protection-notices|/download/license|/open-government-licence).*"
|
".*(/licenses|/publicdomain|unlicense\\.org/|/legal-and-data-protection-notices|/download/license|/open-government-licence).*"
|
||||||
)
|
|
||||||
)
|
)
|
||||||
if (license.isDefined)
|
)
|
||||||
instance.setLicense(OafMapperUtils.field(license.get, null))
|
if (license.isDefined)
|
||||||
|
instance.setLicense(OafMapperUtils.field(license.get, null))
|
||||||
|
|
||||||
val awardUris: List[String] = for {
|
val awardUris: List[String] = for {
|
||||||
JObject(fundingReferences) <- json \\ "fundingReferences"
|
JObject(fundingReferences) <- json \\ "fundingReferences"
|
||||||
|
@ -514,7 +514,7 @@ object BioschemaToOAFTransformation {
|
||||||
rel.setTarget(
|
rel.setTarget(
|
||||||
DHPUtils.generateUnresolvedIdentifier(r.relatedIdentifier, r.relatedIdentifierType)
|
DHPUtils.generateUnresolvedIdentifier(r.relatedIdentifier, r.relatedIdentifierType)
|
||||||
)
|
)
|
||||||
rel.setCollectedfrom(List(collectedFromMap("ped") ).asJava)
|
rel.setCollectedfrom(List(collectedFromMap("ped")).asJava)
|
||||||
rel.getCollectedfrom.asScala.map(c => c.getValue).toList
|
rel.getCollectedfrom.asScala.map(c => c.getValue).toList
|
||||||
rel
|
rel
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue