NAME
Datahub::Factory::Command::merge - Implements the 'merge' command.
DESCRIPTION This command allows datamanagers to (a) fetch data from a two sources (b) transform the data to LIDO using a fix (c) merge the two records and (d) upload the LIDO transformed data to a Datahub instance.
COMMAND LINE INTERFACE
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 merge
command, you must set the [Fixer]
plugin to Merge
. The [Importer]
settings are ignored.
In [plugin_fixer_Merge]
, two records are merged: a left record and a right record. The right record takes precedence.
You must set the following options:
left_record_plugin
-
Importer plugin to use to get the left record. Can be a Catmandu::Store or a Catmandu::Importer. Configuration options for the plugin are set in
[plugin_importer_PLUGIN_NAME]
(see below). left_id_path
-
Path of the ID (in Fix language) in the left record after the fixes have been applied. The ID is used to look up the right record.
left_fix_file_name
-
Fixes to apply to the left record.
right_record_plugin
-
Importer plugin to use to get the right record. Can only be a Catmandu::Store.
right_fix_file_name
-
Fixes to apply to the right record.
Supported Importer plugins:
Supported Exporter plugins:
Plugin configuration
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 (see above).
For a list of supported and required options, see the plugin documentation.
Example configuration file
[Fixer]
plugin = Merge
[Exporter]
plugin = YAML
[plugin_importer_MSK]
file_name = '/vagrant/Datahub-Fixes/msk_test.xml'
data_path = 'recordList.record.*'
[plugin_importer_CollectiveAccess]
endpoint = 'http://demo.collectiveaccess.com'
username = 'demo'
password = 'demo'
[plugin_fixer_Merge]
left_record_plugin = MSK
left_id_path = 'lidoRecID.0._'
left_fix_file_name = '/vagrant/Datahub-Fixes/msk.fix'
right_record_plugin = CollectiveAccess
right_fix_file_name = '/vagrant/Datahub-Factory/ca.fix'
[plugin_exporter_YAML]
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.