factsmission / dcat-ap-ch-shacl

SHACL shapes for the ECH-0200 standard
Other
1 stars 5 forks source link

Build Status

SHACL Shapes for the DCAT Application Profile for Data Portals in Switzerland

This project provides SHACL shapes to validate metadata against the eCH-0200 standard.

Files

Usage

To use the shapes to validate data, you need a SHACL validator such as TopBraid SHACL API. With this validator you can validate RDF turtle files as follows:

$ shaclvalidate -shapesfile ech-0200.shacl.ttl -datafile data.ttl

For example (from this directory):

$ shaclvalidate -shapesfile ech-0200.shacl.ttl -datafile .\examples\minimal.valid.ttl

Validating files in formats other than Turtle

As the TopBraid SHACL validator only supports the Turtle RDF Format, you need to convert files in other formats such as RDF/XML files.

First you need Apache Jena. You can download and extract it with these commands:

$ wget https://www-eu.apache.org/dist/jena/binaries/apache-jena-3.9.0.tar.gz
$ tar xvzf apache-jena-3.9.0.tar.gz

This creates a folder named apache-jena-3.9.0. To convert your RDF/XML file (eg. file.rdf) you can use this command:

$ ./apache-jena-3.9.0/bin/riot --output=turtle rdfxml file.rdf > file.ttl

And you will find the converted result in file.ttl.

Jena supports these RDF formats: turtle, ntriples, nquads, trig and rdfxml.

References

This project is similar and partially based on the EU DCAT-AP SHACL constraint definitions.

Note on Language

While the eCH-0200 Specification is available in German and French the SHACL shapes are documented in English to better allign with other shape files and tools that are likely used simultaneously.

Comments on the Interpretation of the Specification

License

As prospective part of an eCH standard the code and documentations in this repository can be used, distributed and further developed without any restriction by patents or licenses.