Commit 23ba1b86 authored by Silvia Witzig's avatar Silvia Witzig
Browse files

dcterms:medium extract wikidata URL

parent e8c05a36
Pipeline #24361 passed with stages
in 7 minutes and 28 seconds
......@@ -164,7 +164,7 @@ class EDM {
.dcTermsIssuedTemporal(graph)(record.value)("issued")
.foreach(c => cho.addDcTermsIssued(Some(c)))
Extractors.resourceDCTermsMedium(graph)
Extractors.resourceDCTermsMediumWikidata(graph)
.foreach(c => cho.addDcTermsMedium(Some(c)))
Extractors.dcTermsSpatial(graph)(record.value)
......
......@@ -382,7 +382,19 @@ object Extractors {
})
.flatMap(objectWithEnrichedCarrierType => stringOrArrayValue(objectWithEnrichedCarrierType)("name")("@value")).toList
val resourceDCTermsMediumWikidata
: JArr => List[String] =
graph =>
Extractors.physicalObject(graph).get.arr
.filter(_.obj.contains("hasCarrierType"))
.flatMap((physicalObject: JValue) =>
Extractors.getAllBlankNodeContent(graph)(physicalObject.obj)("hasCarrierType"))
.filter(onlyEnriched => {
//mögliche Variante: contains("sameAs")
//ich gehe davon aus, dass auch resultsFrom das Kennzeichen für den Anreicherungsprozess ist
onlyEnriched.contains("resultsFrom")
})
.flatMap(objectWithEnrichedCarrierType => stringOrArrayValue(objectWithEnrichedCarrierType)("sameAs")("@value")).toList
val dcTermsCreated
: JArr => mutable.LinkedHashMap[String, JValue] => List[String] =
......
......@@ -304,6 +304,22 @@ class CHOSpec extends AnyFunSuite with Matchers{
assert(dcType3.contains("<dc:type>entretien</dc:type>"))
}
test ("cho") {
val graph = Extractors.jsonGraph(ricoPlaceCapture).get.arr
val record = Extractors.record(graph).get.obj
val digObj = Extractors.digitalObject(graph).get
val genres = Extractors.resourceGenres(graph)(record.value)
//println(genres)
val edm = new EDM
val cho = Utils.serializeRDFModel(edm.createChoObject(graph,record,digObj).obj.getModel)
assert(cho.contains("<dc:type>entretien</dc:type>"))
assert(cho.contains("<dcterms:medium>http://www.wikidata.org/entity/Q875215</dcterms:medium>"))
}
......@@ -374,7 +390,7 @@ class CHOSpec extends AnyFunSuite with Matchers{
}
test ("collect dcterms:medium") {
ignore ("collect dcterms:medium") {
val graph = Extractors.jsonGraph(ricoRawContributor).get.arr
val record = Extractors.record(graph).get
val dObj = Extractors.digitalObject(graph).get
......
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