Commit 0ad2e276 authored by Günter Hipler's avatar Günter Hipler
Browse files

thougts about ES mappings based on principles of search-doc-creation memobase

parent ad34d4d4
Pipeline #22410 passed with stages
in 6 minutes and 41 seconds
curl -XPUT "http://localhost:8080/oai-v1" -H 'Content-Type: application/json' -d'
{
"settings": {
"number_of_replicas": 1,
"number_of_shards": 3
},
"mappings": {
"date_detection": false,
"properties": {
"id": {"type": "keyword"},
"document": {
"type": "keyword",
"index": false
},
"format": {"type": "keyword"},
"published": {"type": "boolean"},
"recordset": {"type": "keyword"},
"lastUpdatedDate": {
"type": "keyword",
"fields": {
"sort": {"type": "date"}
}
}
}
}
}
'
Frage: warum funktioniert index pattern nicht mit curl command
\ No newline at end of file
##es index description for OAI
### id
document identifier
### document
complete record delivered by the OAI API - as starter for memobase only Europeana EDM format
### format
label for the format stored in the document field (for europeana edm)
could be used for oai set purposes
### published
[true|false]
indicator if document should be delivered (harvested) by the OAI API
### recordset
the data the document is part of - don't know if we use this for the API at the moment
### lastUpdatedDate
timestamp necessary for harvesting (from | until)
{
"index_patterns": [
"oai*"
],
"settings": {
"number_of_replicas": 1,
"number_of_shards": 3
},
"mappings": {
"date_detection": false,
"properties": {
"id": {
"type": "keyword"
},
"document": {
"type": "keyword",
"index": false
},
"format": {
"type": "keyword"
},
"published": {
"type": "boolean"
},
"recordset": {
"type": "keyword"
},
"lastUpdatedDate": {
"type": "keyword",
"fields": {
"sort": {
"type": "date"
}
}
}
}
}
}
{
"title": [
{
"de": [],
"fr": [],
"it": [],
"un": ["Fit mit Jack. 8. Serie. 7.-19.07.1975 - Dienstag (8.07.1975?)"]
}
],
"type": {
"name": {
"de": ["Radio"],
"fr": ["Radio"],
"it": ["Radio"],
"un": []
},
"filter": "Radio"
},
"sourceID": "SRDRSSRF_231780",
"abstract": [
{
"de": [],
"fr": [],
"it": [],
"un": ["Jack Günthard leitet Morgengymnastik an. Mit Begleitmusik zu den Übungen: Piano, live gespielt."]
}
],
"scopeAndContent": [
{
"de": [],
"fr": [],
"it": [],
"un": ["Archivierungsort: ZH <br> Daten stammen aus Memobase Vorgängerversion."]
}
],
"rightsHolder": [
{
"de": [],
"fr": [],
"it": [],
"un": ["via SRG SSR idée suisse klären"]
}
],
"conditionsOfUse": [
{
"de": [],
"fr": [],
"it": [],
"un": ["Alle Nutzungen unterliegen der Bewilligung von SRF/SRG."]
}
],
"format": [
{
"displayLabel": {
"de": [],
"fr": [],
"it": [],
"un": ["[Keine Angaben]"]
},
"name": {
"de": ["Keine Angabe"],
"fr": ["Aucune information"],
"it": ["Nessuna informazione"],
"un": []
}
}
],
"genre": [
{
"displayLabel": {
"de": [],
"fr": [],
"it": [],
"un": ["Lehrgang"]
},
"name": {
"de": ["Bildung"],
"fr": ["Éducation"],
"it": ["Educazione"],
"un": []
}
}
],
"keywords": {
"de": [],
"fr": [],
"it": [],
"un": [
"Gymnastik",
"und",
"Turnen"
]
},
"personContributor": [
{
"name": {
"de": [],
"fr": [],
"it": [],
"un": ["Günthard, Jack"]
},
"relation": {
"de": [],
"fr": [],
"it": [],
"un": ["SPR \u2013 Frühturner, ehem. Nationaltrainer der Schweizer Kunstturner"]
},
"filter": "Günthard, Jack",
"facet": [
"0~G~",
"1~G~Günthard, Jack~"
]
},
{
"name": {
"de": [],
"fr": [],
"it": [],
"un": ["Günthard, Jack"]
},
"relation": {
"de": [],
"fr": [],
"it": [],
"un": ["AUT \u2013 Frühturner, ehem. Nationaltrainer der Schweizer Kunstturner"]
},
"filter": "Günthard, Jack",
"facet": [
"0~G~",
"1~G~Günthard, Jack~"
]
}
],
"personsFacet": {
"facet": [
"0~G~",
"1~G~Günthard, Jack~"
],
"filter": ["Günthard, Jack"]
},
"corporateBodyCreator": [
{
"name": {
"de": [],
"fr": [],
"it": [],
"un": ["[Keine Angaben]"]
},
"relation": {
"de": [],
"fr": [],
"it": [],
"un": ["Author"]
}
}
],
"corporateBodyPublisher": [
{
"name": {
"de": [],
"fr": [],
"it": [],
"un": ["[Keine Angaben]"]
}
}
],
"corporateBodyProducer": [
{
"name": {
"de": [],
"fr": [],
"it": [],
"un": ["[Keine Angaben]"]
}
}
],
"placeFacet": {},
"dateIssued": [
{
"date": "1975-07-08",
"sort": "1975-07-08",
"facet": [
"0~20.Jahrhundert~",
"1~20.Jahrhundert~1971-1980~"
]
}
],
"institution": [
{
"name": {
"de": [],
"fr": [],
"it": [],
"un": []
},
"facet": ["srf"]
}
],
"recordSet": {
"name": {
"de": [],
"fr": [],
"it": [],
"un": []
},
"facet": ["srf-027"]
},
"memoriavClaim": true,
"locator": "https://media.memobase.k8s.unibas.ch/memo/srf-027-SRDRSSRF_231780-1",
"accessDigital": [
{
"name": {
"de": ["Faro-Web"],
"fr": ["Faro-Web"],
"it": ["Faro-Web"],
"un": []
},
"filter": "faro"
}
],
"digital": {},
"callNumber": ["ZH_MG_61513_T2"],
"accessPhysical": [
{
"name": {
"de": ["vor Ort"],
"fr": ["Sur place"],
"it": ["Nel local"],
"un": []
},
"filter": "onsite"
}
],
"physicalCharacteristics": [
{
"de": [],
"fr": [],
"it": [],
"un": ["Bemerkung: DAS Archivschluessel: ZH_MG_61513_T2 <br> Archivnummer DRS: MG 61513"]
}
],
"access": [
{
"name": {
"de": ["Faro-Web"],
"fr": ["Faro-Web"],
"it": ["Faro-Web"],
"un": []
},
"filter": "faro"
},
{
"name": {
"de": ["vor Ort"],
"fr": ["Sur place"],
"it": ["Nel local"],
"un": []
},
"filter": "onsite"
}
],
"published": false,
"suggest": {
"title": ["Fit mit Jack. 8. Serie. 7.-19.07.1975 - Dienstag (8.07.1975?)"],
"keywords": [
"und",
"Turnen",
"Gymnastik"
]
},
"id": "srf-027-SRDRSSRF_231780"
}
\ No newline at end of file
......@@ -34,6 +34,9 @@ import scala.collection.mutable.ArrayBuffer
import scala.util.Try
import ujson.{Arr => JArr, Obj => JObj}
import java.util
import scala.jdk.CollectionConverters._
class EDM {
private val edmRdfModel = new EDMRdf4jModel
......@@ -47,7 +50,13 @@ class EDM {
val record = Extractors.record(graph).get
val cho = createChoObject(graph,record,digitalObject)
val choExtraction = createChoObject(graph,record,digitalObject)
val webExtraction = createWebResources(graph,record,digitalObject)
webExtraction.obj.foreach(webResource =>
choExtraction.obj.getModel.addAll(webResource.getModel)
)
//edmRdfModel.serialize(record.toString)
......@@ -75,6 +84,17 @@ class EDM {
ExtractionResult(cho)
}
private def createWebResources(graph: JArr, record: JObj, digitalObject: JObj): ExtractionResult[List[WebResource]] = {
//how many digital objects are part of a document??
val webresource: Option[WebResource] = Extractors.dobjectId(digitalObject).map(new WebResource(_))
val listWebresources = if (webresource.isDefined) {
//todo: add additional properties - to be done
println()
} else {List[WebResource]()}
ExtractionResult( List[WebResource]())
}
}
......
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