A SHACL-based validator for mobilityDCAT-AP metadata, supporting validation of RDF documents against mobilityDCAT-AP SHACL constraints.
This repo provides a configuration of the ITB SHACL Validator according to the guidelines here, an MCP server is configured in the repo to access the related documentation via agents.
This project provides a standalone SHACL validator for the mobilityDCAT-AP specification, allowing validation of RDF metadata against predefined SHACL shapes for different versions (v1.0.0, v1.0.1, v1.1.0, v3.0.0) and validation profiles.
-
mobilityDCAT-AP v1.0.0
- Default validation profile
-
mobilityDCAT-AP v1.0.1
- Default validation profile
-
mobilityDCAT-AP v1.1.0
core: Core Constraintsrange: Range and Core Constraintsfull: Controlled Vocabularies, Range and Core Constraintscv: Controlled Vocabularies
-
mobilityDCAT-AP v3.0.0
core: Core Constraintsrange: Range and Core Constraintsfull: Controlled Vocabularies, Range and Core Constraintscv: Controlled Vocabularies
Navigate to the project root and run:
docker pull ghcr.io/mobilitydcat-ap/itb-validator-mobilitydcat-ap:1.0Alternatively, you can build the image locally:
docker build -t ghcr.io/mobilitydcat-ap/itb-validator-mobilitydcat-ap:latest .Important: Each domain must be a subfolder under resources/ containing a config.properties file. The subfolder name becomes the domain name. The one for mobilityDCAT-AP is already configured.
docker run -d \
--name mobilitydcat-validator \
-p 8080:8080 \
ghcr.io/mobilitydcat-ap/itb-validator-mobilitydcat-ap:1.0Navigate to http://localhost:8080/shacl/mobilityDCAT-AP/upload to validate RDF metadata via the web interface.
Validate RDF content programmatically using the REST API documented at this link.
The unified validate-metadata.sh script handles both single file and batch validation. It automatically detects whether the input is a file or directory.
The script auto-detects whether the input is a file or a directory and runs in single or batch mode accordingly. Both modes share the same parameters.
./validate-metadata.sh <file|directory> <validation-type> [profile] [output-format] [validator-url] [output-directory]| Argument | Required | Default | Description |
|---|---|---|---|
file|directory |
yes | — | RDF file or directory of RDF files |
validation-type |
yes | — | Version: v1.0.0, v1.0.1, v1.1.0, v3.0.0 |
profile |
no | core |
core, range, full, cv (only for v1.1.0 and v3.0.0) |
output-format |
no | application/json |
application/json, application/rdf+xml, text/turtle, application/xml |
validator-url |
no | http://localhost:8080 |
Validator base URL |
output-directory |
no | ./validation-reports |
Directory for report files |
Supported file types (batch): .ttl, .rdf, .nt, .jsonld, .json
Examples:
# Single file — core profile, JSON report
./validate-metadata.sh metadata.ttl v1.0.0
# Single file — range profile, RDF/XML report
./validate-metadata.sh metadata.ttl v1.0.1 range application/rdf+xml
# Batch — all files with range profile
./validate-metadata.sh ./metadata v1.1.0 range application/json
# Batch — v3.0.0 CV profile against a remote validator
./validate-metadata.sh ./metadata v3.0.0 cv application/json http://validator.example.com:8080 ./reportsPlease refer to the mobilityDCAT-AP specification license and ITB software license.
For issues and feature requests, please open an issue or contact the ITB support team.