WIP: Graph footprint optimisation #287

Draft
claudio.atzori wants to merge 39 commits from ticket_8369 into beta
1 changed files with 15 additions and 53 deletions
Showing only changes of commit 606cada7a4 - Show all commits

View File

@ -138,12 +138,11 @@ object DoiBoostMappingUtil {
result result
} }
def decideAccessRight(lic: Field[String], date: String): AccessRight = { def decideAccessRight(license: String, date: String): AccessRight = {
if (lic == null) { if (license == null || license.isEmpty) {
//Default value Unknown //Default value Unknown
return getUnknownQualifier() return getUnknownQualifier()
} }
val license: String = lic.getValue
//CC licenses //CC licenses
if ( if (
license.startsWith("cc") || license.startsWith("cc") ||
@ -305,7 +304,7 @@ object DoiBoostMappingUtil {
} }
def generateDataInfo(): DataInfo = { def generateDataInfo(): DataInfo = {
generateDataInfo("0.9") generateDataInfo(0.9F)
} }
def filterPublication(publication: Publication): Boolean = { def filterPublication(publication: Publication): Boolean = {
@ -330,7 +329,7 @@ object DoiBoostMappingUtil {
// fixes #4360 (test publisher) // fixes #4360 (test publisher)
val publisher = val publisher =
if (publication.getPublisher != null) publication.getPublisher.getValue else null if (publication.getPublisher != null) publication.getPublisher.getName else null
if ( if (
publisher != null && (publisher.equalsIgnoreCase("Test accounts") || publisher publisher != null && (publisher.equalsIgnoreCase("Test accounts") || publisher
@ -358,7 +357,7 @@ object DoiBoostMappingUtil {
// fixes #4368 // fixes #4368
if ( if (
authors.count(s => s.equalsIgnoreCase("Addie Jackson")) > 0 && "Elsevier BV".equalsIgnoreCase( authors.count(s => s.equalsIgnoreCase("Addie Jackson")) > 0 && "Elsevier BV".equalsIgnoreCase(
publication.getPublisher.getValue publication.getPublisher.getName
) )
) )
return false return false
@ -374,8 +373,8 @@ object DoiBoostMappingUtil {
true true
} }
def generateDataInfo(trust: String): DataInfo = { def generateDataInfo(trust: Float): DataInfo = {
val di = new DataInfo val di = new EntityDataInfo
di.setDeletedbyinference(false) di.setDeletedbyinference(false)
di.setInferred(false) di.setInferred(false)
di.setInvisible(false) di.setInvisible(false)
@ -384,8 +383,8 @@ object DoiBoostMappingUtil {
OafMapperUtils.qualifier( OafMapperUtils.qualifier(
ModelConstants.SYSIMPORT_ACTIONSET, ModelConstants.SYSIMPORT_ACTIONSET,
ModelConstants.SYSIMPORT_ACTIONSET, ModelConstants.SYSIMPORT_ACTIONSET,
ModelConstants.DNET_PROVENANCE_ACTIONS,
ModelConstants.DNET_PROVENANCE_ACTIONS ModelConstants.DNET_PROVENANCE_ACTIONS
) )
) )
di di
@ -393,7 +392,7 @@ object DoiBoostMappingUtil {
def createSubject(value: String, classId: String, schemeId: String): Subject = { def createSubject(value: String, classId: String, schemeId: String): Subject = {
val s = new Subject val s = new Subject
s.setQualifier(OafMapperUtils.qualifier(classId, classId, schemeId, schemeId)) s.setQualifier(OafMapperUtils.qualifier(classId, classId, schemeId))
s.setValue(value) s.setValue(value)
s s
@ -403,67 +402,37 @@ object DoiBoostMappingUtil {
value: String, value: String,
classId: String, classId: String,
className: String, className: String,
schemeId: String, schemeId: String
schemeName: String
): Subject = { ): Subject = {
val s = new Subject val s = new Subject
s.setQualifier(OafMapperUtils.qualifier(classId, className, schemeId, schemeName)) s.setQualifier(OafMapperUtils.qualifier(classId, className, schemeId))
s.setValue(value) s.setValue(value)
s s
} }
def createSP(
value: String,
classId: String,
className: String,
schemeId: String,
schemeName: String
): StructuredProperty = {
val sp = new StructuredProperty
sp.setQualifier(OafMapperUtils.qualifier(classId, className, schemeId, schemeName))
sp.setValue(value)
sp
}
def createSP( def createSP(
value: String, value: String,
classId: String, classId: String,
className: String, className: String,
schemeId: String, schemeId: String
schemeName: String,
dataInfo: DataInfo
): StructuredProperty = { ): StructuredProperty = {
val sp = new StructuredProperty val sp = new StructuredProperty
sp.setQualifier(OafMapperUtils.qualifier(classId, className, schemeId, schemeName)) sp.setQualifier(OafMapperUtils.qualifier(classId, className, schemeId))
sp.setValue(value) sp.setValue(value)
sp.setDataInfo(dataInfo)
sp sp
} }
def createSP(value: String, classId: String, schemeId: String): StructuredProperty = { def createSP(value: String, classId: String, schemeId: String): StructuredProperty = {
val sp = new StructuredProperty val sp = new StructuredProperty
sp.setQualifier(OafMapperUtils.qualifier(classId, classId, schemeId, schemeId)) sp.setQualifier(OafMapperUtils.qualifier(classId, classId, schemeId))
sp.setValue(value) sp.setValue(value)
sp sp
} }
def createSP(
value: String,
classId: String,
schemeId: String,
dataInfo: DataInfo
): StructuredProperty = {
val sp = new StructuredProperty
sp.setQualifier(OafMapperUtils.qualifier(classId, classId, schemeId, schemeId))
sp.setValue(value)
sp.setDataInfo(dataInfo)
sp
}
def createCrossrefCollectedFrom(): KeyValue = { def createCrossrefCollectedFrom(): KeyValue = {
@ -506,13 +475,6 @@ object DoiBoostMappingUtil {
} }
def asField[T](value: T): Field[T] = {
val tmp = new Field[T]
tmp.setValue(value)
tmp
}
def isEmpty(x: String) = x == null || x.trim.isEmpty def isEmpty(x: String) = x == null || x.trim.isEmpty
def normalizeDoi(input: String): String = { def normalizeDoi(input: String): String = {