datalad meta-filter

Synopsis

datalad meta-filter [-h] [-d DATASET] [-r] [--version] FILTER_NAME METADATA_URL [METADATA_URL ...] [FILTER_ARGUMENTS [FILTER_ARGUMENTS ...]]

Description

Run a metadata filter on a set of metadata elements.

Take a number of metadata elements and run a filter on it.

The result of the filter operation will be written to stdout and can, for example, be passed to meta-add.

The filter can be configured by passing key-value pairs given as additional arguments. Each key-value pair consists of two arguments, first the key, then the value. The key value pairs have to be separated by ‘++’ from the metadata coordinates

Examples

Use the provided ‘metalad_demofilter’ to build a ‘histogram’ of keys and their content in the metadata of the dataset ‘root-dataset’, iterating over the sub-datasets ‘sub-a’ and ‘sub-b’.:

% datalad meta-filter metalad_demofilter -d root-dataset
  sub-a sub-b

Apply ‘metalad_demofilter’ to all directories/sub-datasets of the dataset in the current working directory that start with ‘subject’.:

% datalad meta-filter metalad_demofilter subject*

Options

FILTER_NAME

Name of the filter that should be executed. Constraints: value must be a string

METADATA_URL

MetadataRecord URL(s). A list of at least one metadata URL. The filter will receive a list of iterables, that contains one iterable for each metadata URL. The iterables will yields all metadata-entries that match the respective metadata URL. Constraints: value must be a string

FILTER_ARGUMENTS

Extractor arguments given as string arguments to the extractor. Filter arguments have to be separated from the list of metadata coordinates by ‘++’. Constraints: value must be a string or value must be NONE

-h, –help, –help-np

show this help message. –help-np forcefully disables the use of a pager for displaying the help message

-d DATASET, –dataset DATASET

Git repository that contains datalad metadata. If no repository path is given, the metadata store is determined by the current work directory. All metadata URLs (see below) are relative to this dataset. Constraints: Value must be a Dataset or a valid identifier of a Dataset (e.g. a path) or value must be NONE [Default: ‘.’]

-r, –recursive

If set, the metadata URL iterables will yield all metadata recursively from the matching metadata URLs.

–version

show the module and its version which provides the command

Authors

datalad is developed by The DataLad Team and Contributors <team@datalad.org>.