Commit 53f2ff32 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 44ab0238 3541d049
Pipeline #24501 failed with stages
in 1 minute and 20 seconds
...@@ -107,7 +107,7 @@ class EDM { ...@@ -107,7 +107,7 @@ class EDM {
cho.addDescription(Extractors.dctAbstract(record)) cho.addDescription(Extractors.dctAbstract(record))
cho.addDescription(Extractors.scopeAndContent(record)) cho.addDescription(Extractors.scopeAndContent(record))
cho.addDescription(Extractors.descriptiveNote(record)) cho.addDescription(Extractors.descriptiveNote(record))
cho.addCreationDate(Extractors.creationDate(graph)(record.obj)) //cho.addCreationDate(Extractors.creationDate(graph)(record.obj))
//todo: nur name c._1 hächst wahrscheinlich weg!!! //todo: nur name c._1 hächst wahrscheinlich weg!!!
......
...@@ -324,6 +324,24 @@ object Extractors { ...@@ -324,6 +324,24 @@ object Extractors {
case Some(s) => Some(s) case Some(s) => Some(s)
case None => None case None => None
} }
).toList :::
getAllBlankNodeContent(graph)(record)("hasSubject")
.filter(obj =>
obj("@type").str == """https://www.ica.org/standards/RiC/ontology#Person""")
.flatMap(v =>
stringValue(v)("name") match {
case Some(s) => Some(s)
case None => None
}
).toList :::
getAllBlankNodeContent(graph)(record)("hasSubject")
.filter(obj =>
obj("@type").str == """https://www.ica.org/standards/RiC/ontology#CorporateBody""")
.flatMap(v =>
stringValue(v)("name") match {
case Some(s) => Some(s)
case None => None
}
).toList ).toList
......
...@@ -43,8 +43,8 @@ class ProvidedCHO (val id: String) { ...@@ -43,8 +43,8 @@ class ProvidedCHO (val id: String) {
title.map(t => model.add(iri(id),DC.TITLE,factory.createLiteral(t))) title.map(t => model.add(iri(id),DC.TITLE,factory.createLiteral(t)))
} }
def addCreationDate(createDate:Option[String]): Unit = //def addCreationDate(createDate:Option[String]): Unit =
createDate.map(t => model.add(iri(id),DC.DATE,factory.createLiteral(t))) // createDate.map(t => model.add(iri(id),DC.DATE,factory.createLiteral(t)))
def addCreator(creator:Option[String]): Unit = def addCreator(creator:Option[String]): Unit =
creator.map(t => model.add(iri(id),DC.CREATOR,factory.createLiteral(t))) creator.map(t => model.add(iri(id),DC.CREATOR,factory.createLiteral(t)))
......
...@@ -338,6 +338,7 @@ class CHOSpec extends AnyFunSuite with Matchers{ ...@@ -338,6 +338,7 @@ class CHOSpec extends AnyFunSuite with Matchers{
val cho = Utils.serializeRDFModel(edm.createChoObject(graph,record,digObj).obj.getModel) val cho = Utils.serializeRDFModel(edm.createChoObject(graph,record,digObj).obj.getModel)
assert(cho.contains("<dc:type>entretien</dc:type>")) assert(cho.contains("<dc:type>entretien</dc:type>"))
assert(cho.contains("<dcterms:medium>http://www.wikidata.org/entity/Q875215</dcterms:medium>")) assert(cho.contains("<dcterms:medium>http://www.wikidata.org/entity/Q875215</dcterms:medium>"))
assert(cho.contains("<dc:subject>Benno Besson</dc:subject>"))
} }
......
...@@ -63,7 +63,7 @@ class ExtractorSpec extends AnyFunSuite with Matchers{ ...@@ -63,7 +63,7 @@ class ExtractorSpec extends AnyFunSuite with Matchers{
temporal und issued nutzt Sebastian in IIIF nicht temporal und issued nutzt Sebastian in IIIF nicht
ich habe das im Beispielrecord auch noch nicht gesehen - gibt es das? ich habe das im Beispielrecord auch noch nicht gesehen - gibt es das?
*/ */
cho.addCreationDate(Extractors.creationDate(graph)(record)) // cho.addCreationDate(Extractors.creationDate(graph)(record))
Extractors Extractors
.resourceSourceOfRelationCreation(graph)(record.value)("creator") .resourceSourceOfRelationCreation(graph)(record.value)("creator")
......
...@@ -90,7 +90,7 @@ class ExtractorSpecWebResource extends AnyFunSuite with Matchers { ...@@ -90,7 +90,7 @@ class ExtractorSpecWebResource extends AnyFunSuite with Matchers {
temporal und issued nutzt Sebastian in IIIF nicht temporal und issued nutzt Sebastian in IIIF nicht
ich habe das im Beispielrecord auch noch nicht gesehen - gibt es das? ich habe das im Beispielrecord auch noch nicht gesehen - gibt es das?
*/ */
cho.addCreationDate(Extractors.creationDate(graph.arr)(record)) // cho.addCreationDate(Extractors.creationDate(graph.arr)(record))
webresource.get.getModel.addAll(cho.getModel) webresource.get.getModel.addAll(cho.getModel)
assert(Utils.serializeRDFModel(cho.getModel).contains("<dc:description>Veduta dell'albergo</dc:description>")) assert(Utils.serializeRDFModel(cho.getModel).contains("<dc:description>Veduta dell'albergo</dc:description>"))
......
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