This repository contains the software_card_policies Python library as well as the associated
command line program software-card-validate and example policies.
The software was written as part of the Software CaRD
project.
A command line program that validates a given metadata file using a set of configurable policies.
The selection of policies can be configured via config.toml.
Policies can be loaded using any of the protocols supported by
RDFlib's Graph.parse method
(e.g. local files, http, ...).
All of the given policies are loaded and unioned into one RDF graph.
Policies can be implemented in a configurable fashion by defining an sc:Parameter and using it in place of a literal
or list.
See description-parameterizable.ttl and
licenses-parameterizable.ttl as examples.
The string specified as sc:parameterConfigPath is used to look up the desired value for the parameter in the config
file.
python -m venv venv
source venv/bin/activate
python -m pip install -e .Run the program:
software-card-validate examples/data/hermes.ttlThis will validate hermes.ttl using the policies defined in config.toml
and print a validation report to the screen.
If run in debug mode (with --debug), the report is more verbose, and the following files are written to the current
working directory:
debug-input-data.ttl: the input datadebug-shapes-processed.ttl: the parameterized and combined policiesdebug-validation-report.ttl: the detailed SHACL validation report (sh:ValidationReport)
To build the documentation, install the package including the docs extra:
python -m pip install -e .[docs]Then run Sphinx via the predefined task:
task docs-build # build the docs
task docs-clean # delete the built docsTo view the docs in the browser, run
python -m http.server -b 127.0.0.1 -d docs/_build/htmlThen follow the link http://127.0.0.1:8000/.
Software CaRD (ZT-I-PF-3-080) is funded by the
Initiative and Networking Fund of the Helmholtz Association in the framework of the Helmholtz Metadata Collaboration.