This repository contains example policies developed as part of the Software CaRD project, as well as a validator tool.
All examples in this repository use the following namespace prefix bindings:
@prefix codemeta: <https://doi.org/10.5063/schema/codemeta-2.0#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sc: <https://schema.software-metadata.pub/software-card/2025-01-01/#> .
@prefix scex: <https://schema.software-metadata.pub/software-card/2025-01-01/examples/#> .
@prefix scimpl: <https://schema.software-metadata.pub/software-card/2025-01-01/implementation/#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
For Software CaRD, the prefixes
sc:
,
scex:
, and
scimpl:
were established and are used for the following purposes:
sc:
contains terms exposed to usersscex:
contains example uses ofsc:
andsh:
termsscimpl:
contains internal implementation details
The associated IRIs currently don't exist.
A search on prefix.cc reveals prior usage of the prefix sc:
by projects which seem to be
defunct.
A program that validates a given metadata file using a set of configurable policies.
The selection of policies to use 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 merged into one RDF graph (union of all triples of the parts).
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 .
Start a webserver hosting the policy files (run it in the background or use a separate terminal window):
python -m http.server -b 127.0.0.1 -d examples/
Then, run the program:
sc-validate examples/data/hermes.ttl
This will validate hermes.ttl
using the policies defined in config.toml
and print the result to the screen.
If run in debug mode (with --debug
), 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
)
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.