Commit 5ff1ca61 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Add time period as date range.

parent 921b03b0
......@@ -35,7 +35,7 @@ dependencies {
// https://mvnrepository.com/artifact/org.elasticsearch.client/elasticsearch-rest-high-level-client
//compile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-high-level-client', version: '7.1.0'
implementation 'org.memobase:memobase-service-utilities:2.0.2'
implementation 'org.memobase:memobase-service-utilities:2.0.5'
// Logging Framework
implementation "org.apache.logging.log4j:log4j-api:${log4jV}"
......
......@@ -29,6 +29,8 @@ import java.util.Properties
import org.apache.jena.rdf.model.Literal
import org.apache.jena.rdf.model.Model
import org.apache.jena.rdf.model.ModelFactory
import org.apache.jena.rdf.model.Property
import org.apache.jena.rdf.model.RDFNode
import org.apache.jena.rdf.model.Resource
import org.apache.jena.rdf.model.ResourceFactory
import org.apache.logging.log4j.LogManager
......@@ -130,6 +132,15 @@ class RdfTransformer(properties: Properties) {
if (input.computed_teaser_image_url != null)
resource.addProperty(WD.image, literal(input.computed_teaser_image_url))
input.field_time_period.let {
if (it != null) {
val date = model.createResource()
date.addProperty(RDF.type, RICO.DateRange)
date.addProperty(RICO.normalizedDateValue, it)
resource.addProperty(RICO.isAssociatedWithDate, date)
}
}
// rico:scopeAndContent -> Inhalt
// rico:history -> Kontext
// rico:integrity -> Auswahl / Vollständigkeit
......@@ -271,4 +282,11 @@ class RdfTransformer(properties: Properties) {
resource.addProperty(RICO.descriptiveNote, langLiteral(it.value, language))
}
}
private fun addIfNotNull(resource: Resource, field: String?, property: Property, node: RDFNode) {
field.let {
if (it != null)
resource.addProperty(property, node)
}
}
}
\ No newline at end of file
......@@ -35,5 +35,7 @@ data class RecordSet(
val field_metadata_language_codes: List<String>,
val field_institution: List<String>,
val computed_teaser_image_url: String? = null
val computed_teaser_image_url: String? = null,
val field_time_period: String?
) : Input("RecordSet")
\ No newline at end of file
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