# vadim-schultz/ontolog architecture

> Architecture diagram of the GitHub repository vadim-schultz/ontolog, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vadim-schultz/ontolog
- Repository: https://github.com/vadim-schultz/ontolog

## Overview

Ontolog infers probabilistic domain models from application logs and exports the result. The main path is logs → normalized records → mined templates and occurrences → scored evidence → inference and aggregation → export. The graph keeps ingestion, template mining/storage, evidence providers, inference, and export distinct, while treating the pipeline as the orchestrator. README documents the major provider and export capabilities; unsampled implementation details are represented at their existing directory paths, and edges without direct source evidence are documented relationships.

Main entry points: [`src/ontolog/pipeline.py`](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/pipeline.py) (Inference pipeline), [`src/ontolog/templates/extractor.py`](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/templates/extractor.py) (Template extraction), [`src/ontolog/export/registry.py`](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/export/registry.py) (Export registry), [`src/ontolog/evidence/graph.py`](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/evidence/graph.py) (Evidence graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Log ingestion"]
  node_ingest["Log parsers"]
  node_records["Log records<br/>[log_record.py]"]
end

subgraph group_mining["Template mining"]
  node_extract["Template extraction<br/>[extractor.py]"]
  node_templates["Templates and occurrences<br/>[template.py]"]
  node_store[("SQLite template store<br/>[sqlite.py]")]
end

subgraph group_evidence["Evidence analysis"]
  node_providers["Evidence providers"]
  node_evidence_graph["Evidence graph<br/>[graph.py]"]
  node_evidence_models["Evidence records<br/>[evidence.py]"]
end

subgraph group_modeling["Domain modeling"]
  node_inference["Inference passes"]
  node_aggregation["Probabilistic aggregation"]
  node_domain["Domain model<br/>[domain.py]"]
end

subgraph group_export["Model export"]
  node_export_registry["Export registry<br/>[registry.py]"]
  node_exporters["Format exporters"]
  node_pydantic["Pydantic generator<br/>[pydantic_gen.py]"]
  node_export_formats["Export formats<br/>[formats.py]"]
end

node_logs(("Raw logs"))
node_cli["Infer CLI<br/>[commands.py]"]
node_pipeline["Inference pipeline<br/>[pipeline.py]"]
node_artifact["Exported artifact"]

node_logs -->|"supplied to"| node_cli
node_cli -->|"calls"| node_pipeline
node_pipeline -->|"selects format"| node_ingest
node_ingest -->|"parses into"| node_records
node_pipeline -->|"runs extraction"| node_extract
node_extract -->|"ingests records"| node_ingest
node_extract -->|"mines"| node_templates
node_extract -->|"persists"| node_store
node_pipeline -->|"builds from store"| node_store
node_store -->|"stores"| node_templates
node_templates -->|"analyzed by"| node_providers
node_providers -->|"add evidence to"| node_evidence_graph
node_evidence_graph -->|"contains records"| node_evidence_models
node_pipeline -->|"builds model"| node_inference
node_evidence_graph -->|"informs"| node_inference
node_inference -->|"feeds"| node_aggregation
node_aggregation -->|"produces"| node_domain
node_pipeline -->|"dispatches export"| node_export_registry
node_domain -->|"exported through"| node_export_registry
node_export_registry -->|"dispatches formats"| node_exporters
node_exporters -->|"includes generator"| node_pydantic
node_exporters -->|"supports formats"| node_export_formats
node_export_registry -->|"renders"| node_artifact

click node_cli "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/cli/infer/commands.py"
click node_pipeline "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/pipeline.py"
click node_ingest "https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/ingestion"
click node_records "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/models/log_record.py"
click node_extract "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/templates/extractor.py"
click node_templates "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/models/template.py"
click node_store "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/storage/sqlite.py"
click node_providers "https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/providers"
click node_evidence_graph "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/evidence/graph.py"
click node_evidence_models "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/models/evidence.py"
click node_inference "https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/inference"
click node_aggregation "https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/inference/aggregate"
click node_domain "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/models/domain.py"
click node_export_registry "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/export/registry.py"
click node_exporters "https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/export/exporters"
click node_pydantic "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/export/exporters/pydantic_gen.py"
click node_export_formats "https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/export/formats.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ingest,node_records toneBlue
class node_extract,node_templates,node_store toneAmber
class node_providers,node_evidence_graph,node_evidence_models toneMint
class node_inference,node_aggregation,node_domain toneRose
class node_export_registry,node_exporters,node_pydantic,node_export_formats,node_logs,node_pipeline,node_artifact toneIndigo
class node_cli toneTeal
```

## Components

### Log ingestion

- [Log parsers](https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/ingestion): `src/ontolog/ingestion`
- [Log records](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/models/log_record.py): `src/ontolog/models/log_record.py`

### Template mining

- [Template extraction](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/templates/extractor.py): `src/ontolog/templates/extractor.py`
- [Templates and occurrences](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/models/template.py): `src/ontolog/models/template.py`
- [SQLite template store](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/storage/sqlite.py): `src/ontolog/storage/sqlite.py`

### Evidence analysis

- [Evidence providers](https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/providers): `src/ontolog/providers`
- [Evidence graph](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/evidence/graph.py): `src/ontolog/evidence/graph.py`
- [Evidence records](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/models/evidence.py): `src/ontolog/models/evidence.py`

### Domain modeling

- [Inference passes](https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/inference): `src/ontolog/inference`
- [Probabilistic aggregation](https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/inference/aggregate): `src/ontolog/inference/aggregate`
- [Domain model](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/models/domain.py): `src/ontolog/models/domain.py`

### Model export

- [Export registry](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/export/registry.py): `src/ontolog/export/registry.py`
- [Format exporters](https://github.com/vadim-schultz/ontolog/tree/main/src/ontolog/export/exporters): `src/ontolog/export/exporters`
- [Pydantic generator](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/export/exporters/pydantic_gen.py): `src/ontolog/export/exporters/pydantic_gen.py`
- [Export formats](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/export/formats.py): `src/ontolog/export/formats.py`

### Other components

- **Raw logs**
- [Infer CLI](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/cli/infer/commands.py): `src/ontolog/cli/infer/commands.py`
- [Inference pipeline](https://github.com/vadim-schultz/ontolog/blob/main/src/ontolog/pipeline.py): `src/ontolog/pipeline.py`
- **Exported artifact**

## Connections

- Raw logs → Infer CLI: supplied to (evidence: `README.md`)
- Infer CLI → Inference pipeline: calls (evidence: `src/ontolog/cli/infer/commands.py`)
- Inference pipeline → Log parsers: selects format (evidence: `src/ontolog/pipeline.py`)
- Log parsers → Log records: parses into (evidence: `src/ontolog/ingestion/reader.py`)
- Inference pipeline → Template extraction: runs extraction (evidence: `src/ontolog/pipeline.py`)
- Template extraction → Log parsers: ingests records (evidence: `src/ontolog/templates/extractor.py`)
- Template extraction → Templates and occurrences: mines (evidence: `README.md`)
- Template extraction → SQLite template store: persists (evidence: `src/ontolog/templates/extractor.py`)
- Inference pipeline → SQLite template store: builds from store (evidence: `src/ontolog/pipeline.py`)
- SQLite template store → Templates and occurrences: stores (evidence: `src/ontolog/storage/sqlite.py`)
- Templates and occurrences → Evidence providers: analyzed by (evidence: `README.md`)
- Evidence providers → Evidence graph: add evidence to (evidence: `README.md`)
- Evidence graph → Evidence records: contains records (evidence: `src/ontolog/evidence/graph.py`)
- Inference pipeline → Inference passes: builds model (evidence: `src/ontolog/pipeline.py`)
- Evidence graph → Inference passes: informs (evidence: `README.md`)
- Inference passes → Probabilistic aggregation: feeds (evidence: `README.md`)
- Probabilistic aggregation → Domain model: produces (evidence: `README.md`)
- Inference pipeline → Export registry: dispatches export (evidence: `src/ontolog/pipeline.py`)
- Domain model → Export registry: exported through (evidence: `src/ontolog/export/registry.py`)
- Export registry → Format exporters: dispatches formats (evidence: `src/ontolog/export/registry.py`)
- Format exporters → Pydantic generator: includes generator (evidence: `src/ontolog/export/registry.py`)
- Format exporters → Export formats: supports formats (evidence: `src/ontolog/export/registry.py`)
- Export registry → Exported artifact: renders
