Skip to main content

Lightweight Python bridge to the Oxigraph RDF/OWL engine, MCP server included. No Rust toolchain, no compilation.

Project description

Open Ontologies Lite (Python bridge)

A lightweight, pip-installable Python bridge to the same Oxigraph RDF/OWL engine that powers Open Ontologies. No Rust toolchain, no compilation, no multi-gigabyte build directorypyoxigraph ships the engine as a prebuilt wheel, so everything here is pure-Python glue installed from PyPI.

It exposes the core ontology lifecycle as both a Python library and an MCP server.

Why this exists

The full Rust engine compiles a large dependency tree from source (5+ GB of build artifacts, heavy SSD churn). This bridge is the opposite trade: install in seconds, run anywhere Python runs, keep the Oxigraph SPARQL engine underneath. It covers the core surface (validate, load, query, diff, lint, convert, stats, save), not the full 100-tool engine.

Install

pip install open-ontologies-lite        # one universal wheel, no compiler

Use as a Python library

from open_ontologies_lite import OntologyEngine

engine = OntologyEngine()
engine.load(open("ontology.ttl").read())          # load Turtle
print(engine.stats())                              # {'triples':..,'classes':..,..}

rows = engine.query(
    "SELECT ?c WHERE { ?c a <http://www.w3.org/2002/07/owl#Class> }"
)
print([r["c"] for r in rows["rows"]])

print(engine.lint())                               # missing labels/domains/ranges
print(OntologyEngine.convert(ttl, "turtle", "ntriples"))

See examples/python_usage.py for a runnable end-to-end script.

Use as an MCP server

open-ontologies-lite          # stdio MCP server
# or: python -m open_ontologies_lite

Register it with any MCP client (e.g. Claude):

{
  "mcpServers": {
    "open-ontologies-lite": { "command": "open-ontologies-lite" }
  }
}

Tools

Tool Purpose
onto_validate Parse RDF/OWL and report syntax validity + triple count (no load)
onto_load / onto_load_file Load RDF text or a file into the in-memory store
onto_clear Reset the store
onto_stats Triple / class / property / individual counts
onto_query SPARQL SELECT / ASK / CONSTRUCT / DESCRIBE
onto_save Serialize the store to a file
onto_convert Convert between Turtle / N-Triples / N-Quads / TriG / RDF-XML / N3 / JSON-LD
onto_diff Triple-level diff between two ontologies
onto_lint Missing labels, domains, ranges

Relationship to the Rust engine

This is the Python layer of the project. For the full engine (three-layer Dynamics/Causal/Planner architecture, HNSW semantic search, OWL2-DL tableaux reasoning, PDDL planning, governance, 100 tools), use the Rust build. Same Oxigraph core; pick the weight class you need.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_ontologies_lite-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_ontologies_lite-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file open_ontologies_lite-0.1.0.tar.gz.

File metadata

  • Download URL: open_ontologies_lite-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for open_ontologies_lite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0ddd469cb7c071635c395438776d4b5cedeabe363f5dae6a7d432c39a4c07703
MD5 0df6c4275827aefcc8100eb014ca4760
BLAKE2b-256 7537b790f79e8f362c3cc55362b80e37d5a58a4df00af0a1dce0af53091feed9

See more details on using hashes here.

File details

Details for the file open_ontologies_lite-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for open_ontologies_lite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23dcb472ca616e60f348688a9b23fbc7d55e40976bc7c4c7e86f0bf0b7f97e97
MD5 b841ecffbc94447b0bb8076a4a52f75b
BLAKE2b-256 71a54a511c94c77ec03f7ae8aa83ac644c8515ddece082f7ecea38e8c08d680c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page