forked from D-Net/dnet-hadoop
Compare commits
4 Commits
41de8fb785
...
33dcf9964c
Author | SHA1 | Date |
---|---|---|
Enrico Ottonello | 33dcf9964c | |
Enrico Ottonello | 792e78e848 | |
Enrico Ottonello | aef88f9e5c | |
Enrico Ottonello | f6c37656c9 |
|
@ -62,7 +62,7 @@ class BioschemaModelConstants extends Serializable {}
|
|||
object BioschemaModelConstants {
|
||||
|
||||
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(
|
||||
false,
|
||||
|
|
|
@ -195,6 +195,8 @@ object BioschemaToOAFTransformation {
|
|||
throw new RuntimeException("Url not found")
|
||||
}
|
||||
instance.setCollectedfrom(collectedFromMap(datasourceKey))
|
||||
instance.setHostedby(collectedFromMap(datasourceKey))
|
||||
|
||||
instance.setPid(result.getPid)
|
||||
|
||||
result.setId(IdentifierFactory.createIdentifier(result))
|
||||
|
@ -211,6 +213,7 @@ object BioschemaToOAFTransformation {
|
|||
val alternativeIdentifierUrl: AlternateIdentifierType = alternativeIdentifierUrls.asJava.get(0)
|
||||
|
||||
val alternativeIdentifiers = resolvedURLPattern
|
||||
.filter(pattern => !pattern._1.contains(datasourceKey))
|
||||
.map(pattern => {
|
||||
if (alternativeIdentifierUrl.alternateIdentifier.startsWith(s"${pattern._1}")) {
|
||||
val relatedId = StringUtils.substringAfter(alternativeIdentifierUrl.alternateIdentifier, s"${pattern._1}")
|
||||
|
@ -226,19 +229,19 @@ object BioschemaToOAFTransformation {
|
|||
null
|
||||
})
|
||||
.find(s => s != null)
|
||||
.get
|
||||
|
||||
val defaultAlternatedIdentifer: StructuredProperty = OafMapperUtils.structuredProperty(
|
||||
pid,
|
||||
datasourceKey,
|
||||
datasourceKey,
|
||||
ModelConstants.DNET_PID_TYPES,
|
||||
ModelConstants.DNET_PID_TYPES,
|
||||
dataInfo
|
||||
)
|
||||
var finalAlternativeIdentifiers: List[StructuredProperty] = List()
|
||||
finalAlternativeIdentifiers = List(alternativeIdentifiers) ::: List(defaultAlternatedIdentifer)
|
||||
instance.setAlternateIdentifier(finalAlternativeIdentifiers.asJava)
|
||||
if (alternativeIdentifiers.isDefined) {
|
||||
instance.setAlternateIdentifier(List(alternativeIdentifiers.get).asJava)
|
||||
}
|
||||
|
||||
val access_rights_qualifier =
|
||||
OafMapperUtils.accessRight(
|
||||
ModelConstants.UNKNOWN,
|
||||
ModelConstants.NOT_AVAILABLE,
|
||||
ModelConstants.DNET_ACCESS_MODES,
|
||||
ModelConstants.DNET_ACCESS_MODES
|
||||
)
|
||||
instance.setAccessright(access_rights_qualifier)
|
||||
|
||||
if (exportLinks) {
|
||||
val rels: List[RelatedIdentifierType] = for {
|
||||
|
|
Loading…
Reference in New Issue