Commit 911d8d2e authored by Günter Hipler's avatar Günter Hipler
Browse files

last properties from mapping before starting the discussion with

Europeana
parent 045b5f36
Pipeline #24185 passed with stages
in 7 minutes and 14 seconds
......@@ -16,7 +16,7 @@ Export des topic
kafkacat -C -b mb-ka1:9092 -t fedora-output-json-records -K '\t' -o beginning | gzip > fedora-output1.json.gz
Import des topic
docker run -v /home/swissbib/environment/code/repositories/memoriav/gitlab/services/postprocessing/rico-edm-transformer/data:/data -it --network host edenhill/kafkacat:1.6.0 -P -b VPN:9092 -t fedora-output-json-records -K '\t' -l /data/fedora-output.json
docker run --rm -v /home/swissbib/environment/code/repositories/memoriav/gitlab/services/postprocessing/rico-edm-transformer/data:/data -it --network host edenhill/kafkacat:1.6.0 -P -b VPN:9092 -t fedora-output-json-records -K '\t' -l /data/fedora-output.json
......@@ -24,9 +24,9 @@ export auf mb-ka1
kafkacat -C -b mb-ka1:9092 -t fedora-output-json-records -K '\t' -o beginning > fedora-output1.json
import lokal
docker run -v /home/swissbib/environment/code/repositories/memoriav/gitlab/services/postprocessing/rico-edm-transformer/data:/data -it --network host edenhill/kafkacat:1.6.0 -P -b VPN:9092 -t fedora-output-json-records -K '\t' -l /data/fedora-output1.json
docker run --rm -v /home/swissbib/environment/code/repositories/memoriav/gitlab/services/postprocessing/rico-edm-transformer/data:/data -it --network host edenhill/kafkacat:1.6.0 -P -b VPN:9092 -t fedora-output-json-records -K '\t' -l /data/fedora-output1.json
docker run -it --network host edenhill/kafkacat:1.6.0 -C -b VPN:9092 -t import-process-reporting -K '\t'
docker run --rm -it --network host edenhill/kafkacat:1.6.0 -C -b VPN:9092 -t import-process-reporting -K '\t'
docker run -it --network host edenhill/kafkacat:1.6.0 -C -b VPN:9092 -t import-process-reporting-es | grep FATAL
docker run --rm -it --network host edenhill/kafkacat:1.6.0 -C -b VPN:9092 -t import-process-reporting-es | grep FATAL
......@@ -256,7 +256,10 @@ class EDM {
case None =>
}
Extractors.usageRegulationDigitalObject(graph)(digitalObject.value) match {
case head :: Nil =>aggregation.addRights(Option(head))
case _ =>
}
case _ =>
}
......
......@@ -191,6 +191,9 @@ class Aggregation(private val id: String) {
})
}
def addRights(edmRights:Option[String]): Unit =
edmRights.map(t => model.add(iri(id),EDMVocab.RIGHTS,factory.createLiteral(t)))
def getModel: Model = model
......
......@@ -23,20 +23,19 @@ package ch.memobase.rico2edm.edm
import ch.memobase.Utils
import ch.memobase.Utils.loadFile
import ch.memobase.rico2edm.edm.subjects.Aggregation
import org.eclipse.rdf4j.rio.Rio
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
import ch.memobase.rico2edm.rdf.writer.{RdfXmlWriter => EDMRdfXmlWriter}
import ujson.Value.Value
import scala.collection.mutable
import scala.util.Try
class AggregationSpec extends AnyFunSuite with Matchers {
private lazy val rawRicoIndent = loadFile("src/test/resources/rawIndent.json")
private lazy val rawCertainty = loadFile("src/test/resources/rico.certainty.json")
private lazy val rawNoFoto = loadFile("src/test/resources/rico.duration.json")
private lazy val rawEdmRights = loadFile("src/test/resources/rico.certainty.json")
private def testAggregation = {
val graph = Extractors.jsonGraph(rawRicoIndent).get.arr
......@@ -126,5 +125,15 @@ class AggregationSpec extends AnyFunSuite with Matchers {
}
test ("edm:rights property for aggregation ") {
val graphGet: Value = Extractors.jsonGraph(rawEdmRights).get
val dObj = Extractors.digitalObject(graphGet.arr)
val usage = Extractors.usageRegulationDigitalObject(graphGet.arr)(dObj.get)
assert(usage.head == "http://rightsstatements.org/vocab/CNE/1.0/")
}
}
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