Compare commits

...

4 Commits

2 changed files with 16 additions and 13 deletions

View File

@ -62,7 +62,7 @@ class BioschemaModelConstants extends Serializable {}
object BioschemaModelConstants { object BioschemaModelConstants {
val PROTEIN_RESOURCETYPE: Qualifier = val PROTEIN_RESOURCETYPE: Qualifier =
qualifier("0047", "Protein", ModelConstants.DNET_PUBLICATION_RESOURCE, ModelConstants.DNET_PUBLICATION_RESOURCE) qualifier("0046", "Bioentity", ModelConstants.DNET_PUBLICATION_RESOURCE, ModelConstants.DNET_PUBLICATION_RESOURCE)
val DATA_INFO: DataInfo = OafMapperUtils.dataInfo( val DATA_INFO: DataInfo = OafMapperUtils.dataInfo(
false, false,

View File

@ -195,6 +195,8 @@ object BioschemaToOAFTransformation {
throw new RuntimeException("Url not found") throw new RuntimeException("Url not found")
} }
instance.setCollectedfrom(collectedFromMap(datasourceKey)) instance.setCollectedfrom(collectedFromMap(datasourceKey))
instance.setHostedby(collectedFromMap(datasourceKey))
instance.setPid(result.getPid) instance.setPid(result.getPid)
result.setId(IdentifierFactory.createIdentifier(result)) result.setId(IdentifierFactory.createIdentifier(result))
@ -211,6 +213,7 @@ object BioschemaToOAFTransformation {
val alternativeIdentifierUrl: AlternateIdentifierType = alternativeIdentifierUrls.asJava.get(0) val alternativeIdentifierUrl: AlternateIdentifierType = alternativeIdentifierUrls.asJava.get(0)
val alternativeIdentifiers = resolvedURLPattern val alternativeIdentifiers = resolvedURLPattern
.filter(pattern => !pattern._1.contains(datasourceKey))
.map(pattern => { .map(pattern => {
if (alternativeIdentifierUrl.alternateIdentifier.startsWith(s"${pattern._1}")) { if (alternativeIdentifierUrl.alternateIdentifier.startsWith(s"${pattern._1}")) {
val relatedId = StringUtils.substringAfter(alternativeIdentifierUrl.alternateIdentifier, s"${pattern._1}") val relatedId = StringUtils.substringAfter(alternativeIdentifierUrl.alternateIdentifier, s"${pattern._1}")
@ -226,19 +229,19 @@ object BioschemaToOAFTransformation {
null null
}) })
.find(s => s != null) .find(s => s != null)
.get
val defaultAlternatedIdentifer: StructuredProperty = OafMapperUtils.structuredProperty( if (alternativeIdentifiers.isDefined) {
pid, instance.setAlternateIdentifier(List(alternativeIdentifiers.get).asJava)
datasourceKey, }
datasourceKey,
ModelConstants.DNET_PID_TYPES, val access_rights_qualifier =
ModelConstants.DNET_PID_TYPES, OafMapperUtils.accessRight(
dataInfo ModelConstants.UNKNOWN,
) ModelConstants.NOT_AVAILABLE,
var finalAlternativeIdentifiers: List[StructuredProperty] = List() ModelConstants.DNET_ACCESS_MODES,
finalAlternativeIdentifiers = List(alternativeIdentifiers) ::: List(defaultAlternatedIdentifer) ModelConstants.DNET_ACCESS_MODES
instance.setAlternateIdentifier(finalAlternativeIdentifiers.asJava) )
instance.setAccessright(access_rights_qualifier)
if (exportLinks) { if (exportLinks) {
val rels: List[RelatedIdentifierType] = for { val rels: List[RelatedIdentifierType] = for {