OntoEnv

A fast, lightweight environment manager for RDF ontologies — resolve imports, compute transitive closures, and work with ontology graphs from the CLI, Python, or Rust.
crates.io PyPI docs.rs GitHub License
pip install ontoenv    cargo install ontoenv-cli
🧩

Import resolution

Automatically follows owl:imports declarations to fetch and cache every transitive dependency.

📊

Dependency graph

Builds a petgraph-backed directed graph so you can query closures, find roots, and detect cycles.

Fast on-disk store

Persists the environment in a compact binary RDF5D format — restores in milliseconds without re-parsing.

🐍

Python bindings

Full PyO3 bindings expose every feature to Python, with native rdflib graph interop.

🔧

Flexible filtering

Glob and regex filters on file paths and ontology IRIs let you include exactly what you need.

🌐

Remote caching

Fetches remote ontologies over HTTP and caches them locally with a configurable TTL.

Quick start

# Initialize a workspace from a directory of ontology files
ontoenv init ./ontologies

# List everything that was discovered
ontoenv list ontologies

# Get the full transitive closure for one ontology
ontoenv closure https://example.com/myOntology
from ontoenv import OntoEnv

env = OntoEnv(
    path=".",
    recreate=True,
    search_directories=["./ontologies"],
    includes=["*.ttl"],
)

# Get a merged rdflib graph of an ontology and all its imports
g = env.get_closure("https://example.com/myOntology")

Explore the docs


Need a plain-text snapshot for LLM ingestion? Grab llms.txt.