Contributing¶
Thank you for your interest in contributing to OntoInk! Every contribution helps — from bug reports to code, documentation, and ideas.
Reporting Issues¶
Found a bug? Have a feature request? Please open an issue on GitHub:
Bug Reports¶
When reporting a bug, please include:
- What you expected to happen
- What actually happened (screenshots help!)
- Steps to reproduce the problem
- Your environment: Python version, OntoInk version (
pip show ontoink), browser - Relevant TTL files (if possible) — a minimal example that triggers the bug
Feature Requests¶
Have an idea for a new feature? We'd love to hear it. When opening a feature request:
- Describe the use case — what problem does it solve?
- Sketch out the desired behavior
- Note any alternatives you've considered
Development Setup¶
1. Fork and clone¶
2. Install in editable mode¶
3. Run the test suite¶
4. Serve the demo site locally¶
Open http://127.0.0.1:8000 to see your changes in real time.
Code Contributions¶
Workflow¶
- Open an issue first to discuss proposed changes
- Fork the repository
- Create a feature branch from
main - Make your changes
- Add tests for new functionality
- Ensure
pytestpasses - Submit a pull request
Project Structure¶
ontoink/
__init__.py # The single source of the version number
plugin.py # MkDocs plugin entry point + on_post_build artefacts
fence.py # Custom fence handler (```ontoink blocks)
cq.py # Competency-question fence (```ontoink-cq blocks)
ttl_parser.py # RDF/TTL parsing and Cytoscape JSON generation
shacl_validator.py # pySHACL validation wrapper
report.py # Build report, quality score, SVG badges, CI gate
api.py # Optional FastAPI server (ontoink[api])
cluster.py # Build-time Leiden clustering (ontoink[cluster])
recommend/ # SHACL shape induction
types.py # normalised Constraint / Shape / ShapeSet model
profiler.py # per-class instance profiling
methods.py # baseline (data-driven) + astrea (axiom-driven)
writer.py # Turtle emission, with confidence annotations
drift.py # committed shapes vs. what the data implies
resources/
ontoink.js # Frontend: Cytoscape, editor, export, popups
ontoink-dsl.js # Live-editor DSL parser + autocomplete vocabulary
ontoink.css # Frontend: all styles
tests/
test_fence.py # fence rendering
test_plugin.py # full mkdocs build through the plugin
test_ttl_parser.py
test_shacl_validator.py
test_recommend.py # induction + drift
test_cq.py # competency questions
test_report.py # score, badges, quality gate
test_hygiene.py # regressions for the silent-correctness fixes
demo/
mkdocs.yml # Demo site configuration
docs/ # Demo documentation pages
Key Guidelines¶
- Python code is in
ontoink/— parsing, validation, HTML generation - JavaScript code is in
ontoink/resources/ontoink.js— all frontend logic - CSS is in
ontoink/resources/ontoink.css - Keep JS/CSS as single files (no build step, loaded inline by the plugin)
- All new features should have corresponding tests
Questions?¶
Not sure where to start? Open a discussion and we'll point you in the right direction.