Skip to content

Executable scripts

ccacciari edited this page Sep 1, 2017 · 1 revision

mets_factory - defining a Manifest

It takes a collection path in input and provide a METS file as output. The input path can be a file system or an iRODS path. The data-metadata relation document has to be compliant with the json-ld format and the EUDAT controlled vocabulary, while the manifest is a METS formatted document. If the collection specified contains a sub-collection that already has a METS formatted manifest, then a link will be created from the manifest of the top collection to the manifest of the sub-collection.

$ ./mets_factory.py -h

usage: mets_factory.py [-h] [-dbg] [-d] (-i IRODS | -f FILESYSTEM) confpath
  
METS factory
  
positional arguments:
  confpath              path to the configuration file
  
optional arguments:
  -h, --help            show this help message and exit
  -dbg, --debug         enable debug
  -d, --dryrun          run without performing any real change
  -i IRODS, --irods IRODS
                        irods path
  -f FILESYSTEM, --filesystem FILESYSTEM
                        fs path

b2safe_neo4j_client - defining a Graph

It takes an iRODS path to a manifest file as input, parses it and uploads the content to a neo4j instance. If there is already a graph in the neo4j DB for the collection under the specified path, then the b2safe_neo4j_client will compare the "old" and "new" manifests (that assumed both to be under the collection path), extract the changes and update the graph accordingly. If the top collection contains a sub-collection also with a manifest file describing it and the manifest file of the top collection has a link element (mptr) in the structural map pointing to it, than the b2safe_neo4j_client will create a graph for the sub-collection if there is not already one or update the existing one and connect the subgraph with the graph of the top collection with the IS_LINKED_TO relation. Support for the hierarchy of manifest files allows to decrease the size of each single manifest, making it easier to parse and, also, allowing to process multipe sub-collections in parallel.

$ ./b2safe_neo4j_client.py -h
usage: b2safe_neo4j_client.py [-h] [-dbg] [-d] confpath path

B2SAFE graphDB client

positional arguments:
  confpath       path to the configuration file
  path           irods path to the data

optional arguments:
  -h, --help     show this help message and exit
  -dbg, --debug  enable debug
  -d, --dryrun   run without performing any real change
  -u USER, --user USER  irods user
Clone this wiki locally