Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
postprocessing
rico-edm-transformer
Commits
0ad2e276
Commit
0ad2e276
authored
Feb 26, 2021
by
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
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gh/create.index.json.tool.txt
0 → 100644
View file @
0ad2e276
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
gh/es.index.description.md
0 → 100644
View file @
0ad2e276
##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)
gh/es.mappings.json
0 → 100644
View file @
0ad2e276
{
"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"
}
}
}
}
}
}
gh/example_document_search_index.json
0 → 100644
View file @
0ad2e276
{
"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
\u
2013 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
\u
2013 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
src/main/scala/ch/memobase/edm/EDM.scala
View file @
0ad2e276
...
...
@@ -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
]())
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment