Extending - hbz/to.science GitHub Wiki
Regal provides a framework for mirroring repositories. Examples can be found in github, e.g. dipp-sync , opus-sync
A regal-extension can be created using the regal-sync-archetype
cd regal-sync/src/main/resources/regal-sync-archetype
mvn install
cd -
mvn archetype:generate -DarchetypeCatalog=local -DarchetypeArtifactId=regal-sync-archetype -DarchetypeGroupId=de.nrw.hbz.regal -DgroupId=de.nrw.hbz.regal -Dversion=0.1.0-SNAPSHOT -Dpackage=de.nrw.hbz.regalYou will be prompted for a artifactName, e.g. regal-testProject
A downloader implements the de.nrw.hbz.regal.sync.ingest.DownloaderInterface or extends the abstract class de.nrw.hbz.regal.sync.ingest.Downloader.
The abstract class Downloader provides a standard Download-Logic. All you have to do is to write a routine for the download of a single object identified by an id. The object must be stored in the downloadDirectory.
protected abstract void downloadObject(File downloadDirectory, String pid);Writing a builder is similar to writing a Downloader. The Builder knows the datastructures used by the Downloader and creates objects of type de.nrw.hbz.regal.sync.extern.DigitalEntity.
Therefore the Builder must implement the interface de.nrw.hbz.regal.sync.extern.DigitalEntityBuilder which prescribes exactly one method.
public DigitalEntity build(String baseDir, String pid) throws Exception;A Ingester must Implement the following interface
public abstract void ingest(DigitalEntity dtlBean);
public abstract void delete(String pid);
public abstract void update(DigitalEntity dtlBean);
public abstract void init(String host, String user, String password, String namespace);To use all features of Regal certain rdf-vocabularies must be used. Many items are already described and searchable at api.lobid.org.
If your items are not within the lobid database you have to write a mapper for your metadata. A good and very handy tool for metadata mapping and transformation is metafacture provided by culturegraph. Regal uses metafacture through lodmill-rd.
Java: DippMapping.java
Flux Flow: dipp-qdc-to-lobid.flux
Morph Mapping: dipp-qdc-to-lobid.xml
Java: OpusMapping.java
Flux Flow: opus-xmetadissplus-to-lobid.flux
Morph Mapping: opus-xmetadissplus-to-lobid.xml