Commit 085fd90b authored by Günter Hipler's avatar Günter Hipler
Browse files

Merge branch 'master' of...

Merge branch 'master' of gitlab.switch.ch:memoriav/memobase-2020/services/postprocessing/rico-edm-transformer
parents 4e970c5e 23ba1b86
"ID","coordinates"
"aag","47.38787196, 8.049455603"
"abe","46.95089, 7.43706"
"acj","47.41728, 7.07422"
"adg","46.8542, 9.5382"
"afz","47.375219, 8.545961"
"agl","47.04153, 9.06705"
"apf","46.5199, 6.6332"
"atd","46.186235, 8.732027"
"ati","46.192846, 9.0132"
"avl","46.52511, 6.62441"
"azh","47.39077, 8.512219"
"baa","45.86725, 8.98326"
"bab","47.551869, 7.589958"
"bar","46.940555555, 7.446388888"
"baz","47.37237, 8.54582"
"bbb","46.9473, 7.4483"
"bcf","46.8066, 7.15597"
"bfl","46.92833333, 7.45166667"
"bmf","47.5567059, 7.578635"
"bpu","46.9902, 6.9311"
"bvc","47.1042, 6.82634"
"cde","46.19309, 9.01245"
"cdt","46.19908, 6.13594"
"cag","46.1992, 6.1376"
"cic","46.2274, 6.1373"
"clg","46.87994, 8.64185"
"clu","47.10016, 6.8239"
"csa","46.60208, 6.53612"
"fad","46.44019, 8.93677"
"fer","46.1314399, 8.802462"
"fgr","46.85014, 9.53323"
"fpc","46.194709, 9.024187"
"fss","47.4958, 8.7383"
"gvs","46.88057, 8.64469"
"hgk","47.53307, 7.61098"
"hsl","47.07143, 8.27772"
"ias","46.52378, 6.58423"
"ikg","46.85111, 9.533846"
"ikr","46.22169, 6.12565"
"kak","47.3941882, 8.0587246"
"kbg","46.849522222, 9.533855555"
"kek","47.12683, 8.75293"
"khz","47.370278, 8.548056"
"klu","47.04138, 8.310911"
"kmm","47.06376, 7.09299"
"lfg","47.11458, 8.38545"
"lkb","46.94049, 7.44218"
"lmz","47.379166666, 8.539722222"
"maa","47.3944147, 8.0452584"
"mav","46.938154, 7.394621"
"mcl","46.0043, 8.95327"
"mdl","46.38, 6.24018"
"meg","46.197797222, 6.137313888"
"mel","46.509824, 6.632767"
"mem","46.1736, 8.81054"
"mfk","46.94186, 7.45004"
"mgb","46.6167, 7.058596"
"mgz","47.39077, 8.512219"
"mhl","46.5221, 6.63491"
"mov","46.94134, 7.436"
"mws","46.23168, 7.35853"
"raf","47.50045, 8.72527"
"rkk","47.37968, 8.52745"
"rra","47.37845, 8.52948"
"rti","46.00373, 8.9512"
"rtr","46.8520381, 9.5344336"
"rts","46.2, 6.083333333"
"rxb","47.53496, 7.59477"
"sap","46.949135, 7.436426111"
"sbb","47.47540096, 8.205857926"
"sik","47.362485, 8.555264"
"snb","46.941444, 7.449667"
"snp","46.00605, 8.9399"
"son","46.94814, 7.45241"
"soz","47.366827777, 8.547530555"
"srf","47.40146, 8.53547"
"sts","47.6973, 8.6337185"
"swi","46.943487611, 7.473449888"
"ubb","47.5594, 7.5812"
"vks","47.052777777, 8.335833333"
"zbz","47.374166666, 8.545277777"
"zem","46.96684, 7.45468"
\ No newline at end of file
......@@ -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