Skip to main content

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.1.0, 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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ontogate 0.2.0
File Size Uploaded Provenance Actions
ontogate-0.2.0.tar.gz 65.0 kB Without provenance Details for ontogate-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ontogate 0.2.0
File Interpreter ABI Platform Actions
ontogate-0.2.0-py3-none-any.whl Python 3 none any Details for ontogate-0.2.0-py3-none-any.whl

Total release size: 86.7 kB

Release files / ontogate-0.2.0.tar.gz

Download URL ontogate-0.2.0.tar.gz
Size 65.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6578544a7c017e7c4d0d1397a694c23a2a4500ebf41cae83ded77ce908573757
BLAKE2b-256 checksum
How to use checksums
e8dd5f7e9f89fd47dd528ce04195b530b45b73ba5450c33e069073d12e683a66
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.0-py3-none-any.whl

Download URL ontogate-0.2.0-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab98f9375f38eae805f85f75c4b20f6f1376cd867d6ff245ebed587d435ea9a5
BLAKE2b-256 checksum
How to use checksums
698b1f28ea142c2c5c2399c4aac4479f5487f29ad710a734539982a48b15ae32
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.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page