Commit 560d5d54 authored by Jonas Waeber's avatar Jonas Waeber

Add conditionsOfUse for record based conditions.

parent 1861f94c
Pipeline #20627 failed with stages
in 4 minutes and 48 seconds
......@@ -214,14 +214,14 @@ class DocumentsSearchDocBuilder(
"NoSourceIdFound"
},
sameAs = Extract.listOfStrings(record["sameAs"]),
abstract = Extract.languageContainer("abstract", record["abstract"]),
abstract = Extract.languageContainer("abstract (record id: $key)", record["abstract"]),
recordId = key,
institution = extractInstitution(record),
recordSet = extractRecordSet(record),
descriptiveNote = Extract.languageContainer("descriptiveNote", record["descriptiveNote"]),
scopeAndContent = Extract.languageContainer("scopeAndContent", record["scopeAndContent"]),
relatedMaterial = Extract.languageContainer("relation", record["relation"]),
source = Extract.languageContainer("source", record["source"]),
descriptiveNote = Extract.languageContainer("descriptiveNote (record id: $key)", record["descriptiveNote"]),
scopeAndContent = Extract.languageContainer("scopeAndContent (record id: $key)", record["scopeAndContent"]),
relatedMaterial = Extract.languageContainer("relation (record id: $key)", record["relation"]),
source = Extract.languageContainer("source (record id: $key)", record["source"]),
temporal = temporalBuilder.build(),
dateCreated = dateCreatedBuilder.build(),
dateIssued = dateIssuedBuilder.build(),
......@@ -229,13 +229,14 @@ class DocumentsSearchDocBuilder(
placeRelated = placesRelatedBuilder.build(),
placeFacet = placeFacetBuilder.build(),
rightsHolder = Extract.typedEntityByType(recordRules, "type", "holder", "name"),
memoriavClaim = record["P60451"] != null,
conditionsOfUse = Extract.languageContainer("conditionsOfUse (record id: $key)", record[KEYS.conditionsOfUse]),
memoriavClaim = record[KEYS.sponsoredBy] != null,
format = formats.build(),
language = languages.build(),
genre = genres.build(),
keywords = subjects.flatMap { Extract.languageContainer("hasSubject", it[KEYS.prefLabel]) }.let {
keywords = subjects.flatMap { Extract.languageContainer("hasSubject (record id: $key)", it[KEYS.prefLabel]) }.let {
if (it.isEmpty())
LanguageContainer.EMPTY
else
......@@ -268,7 +269,7 @@ class DocumentsSearchDocBuilder(
// DIGITAL
accessDigital = accessDigital,
durationDigital = Extract.listOfStrings(digitalObject?.get("duration")),
colourDigital = Extract.listOfStrings(digitalObject?.get("P60558")),
colourDigital = Extract.listOfStrings(digitalObject?.get(KEYS.color)),
digitalObjectNote = Extract.languageContainer("descriptiveNote", digitalObject?.get("descriptiveNote")),
locator = locator,
usageConditionsDigital = Extract.languageContainer(
......
......@@ -60,7 +60,7 @@ object Extract {
un = emptyList()
)
else -> {
log.error("Could not extract language container from subEntity $subEntity in entity $entity.")
log.error("Invalid structure in $subEntity for $parent.")
null
}
}
......@@ -68,11 +68,11 @@ object Extract {
acc.merge(languageContainer)
})
null -> {
log.info("No items in $parent found.")
log.info("No values for key $parent.")
emptyList()
}
else -> {
log.error("Could not extract language container from entity: $entity in parent $parent.")
log.error("No values for key $parent.")
emptyList()
}
}
......
......@@ -35,6 +35,7 @@ object KEYS {
const val institutionIndex = "elastic.institutionIndex"
}
const val conditionsOfUse = "conditionsOfUse"
const val isAssociatedWithDate = "isAssociatedWithDate"
const val normalizedDateValue = "normalizedDateValue"
const val sameAs = "sameAs"
......@@ -83,6 +84,7 @@ object KEYS {
const val placeOfCapture = "P60556"
const val producer = "P60441"
const val sponsoredBy = "P60451"
const val color = "P60558"
// namespace skos:
const val prefLabel = "prefLabel"
......
......@@ -40,6 +40,7 @@ data class DocumentsSearchDoc(
val source: List<LanguageContainer>,
val relatedMaterial: List<LanguageContainer>,
val rightsHolder: List<LanguageContainer>,
val conditionsOfUse: List<LanguageContainer>,
val sameAs: List<String>,
// Concepts
......@@ -78,6 +79,7 @@ data class DocumentsSearchDoc(
val dateCreated: List<DateContainer>,
val dateIssued: List<DateContainer>,
// Relations
val institution: List<FacetContainer>,
val recordSet: FacetContainer,
......@@ -141,6 +143,7 @@ data class DocumentsSearchDoc(
emptyList(),
emptyList(),
emptyList(),
emptyList(),
LanguageContainer.EMPTY,
emptyList(),
emptyList(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment