ontogate
Validate RDF instance data against a pinned ontology and its SHACL shapes.
Point it at a published ontology (owner/repo@version), give it a data file, and it tells
you whether that data conforms — using the ontology's own author-published shapes and its
full dependency closure. Validation runs in your environment: the shapes come to your
data, your data never leaves your network.
Status: v0.2.1, functional. Self-contained and contextual validation, registry bundle fetch, token auth and
ontogate login(device flow) all work end to end.
Why
A registry hosts the TBox — versioned ontologies plus the SHACL shapes their authors published. This client is the quality gate: check that new instance data conforms to a pinned schema before it reaches your production triple store or an LLM/RAG pipeline. CI-native; the engine is pySHACL (full SHACL Core + SPARQL + Advanced Features).
Because the schema is pinned to a version, a validation result stays reproducible: the report records the schema reference, the mode and the inference regime it ran under.
Install
pip install ontogate # CLI + SDK — installs the `ontogate` command
pip install "ontogate[aws]" # + AWS SigV4 signing for Amazon Neptune
uv tool install ontogate # or as a standalone tool
Usage
# self-contained: validate a payload as a closed graph
ontogate validate --schema acme/health-model@v1.2.0 --data ./incoming.ttl
# contextual: resolve references against a target store (GraphDB/Fuseki/…)
ontogate validate --schema acme/health-model@v1.2.0 --data ./incoming.ttl \
--target-endpoint https://graphdb.internal/repositories/prod --target-auth basic \
--context-depth 2 --inference none --format json
# contextual against Amazon Neptune (IAM auth → SigV4)
ontogate validate --schema acme/health-model@v1.2.0 --data ./incoming.ttl \
--target-endpoint https://…neptune.amazonaws.com:8182/sparql \
--target-auth sigv4 --aws-region eu-west-1
# authenticate for local dev (OAuth device flow)
ontogate login
Auth: all programmatic pulls need an API token — --token, ONTOGATE_API_TOKEN, or
ontogate login (device flow). Exit codes: 0 conforms · 1 non-conforming · 2 error.
Configuration
The client needs two things: which registry to talk to, and a token. Both resolve the same way, most specific first — so a one-off override never needs a config file, and CI never needs an interactive login.
| Registry url | Token | |
|---|---|---|
| 1. Flag | --api-url |
--token |
| 2. Environment | ONTOGATE_API_URL |
ONTOGATE_API_TOKEN |
3. Stored by ontogate login |
~/.ontogate/credentials |
~/.ontogate/credentials |
| 4. Built in | https://api.ontoshire.com/api/v1 |
— (a token is always required) |
For the hosted service, one login is enough — it stores the url alongside the token:
ontogate login
Self-hosting, or pointing at a staging registry, means saying so once:
ontogate login --api-url https://registry.example.com/api/v1
api.ontoshire.com is a stable alias rather than the host that happens to serve the
application, so it does not change when the service moves. Because a token is required for
every schema pull — public ontologies included — there is no anonymous mode.
Layout
| Module | Responsibility |
|---|---|
cli.py |
ontogate command (validate, login) |
client.py |
OntogateClient SDK — fetch pinned schema + shapes + closure, validate |
registry.py |
Registry API client (token auth) |
validation.py |
Orchestration: assemble graph, run pySHACL, report-scope (design §5) |
context.py |
Contextual mode: bounded context fetch from the target endpoint (§5, §5.1) |
report.py |
Report formats: text / json / jsonld (§8.1) |
auth.py |
Token storage + ontogate login device flow (§9.3) |
models.py |
Core types (SchemaRef, ValidationReport, Violation) |
Develop
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev,aws]"
pytest && ruff check . && mypy src
License: MIT.
Metadata
Release files for ontogate 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ontogate-0.2.2.tar.gz | 68.6 kB | Without provenance | Details for ontogate-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ontogate-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for ontogate-0.2.2-py3-none-any.whl |
Total release size: 92.3 kB
Release files / ontogate-0.2.2.tar.gz
| Download URL | ontogate-0.2.2.tar.gz |
|---|---|
| Size | 68.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0442df083033adc6ea80dbb2c277258b605bd7c0c192a39aae306b9e3cab85b
|
|
BLAKE2b-256 checksum How to use checksums |
cda24c0d1a7cadb156cc229c4120550c4723464e2b3a0f1c3062c4157fde7de6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / ontogate-0.2.2-py3-none-any.whl
| Download URL | ontogate-0.2.2-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce8bcfaf6e35ff982aa68288235fca759259e31336a5921c4a0ddaa01b18b002
|
|
BLAKE2b-256 checksum How to use checksums |
e4b09c064a53f6460decb638ed26a32e9a529556f207680e2748b19fd8b8f8d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for ontogate 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.