Commit 246c7cc1 authored by Silvia Witzig's avatar Silvia Witzig
Browse files

add placeOfCapture to dcterms:spatial

parent 7756ace7
Pipeline #24222 passed with stages
in 7 minutes and 16 seconds
......@@ -169,6 +169,9 @@ class EDM {
Extractors.dcTermsSpatial(graph)(record.value)
.foreach(c => cho.addDcTermsSpatial(Some(c)))
Extractors.dcTermsSpatialCapture(graph)(record.value)
.foreach(c => cho.addDcTermsSpatial(Some(c)))
Extractors.dcTermsIssuedTemporal(graph)(record.value)("temporal")
.foreach(c => cho.addDcTermsTemporal(Some(c)))
......
......@@ -418,7 +418,7 @@ object Extractors {
}
//todo: multiple property - abwarten Silvia macht!!!
val dcTermsSpatial
: JArr => mutable.LinkedHashMap[String, JValue] => List[String] =
graph =>
......@@ -432,6 +432,20 @@ object Extractors {
}.toList
val dcTermsSpatialCapture
: JArr => mutable.LinkedHashMap[String, JValue] => List[String] =
graph =>
record =>
getAllBlankNodeContent(graph)(record)("P60556")
.collect {
case placeObject
if placeObject.contains("@type") &&
placeObject("@type").str == "https://www.ica.org/standards/RiC/ontology#Place" &&
placeObject.contains("name") => placeObject("name").str
}.toList
//todo: @Günter, das kann nicht funktionieren. Bei temporal gibt es kein Place.
val dcTermsTemporal
: JArr => mutable.LinkedHashMap[String, JValue] => List[String] =
graph =>
......
This diff is collapsed.
......@@ -38,6 +38,7 @@ class CHOSpec extends AnyFunSuite with Matchers{
private lazy val ricoRegulatedBy = loadFile("src/test/resources/rico.regulatedBy.json")
private lazy val ricoNoSourceInRecord = loadFile("src/test/resources/raw2.indent.json")
private lazy val ricoPlaceCapture = loadFile("src/test/resources/fuer.silvia.json")
private lazy val ricoCertainty = loadFile("src/test/resources/rico.certainty.json")
private lazy val ricoDuration = loadFile("src/test/resources/rico.duration.json")
......@@ -291,6 +292,11 @@ class CHOSpec extends AnyFunSuite with Matchers{
val spatials = Extractors.dcTermsSpatial(graph)(record)
assert(spatials.length == 2 && spatials.head == "Madrid" && spatials(1) == "Spagna" )
val graph2 = Extractors.jsonGraph(ricoPlaceCapture).get.arr
val record2 = Extractors.record(graph2).get
val spatialsCapture = Extractors.dcTermsSpatialCapture(graph2)(record2)
assert(spatialsCapture.length == 1 && spatialsCapture.head == "Genève" )
}
test ("collect dcterms:temporal") {
......
Supports Markdown
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