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 {
|
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,
|
||||||
|
|
|
@ -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,
|
||||||
|
ModelConstants.DNET_ACCESS_MODES,
|
||||||
|
ModelConstants.DNET_ACCESS_MODES
|
||||||
)
|
)
|
||||||
var finalAlternativeIdentifiers: List[StructuredProperty] = List()
|
instance.setAccessright(access_rights_qualifier)
|
||||||
finalAlternativeIdentifiers = List(alternativeIdentifiers) ::: List(defaultAlternatedIdentifer)
|
|
||||||
instance.setAlternateIdentifier(finalAlternativeIdentifiers.asJava)
|
|
||||||
|
|
||||||
if (exportLinks) {
|
if (exportLinks) {
|
||||||
val rels: List[RelatedIdentifierType] = for {
|
val rels: List[RelatedIdentifierType] = for {
|
||||||
|
|
Loading…
Reference in New Issue