Metadata-Version: 2.4
Name: ontophora
Version: 2026.7.19
Summary: Typed Pydantic models for OWL 2 ontology constructs
Author-email: Elliott Wise <ell.wise@gmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/wise-ideas/ontochoros/tree/main/packages/ontophora
Project-URL: Documentation, https://wise-ideas.github.io/ontochoros/ontophora/
Project-URL: Source, https://github.com/wise-ideas/ontochoros/tree/main/packages/ontophora
Project-URL: Issues, https://github.com/wise-ideas/ontochoros/issues
Project-URL: Changelog, https://github.com/wise-ideas/ontochoros/releases?q=ontophora
Keywords: owl,owl2,ontology,pydantic,semantic-web
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: language-tags
Requires-Dist: pydantic>=2
Dynamic: license-file

# Ontophora

Typed [Pydantic](https://docs.pydantic.dev/) models for the [OWL 2 structural
specification](https://www.w3.org/TR/owl2-syntax/).

Ontophora represents OWL entities, expressions, axioms, and ontology documents
as validated records, so an OWL-aware application gets construct-level data
that checks itself and travels as plain JSON — without parsing an OWL surface
syntax. Each record has a UID and a fixed construct kind; records refer to one
another by UID rather than nesting an object graph.

## Scope

Ontophora owns:

- Typed models for the OWL 2 structural construct catalog.
- Construct validation, a registry-derived JSON Schema, and reference shapes.
- JSON envelopes for sets of construct records and content fingerprints.

It does not parse or serialize OWL document formats, store a graph, execute
queries, reason over an ontology, or resolve references. Applications that own
a complete record set perform those operations.

## Relationship to the stack

Ontophora is the typed-model library in the wider ontology tooling family. It
is independent of its sister projects:

- [Ontoplexis](https://github.com/wise-ideas/ontochoros/tree/main/packages/ontoplexis) maps OWL/XML to a
  Cypher-queryable graph and back.
- [Ontopoiesis](https://github.com/wise-ideas/ontochoros/tree/main/packages/ontopoiesis) provides operator
  workflows such as build, lint, test, diff, and render on Ontoplexis
  projections.

Neither project currently depends on Ontophora at runtime.

## Install

```bash
pip install ontophora
```

```python
from ontophora import Klass, SubClassOf, records_to_json

animal = Klass(uid="0x1", iri="https://example.org/animals#Animal")
dog = Klass(uid="0x2", iri="https://example.org/animals#Dog")
axiom = SubClassOf(
    uid="0x3",
    sub_class_expression=dog.uid,
    super_class_expression=animal.uid,
)

print(records_to_json([animal, dog, axiom]))
```

## Documentation

Read the [documentation](https://wise-ideas.github.io/ontochoros/ontophora/) for a
tutorial, JSON package guidance, the model rationale, and the API reference.

## License

Ontophora is licensed under the [Apache License 2.0](https://github.com/wise-ideas/ontochoros/blob/main/packages/ontophora/LICENSE).
