51 lines
2.9 KiB
ReStructuredText
51 lines
2.9 KiB
ReStructuredText
|
This library has been initially designed to deposit software artifacts programmatically in Zenodo.
|
||
|
|
||
|
It is actually a general-purpose library capable of analyzing a list of
|
||
|
software artifacts (represented by the metadata) and export them.
|
||
|
|
||
|
The library currently offers two exporters:
|
||
|
|
||
|
* **ZenodoExporter**: deposit the software artifact in Zenodo obtaining a DOI;
|
||
|
* **BibLaTeXExporter**: export the software artifact in a ``bib`` file using the BibLaTeX format.
|
||
|
|
||
|
Other exporters can be easily added in the future by extending the ``SoftwareVersionExporter`` class.
|
||
|
|
||
|
The core class of the library is Analyser, which must be initialized with:
|
||
|
|
||
|
* a configuration (JSON Object);
|
||
|
* a list of software artifacts described by their metadata (JSON Array).
|
||
|
|
||
|
The configuration must contain the list of exporters to be used and their configuration parameters.
|
||
|
Exporter configuration requires the 'elaboration' property, which can assume the following values
|
||
|
(see ``ElaborationType`` enumerated):
|
||
|
|
||
|
* **ALL**: The exporter analyses all the software artifacts;
|
||
|
* **UPDATE_ONLY**: The exporter analyes only the software artifact to be updated in the target.
|
||
|
* **NEW**: The exporter analyses only the software artifact that does not yet exist in the target.
|
||
|
* **NONE**: Does not export the software artifact in the target, but each software artifact is elaborated for the exporting without effectively doing it. It is a dry run.
|
||
|
|
||
|
The exporters are executed in the order they are defined.
|
||
|
An exporter could produce metadata obtained by the exporting phase (e.g., the obtained Zenodo DOI).
|
||
|
The input metadata + the metadata generated by an exporter are made available to the subsequent.
|
||
|
|
||
|
At the end of the exporting phase, the library produces the actual output of all the software artifact metadata.
|
||
|
|
||
|
Moreover, the configuration can optionally include an arbitrary set of metadata used as metadata default for all software artifacts defined in the list.
|
||
|
|
||
|
The list of software artifacts can contain an arbitrary set of metadata.
|
||
|
It is the exporter logic that uses certain metadata, among others.
|
||
|
|
||
|
While analyzing each software artifact, the ``Analyser`` set the previous to the exporter.
|
||
|
Relating the artifact with the previous one is helpful if an exporter needs to link them.
|
||
|
It is in charge of the exporter's logic of eventually connecting them under specific metadata values used as conditions.
|
||
|
|
||
|
The library dynamically calculates the value of metadata to elaborate using the following essential features:
|
||
|
|
||
|
* A property can contain the value of another property indicated as a variable using the referred property name;
|
||
|
* The library merges the metadata of the software artifact with the metadata defined in the configuration;
|
||
|
* The library calculates the final metadata values, replacing the variables only after merging the properties.
|
||
|
|
||
|
The following example show an example of configuration
|
||
|
|
||
|
.. literalinclude:: ../src/test/resources/gcat-test-sandbox.json
|
||
|
:language: JSON
|