SHACLER Generator
is a tool for generating human-readable documentation from SHACL shapes. It parses SHACL .ttl
files, extracts node shapes, property shapes, and their constraints, and produces Markdown documentation. This makes it easier to understand and maintain your SHACL definitions, similar to how Swagger visualizes JSON Schemas.
- Parses NodeShapes and PropertyShapes from SHACL
.ttl
files. - Extracts and displays SHACL constraints, including property paths and their cardinalities.
- Produces Markdown documentation for easy sharing and integration into CI/CD pipelines.
This project uses Poetry for dependency management. To set it up:
- Ensure you have Python 3.7+ and Poetry installed.
- Clone this repository:
git clone https://github.com/YourUsername/SHACLER.git cd SHACLER
- Install dependencies:
This will create a virtual environment and install all required dependencies.
poetry install
The main entry point is main.py. To generate documentation:
poetry run python main.py --input <INPUT_DIR_OR_FILE> [--output <OUTPUT_DIR>]
Arguments:
--input
: Required. Path to a SHACL file or directory containing SHACL.ttl
files.--output
: Optional. Directory where the generated Markdown files will be placed. Defaults to./docs
if not specified.
Example:
poetry run python main.py --input ./shacl_files/schema/src/shacl --output ./docs
After running this command, look inside the selected directory. You will find Markdown files with documentation for your shapes.
Testing
poetry run pytest
- All formatting rules are hardcoded. Implement a configuration system to control documentation generation
- Add more test. Ensure all SHACL features are covered.