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)
|
||||
|
||||
Map(
|
||||
"ped" -> PEDCollectedFrom
|
||||
"ped" -> PEDCollectedFrom
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -362,11 +362,11 @@ object BioschemaToOAFTransformation {
|
|||
result.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) {
|
||||
result.setDateofacceptance(OafMapperUtils.field(s"01-01-$publication_year", null))
|
||||
result
|
||||
.getInstance()
|
||||
.get(0)
|
||||
.setDateofacceptance(OafMapperUtils.field(s"01-01-$publication_year", null))
|
||||
result.setDateofacceptance(OafMapperUtils.field(s"01-01-$publication_year", null))
|
||||
result
|
||||
.getInstance()
|
||||
.get(0)
|
||||
.setDateofacceptance(OafMapperUtils.field(s"01-01-$publication_year", null))
|
||||
}
|
||||
|
||||
result.setRelevantdate(
|
||||
|
@ -439,18 +439,18 @@ object BioschemaToOAFTransformation {
|
|||
ModelConstants.DNET_ACCESS_MODES
|
||||
)
|
||||
|
||||
instance.setCollectedfrom(collectedFromMap("ped"))
|
||||
instance.setUrl(List(s"https://proteinensemble.org/$pid").asJava)
|
||||
instance.setAccessright(access_rights_qualifier)
|
||||
instance.setPid(result.getPid)
|
||||
val license = accessRights
|
||||
.find(r =>
|
||||
r.startsWith("http") && r.matches(
|
||||
".*(/licenses|/publicdomain|unlicense\\.org/|/legal-and-data-protection-notices|/download/license|/open-government-licence).*"
|
||||
)
|
||||
instance.setCollectedfrom(collectedFromMap("ped"))
|
||||
instance.setUrl(List(s"https://proteinensemble.org/$pid").asJava)
|
||||
instance.setAccessright(access_rights_qualifier)
|
||||
instance.setPid(result.getPid)
|
||||
val license = accessRights
|
||||
.find(r =>
|
||||
r.startsWith("http") && r.matches(
|
||||
".*(/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 {
|
||||
JObject(fundingReferences) <- json \\ "fundingReferences"
|
||||
|
@ -514,7 +514,7 @@ object BioschemaToOAFTransformation {
|
|||
rel.setTarget(
|
||||
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
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue