How-to guides

Short, goal-directed recipes. Each page answers one question and assumes you already know the basics from the tutorials.

Controlling what is in the environment

Choose what gets loaded

Glob and regex filters, so scanning a directory does not pull in test fixtures, drafts, or half the web.

Work offline and control caching

Run with no network, and control how long cached remote ontologies are trusted.

Rename and alias ontologies

Store a third-party ontology under your own IRI, or route several IRIs to one canonical graph.

Using an environment from code

Use OntoEnv in a long-running service

Connect once at startup, share the environment across requests, and handle multiple worker processes.

Query with SPARQL

Run SPARQL against a closure, a single graph, or the whole environment as an rdflib dataset.

Use your own graph storage

Route graph reads and writes through your own storage instead of OntoEnv’s, and keep the two in sync.

When something is wrong

Recover an interrupted environment

Fix a CatalogRecoveryError after an interrupted write.

Diagnose import problems

Track down a missing import, a duplicate ontology IRI, or an ontology you did not expect to be there.