NAME

Datahub::Factory::Command::transport - Implements the 'transport' command.

DESCRIPTION

This command allows datamanagers to (a) fetch data from a (local) source (b) transform the data to LIDO using a fix (c) upload the LIDO transformed data to a Datahub instance.

COMMAND LINE INTERFACE

--pipeline

Location of the pipeline configuration file.

Pipeline configuration file

The pipeline configuration file is in the INI format and its location is provided to the application using the --pipeline switch.

The file is broadly divided in two parts: the first (shortest) part configures the pipeline itself and sets the plugins to use for the import, fix and export actions. The second part sets options specific for the used plugins.

Pipeline configuration

This part has three sections: [Importer], [Fixer] and [Exporter]. Every section has just one option: plugin. Set this to the plugin you want to use for every action.

All current supported plugins are in the Importer and Exporter folders. For the [Fixer], only the Fix plugin is supported.

Supported Importer plugins:

TMS
Adlib
OAI

Supported Exporter plugins:

Datahub
LIDO
YAML

Plugin configuration

[Importer]
plugin = OAI

[plugin_importer_OAI]
endpoint = https://oai.my.museum/oai

[Fixer]
plugin = Fix

[plugin_fixer_Fix]
file_name = '/home/datahub/my.fix'
id_path = 'lidoRecID.0._'

[Exporter]
plugin = LIDO

[plugin_exporter_LIDO]

All plugins have their own configuration options in sections called [plugin_type_name] where type can be importer, exporter or fixer and name is the name of the plugin.

All plugins define their own options as parameters to the respective plugin. All possible parameters are valid items in the configuration section.

If a plugin requires no options, you still need to create the (empty) configuration section (e.g. [plugin_exporter_LIDO] in the above example).

Fixer plugin

[plugin_fixer_Fix]
condition = record.institution_name
fixers = MSK, GRO
id_path = record.id

[plugin_fixer_Fix]
file_name = /home/datahub/my.fix
id_path = record.id

The [plugin_fixer_Fix] can directly load a fix file (via the option file_name) or can be configured to conditionally load a different fix file to support multiple fix files for the same data stream (e.g. when two institutions with different data models use the same API endpoint). This is done by setting the condition and fixers options.

The id_path option contains the path (in Fix syntax) of the identifier of each record in your data after the fix has been applied, but before it is submitted to the Exporter. It is used for reporting and logging.

Conditional fixers

[plugin_fixer_Fix]
condition = record.institution_name
fixers = MSK, GRO
id_path = 'lidoRecID.0._'

[plugin_fixer_GRO]
condition = 'Groeningemuseum'
file_name = '/home/datahub/gro.fix'

[plugin_fixer_MSK]
condition = 'Museum voor Schone Kunsten Gent'
file_name = '/home/datahub/msk.fix'

If you want to separate the data stream into multiple (smaller) streams with a different fix file for each stream, you can do this by setting the appropriate options in the [plugin_fixer_Fix] block. Note that id_path is still mandatory.

Set condition to the Fix-compatible path in the original stream that holds the condition you want to use to split the stream.

Provide a comma-separated list of fixer plugins in fixers.

For every fixer plugin in fixers, create a configuration block called [plugin_fixer_name] and provide the following options:

condition

The value that the condition from [plugin_fixer_Fix] must have for the record to belong to this block.

file_name

The location of the fix file that must be executed for every record in this block.

Example configuration file

[Importer]
plugin = Adlib

[Fixer]
plugin = Fix

[Exporter]
plugin = Datahub

[plugin_importer_Adlib]
file_name = '/tmp/adlib.xml'
data_path = 'recordList.record.*'

[plugin_fixer_Fix]
file_name = '/tmp/msk.fix'
id_path = 'record.id'

[plugin_exporter_Datahub]
datahub_url = https://my.thedatahub.io
datahub_format = LIDO
oauth_client_id = datahub
oauth_client_secret = datahub
oauth_username = datahub
oauth_password = datahub

AUTHORS

Pieter De Praetere <pieter@packed.be>

Matthias Vandermaesen <matthias.vandermaesen@vlaamsekunstcollectie.be>

COPYRIGHT

Copyright 2016 - PACKED vzw, Vlaamse Kunstcollectie vzw

LICENSE

This library is free software; you can redistribute it and/or modify it under the terms of the GPLv3.