orchestrata_ultimate.domaingen
Reference › orchestrata_ultimate › domaingen
Ontology-driven domain model generation (SPEC-105).
The domaingen package generates a domain model from an ontology (SPEC-105). The ontology and the code are two views of one intermediate representation, defined in models, which is the single source of truth.
The flow runs in one direction through the IR. reader parses an OWL or Turtle ontology into the IR. From the IR, ttl renders a Turtle ontology that round-trips with the reader, constraints renders SHACL shapes for Stardog constraint validation, and generator writes screaming-architecture Python packages (entities, a repository and an __init__ per module) from templates. stardog is the small HTTP connection that the generated repositories use to read and write the graph. Everything is deterministic and sorted, so repeated runs are byte-identical, and the generator confines writes to its target and refuses destructive SPARQL. The __init__ module is the facade, and the scripts.domaingen script is the command-line entry point. Start with models, then generator. The curated story is on the domaingen page.
Curated narrative
The hand-written story of this package: orchestrata_ultimate.domaingen.
7 modules, 738 lines of code.
Modules
| Module | Summary | LOC |
|---|---|---|
__init__ |
Ontology-driven domain model generation (SPEC-105). | 43 |
constraints |
IR -> SHACL constraint shapes for Stardog ICV (SPEC-105 FR-008). | 64 |
generator |
DomainModel IR -> screaming-architecture domain code (SPEC-105 FR-004/005/006). | 129 |
models |
Domain-model IR (SPEC-105) — the canonical intermediate representation. | 87 |
reader |
Ontology (OWL / Turtle) -> DomainModel IR via rdflib (SPEC-105 FR-001). | 213 |
stardog |
Minimal Stardog HTTP SPARQL connection (SPEC-105 FR-006 / REQ-105-042). | 84 |
ttl |
DomainModel IR -> Turtle ontology (SPEC-105 FR-002/003). | 118 |