2021-01-15 17:01:48 +01:00
|
|
|
# https://taskfile.dev
|
|
|
|
|
|
|
|
version: '3'
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
default:
|
2021-01-19 12:30:46 +01:00
|
|
|
desc: Elpub Wuppertal
|
2021-01-20 15:35:02 +01:00
|
|
|
vars:
|
|
|
|
PROJECT: wuppertal
|
|
|
|
MINIMUM: 1300 # Mindestanzahl der zu erwartenden Datensätze
|
2021-01-15 17:01:48 +01:00
|
|
|
cmds:
|
2021-01-20 15:35:02 +01:00
|
|
|
- task: harvest
|
2021-01-15 17:01:48 +01:00
|
|
|
- task: refine
|
2021-01-20 15:35:02 +01:00
|
|
|
# Folgende Tasks beginnend mit ":" sind für alle Datenquellen gleich in Taskfile.yml definiert
|
2021-01-20 12:16:34 +01:00
|
|
|
- task: :check
|
2021-01-20 15:35:02 +01:00
|
|
|
vars: {PROJECT: '{{.PROJECT}}', MINIMUM: '{{.MINIMUM}}'}
|
2021-01-20 12:16:34 +01:00
|
|
|
- task: :split
|
2021-01-20 15:35:02 +01:00
|
|
|
vars: {PROJECT: '{{.PROJECT}}'}
|
2021-01-20 12:16:34 +01:00
|
|
|
- task: :validate
|
2021-01-20 15:35:02 +01:00
|
|
|
vars: {PROJECT: '{{.PROJECT}}'}
|
2021-01-20 12:16:34 +01:00
|
|
|
- task: :zip
|
2021-01-20 15:35:02 +01:00
|
|
|
vars: {PROJECT: '{{.PROJECT}}'}
|
2021-01-20 12:16:34 +01:00
|
|
|
- task: :diff
|
2021-01-20 15:35:02 +01:00
|
|
|
vars: {PROJECT: '{{.PROJECT}}'}
|
2021-01-15 17:01:48 +01:00
|
|
|
|
|
|
|
harvest:
|
2021-01-20 15:35:02 +01:00
|
|
|
dir: data/{{.PROJECT}}/harvest
|
|
|
|
vars:
|
|
|
|
URL: http://elpub.bib.uni-wuppertal.de/servlets/OAIDataProvider
|
|
|
|
FORMAT: oai_dc
|
|
|
|
PROJECT: wuppertal
|
2021-01-15 17:01:48 +01:00
|
|
|
cmds:
|
2021-01-20 15:35:02 +01:00
|
|
|
- METHA_DIR=$PWD metha-sync --format {{.FORMAT}} {{.URL}}
|
|
|
|
- METHA_DIR=$PWD metha-cat --format {{.FORMAT}} {{.URL}} > {{.PROJECT}}.xml
|
2021-01-15 17:01:48 +01:00
|
|
|
|
|
|
|
refine:
|
2021-01-20 15:35:02 +01:00
|
|
|
dir: data/{{.PROJECT}}/refine
|
2021-01-19 10:50:55 +01:00
|
|
|
ignore_error: true # provisorisch verwaisten Java-Prozess bei Exit vermeiden https://github.com/go-task/task/issues/141
|
2021-01-20 15:35:02 +01:00
|
|
|
vars:
|
2021-01-15 17:01:48 +01:00
|
|
|
PORT: 3335
|
2021-01-19 10:50:55 +01:00
|
|
|
RAM: 4G
|
2021-01-15 17:01:48 +01:00
|
|
|
PROJECT: wuppertal
|
|
|
|
cmds:
|
2021-01-20 15:35:02 +01:00
|
|
|
- task: :openrefine-start
|
|
|
|
vars: {PROJECT: '{{.PROJECT}}', PORT: '{{.PORT}}', RAM: '{{.RAM}}'}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Import (erfordert absoluten Pfad zur XML-Datei)
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --create "$(readlink -e ../harvest/{{.PROJECT}}.xml)" --recordPath Records --recordPath Record --storeEmptyStrings false --trimStrings true --projectName {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Vorverarbeitung: Identifier in erste Spalte; nicht benötigte Spalten (ohne differenzierende Merkmale) löschen; verbleibende Spalten umbenennen (Pfad entfernen)
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/vorverarbeitung.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Entfernen von HTML-Tags und Transformation von subscript und superscript in Unicode (betrifft dc:description, dc:source und dc:title)
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/html.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# DDC einheitlich auf drei Ziffern vereinheitlichen (betrifft dc:subjects und oai:setSpec)
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/ddc.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# dc:publisher setzen
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/publisher.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# URNs, DOIs und PDF-Links aus dc:identifier extrahieren
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/identifier.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Direktlinks generieren durch Abgleich der URNs mit nbn-resolving und Datensätze ohne Direktlink auf ein PDF löschen
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/nbn.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Aufteilung dc:subject in ioo und topic
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/subjects.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Standardisierte Rechteangaben Teil 1 (Links zu CC-Lizenzen)
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/rights.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Datenstruktur für Templating vorbereiten: Pro Zeile ein Datensatz und leere Zeilen löschen
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/join.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Zusammenführung gleichsprachiger Titelangaben zu Title/Subtitle
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/subtitle.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Sprachangaben nach ISO-639-2b (betrifft dc:language sowie die xml:lang Attribute für dc:coverage, dc:description und dc:title)
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/language.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Standardisierte Rechteangaben Teil 2 (Canonical Name für CC-Lizenzen)
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/rights-cc.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Anreicherung HT-Nummer via lobid-resources
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/hbz.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Sortierung mods:nonSort für das erste Element in dc:title
|
2021-01-20 15:35:02 +01:00
|
|
|
- $OPENREFINE_CLIENT -P {{.PORT}} --apply ../../../rules/{{.PROJECT}}/nonsort.json {{.PROJECT}}
|
2021-01-15 17:01:48 +01:00
|
|
|
# Export in METS:MODS mit Templating
|
|
|
|
- |
|
2021-01-20 15:35:02 +01:00
|
|
|
$OPENREFINE_CLIENT -P {{.PORT}} --export --template "$(< ../../../rules/{{.PROJECT}}/template.txt)" --rowSeparator "
|
2021-01-15 17:01:48 +01:00
|
|
|
<!-- SPLIT -->
|
2021-01-19 19:41:36 +01:00
|
|
|
" --suffix "
|
2021-01-20 15:35:02 +01:00
|
|
|
" --output {{.PROJECT}}.txt {{.PROJECT}}
|
|
|
|
- task: :openrefine-stop
|
|
|
|
vars: {PROJECT: '{{.PROJECT}}', PORT: '{{.PORT}}'}
|
2021-01-15 17:01:48 +01:00
|
|
|
sources:
|
2021-01-20 15:35:02 +01:00
|
|
|
- ../harvest/{{.PROJECT}}.xml
|
|
|
|
- ../../../rules/{{.PROJECT}}/*.json
|
|
|
|
- ../../../rules/{{.PROJECT}}/template.txt
|
2021-01-19 17:29:00 +01:00
|
|
|
#TODO - ../../../rules/common/*.json
|
2021-01-15 17:01:48 +01:00
|
|
|
generates:
|
2021-01-19 17:29:00 +01:00
|
|
|
- openrefine.log
|
2021-01-20 15:35:02 +01:00
|
|
|
- '{{.PROJECT}}.txt'
|
|
|
|
- '{{.PROJECT}}.openrefine.tar.gz'
|
2021-01-15 17:01:48 +01:00
|
|
|
|
2021-01-18 19:59:44 +01:00
|
|
|
linkcheck:
|
2021-01-19 12:30:46 +01:00
|
|
|
desc: Elpub Wuppertal links überprüfen
|
2021-01-18 19:59:44 +01:00
|
|
|
cmds:
|
2021-01-19 12:30:46 +01:00
|
|
|
- task: :linkcheck
|
|
|
|
vars: {PROJECT: "wuppertal"}
|
2021-01-18 19:59:44 +01:00
|
|
|
|
2021-01-15 17:01:48 +01:00
|
|
|
delete:
|
2021-01-19 12:30:46 +01:00
|
|
|
desc: Elpub Wuppertal cache löschen
|
2021-01-15 17:01:48 +01:00
|
|
|
cmds:
|
2021-01-19 12:30:46 +01:00
|
|
|
- task: :delete
|
|
|
|
vars: {PROJECT: "wuppertal"}
|