This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Central repository for Gaia-X 25.11 compliant ontologies for the ENVITED-X Ecosystem. Provides OWL ontology definitions, SHACL validation shapes, JSON-LD context files, and a Python validation suite.
Key URLs:
- Documentation: https://gaia-x4plc-aad.github.io/ontology-management-base/
- Repository: https://github.com/gaia-x4plc-aad/ontology-management-base
# Install (dev mode with pre-commit hooks)
pip install -e ".[dev]" && pre-commit install
# Run full validation suite
python3 -m src.tools.validators.validation_suite
# Validate specific domain(s)
python3 -m src.tools.validators.validation_suite --domain manifest hdmap
# Validate arbitrary files (for pre-commit)
python3 -m src.tools.validators.validation_suite --path ./my_data.json
# Run tests with coverage
pytest tests/ --cov=src/tools --cov-report=html
# Lint and format
make lint # pre-commit on all files
make format # black + isort on src/
# Local docs server
DOCS_SITE_URL=http://127.0.0.1:8000/ontology-management-base mkdocs serve
# Update catalogs after artifact changes
python3 -m src.tools.utils.registry_updatersrc/tools/
├── core/ # Foundation (no internal deps) - constants, logging, result codes, IRI utils
├── utils/ # Catalog I/O + graph loading - depends on core/
└── validators/ # Validation CLI - depends on core/ + utils/
Dependency rule: Never import upward (utils cannot import from validators).
All file discovery goes through XML catalogs. Validators never scan the filesystem directly.
| Module | Responsibility |
|---|---|
registry_updater.py |
WRITES catalogs, uses file_collector.py for discovery |
registry_resolver.py |
READS catalogs, resolves IRIs to paths |
file_collector.py |
Shared file discovery utilities (used by updater + validators) |
artifacts/catalog-v001.xml- Ontology IRIs → local OWL/SHACL/context filesimports/catalog-v001.xml- Base ontologies (RDF, RDFS, OWL, SKOS)tests/catalog-v001.xml- Test data files + fixtures (mock external refs)
Four checks in sequence:
- check-syntax - JSON/Turtle well-formedness
- check-artifact-coherence - SHACL targets exist in OWL (domain mode only)
- check-data-conformance - SHACL validation of instance data
- check-failing-tests - Invalid data fails as expected (domain mode only)
from src.tools.core.logging import get_logger
from src.tools.core.result import ReturnCodes, ValidationResult
from src.tools.utils.registry_resolver import RegistryResolver
from src.tools.utils.graph_loader import load_graph, load_jsonld_files
logger = get_logger(__name__)| Extension | Purpose |
|---|---|
.owl.ttl |
OWL ontology definitions |
.shacl.ttl |
SHACL validation shapes |
.context.jsonld |
JSON-LD context files |
.expected |
Expected output for invalid test data |
- Python 3.12+ with type hints on public APIs
- pathlib.Path (never
os.path) - Centralized logging via
get_logger(__name__); reserveprint()for final user output - Fail fast - raise specific exceptions, no silent
Nonereturns - Test naming -
test_{function}_{scenario}_{expected} - Import order - stdlib, third-party, local core, local utils
Read these before making changes:
| Topic | File |
|---|---|
| Module structure | .github/instructions/architecture.md |
| Code style | .github/instructions/coding-standards.md |
| Validation pipeline | .github/instructions/validation-workflow.md |
| Testing requirements | .github/instructions/testing.md |
| Domain terminology | .github/instructions/glossary.md |
When making changes to the codebase, always update these two files in .playground/ (gitignored):
| File | Purpose |
|---|---|
.playground/change-summary.md |
Detailed markdown summary of all changes grouped by severity/category, including file paths, problem descriptions, and fixes applied |
.playground/commit-message.md |
Conventional commit message with bullet points, ready for copy-paste into git commit |
Update both files before presenting the final result to the user. If a session involves multiple rounds of changes, keep these files in sync with the cumulative state.
- Bypassing catalogs with direct filesystem scanning in validators
- Using
os.pathinstead ofpathlib.Path - Silent
Nonereturns instead of raising exceptions - Using
print()for internal progress (uselogger)