# ke-uniliv/animl-ontology architecture

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

- Interactive diagram: https://gitdiagram.com/ke-uniliv/animl-ontology
- Repository: https://github.com/ke-uniliv/animl-ontology

## Overview

AnIML Ontology is a semantic interoperability model for experimental data, with a companion alignment toolkit that generates mappings to Allotrope and other ontologies. The documented ontology workflow is requirements and competency questions expressed in the model, then query/shape validation and downstream knowledge-graph use; the repository tree does not expose the README’s named ontology files, so that subsystem is represented at its existing `ontologies` directory. Alignment source excerpts show an interactive runner dispatching to alignment methods, which can evaluate and serialize mappings. Evidence for the broader model capabilities comes from the README; unsampled implementation links are omitted.

Main entry points: [`ontologies`](https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies) (AnIML Ontology), [`alignments/methods.py`](https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/methods.py) (Alignment Methods), [`alignments/outputs`](https://github.com/ke-uniliv/animl-ontology/tree/main/alignments/outputs) (Mapping Outputs), [`testing`](https://github.com/ke-uniliv/animl-ontology/tree/main/testing) (Validation Results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Semantic Model"]
  node_requirements["Competency Questions"]
  node_animl["AnIML Ontology"]
  node_core["Core Module"]
  node_technique["Technique Module"]
  node_references["Reference Pattern"]
end

subgraph group_align["Ontology Alignment"]
  node_adf["ADF Ontologies"]
  node_runner["Method Runner<br/>[run_methods.py]"]
  node_methods["Alignment Methods<br/>[methods.py]"]
  node_dependencies["Alignment Dependencies"]
  node_evaluation["Mapping Evaluation<br/>[evaluation.py]"]
  node_alignment_outputs["Mapping Outputs"]
end

subgraph group_validation["Validation and Review"]
  node_excel["Mapping Spreadsheet<br/>[excelification.py]"]
  node_queries["Competency Queries"]
  node_shapes["SHACL Constraints"]
  node_validation_results["Validation Results"]
end

node_scientist(("Lab Data User"))

node_scientist -->|"defines questions"| node_requirements
node_requirements -->|"guides model"| node_animl
node_animl -->|"structures experiments"| node_core
node_animl -->|"defines techniques"| node_technique
node_animl -->|"models references"| node_references
node_core -->|"represents data"| node_animl
node_technique -->|"constrains data"| node_animl
node_references -->|"links data slices"| node_animl
node_animl -->|"answers questions"| node_queries
node_queries -->|"checked by queries"| node_validation_results
node_animl -->|"constrained by"| node_shapes
node_shapes -->|"validates structure"| node_validation_results
node_scientist -->|"selects alignment"| node_runner
node_runner -->|"dispatches method"| node_methods
node_methods -->|"uses aligners"| node_dependencies
node_methods -->|"evaluates matches"| node_evaluation
node_methods -->|"writes mappings"| node_alignment_outputs
node_alignment_outputs -.->|"imports mappings"| node_excel
node_animl -->|"aligns with ADF"| node_adf
node_alignment_outputs -.->|"reviewed by experts"| node_validation_results

click node_requirements "https://github.com/ke-uniliv/animl-ontology/tree/main/requirements"
click node_animl "https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies"
click node_core "https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies"
click node_technique "https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies"
click node_references "https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies"
click node_adf "https://github.com/ke-uniliv/animl-ontology/tree/main/alignments/ontologies"
click node_runner "https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/run_methods.py"
click node_methods "https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/methods.py"
click node_dependencies "https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/alignment_dependencies.py"
click node_evaluation "https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/evaluation.py"
click node_alignment_outputs "https://github.com/ke-uniliv/animl-ontology/tree/main/alignments/outputs"
click node_excel "https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/excelification.py"
click node_queries "https://github.com/ke-uniliv/animl-ontology/tree/main/testing"
click node_shapes "https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies"
click node_validation_results "https://github.com/ke-uniliv/animl-ontology/tree/main/testing"

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_requirements,node_animl,node_core,node_technique,node_references,node_scientist toneBlue
class node_adf,node_runner,node_methods,node_dependencies,node_evaluation,node_alignment_outputs toneAmber
class node_excel,node_queries,node_shapes,node_validation_results toneMint
```

## Components

### Semantic Model

- [Competency Questions](https://github.com/ke-uniliv/animl-ontology/tree/main/requirements): `requirements`
- [AnIML Ontology](https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies): `ontologies`
- [Core Module](https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies): `ontologies`
- [Technique Module](https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies): `ontologies`
- [Reference Pattern](https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies): `ontologies`

### Ontology Alignment

- [ADF Ontologies](https://github.com/ke-uniliv/animl-ontology/tree/main/alignments/ontologies): `alignments/ontologies`
- [Method Runner](https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/run_methods.py): `alignments/run_methods.py`
- [Alignment Methods](https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/methods.py): `alignments/methods.py`
- [Alignment Dependencies](https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/alignment_dependencies.py): `alignments/alignment_dependencies.py`
- [Mapping Evaluation](https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/evaluation.py): `alignments/evaluation.py`
- [Mapping Outputs](https://github.com/ke-uniliv/animl-ontology/tree/main/alignments/outputs): `alignments/outputs`

### Validation and Review

- [Mapping Spreadsheet](https://github.com/ke-uniliv/animl-ontology/blob/main/alignments/excelification.py): `alignments/excelification.py`
- [Competency Queries](https://github.com/ke-uniliv/animl-ontology/tree/main/testing): `testing`
- [SHACL Constraints](https://github.com/ke-uniliv/animl-ontology/tree/main/ontologies): `ontologies`
- [Validation Results](https://github.com/ke-uniliv/animl-ontology/tree/main/testing): `testing`

### Other components

- **Lab Data User**

## Connections

- Lab Data User → Competency Questions: defines questions (evidence: `README.md`)
- Competency Questions → AnIML Ontology: guides model (evidence: `README.md`)
- AnIML Ontology → Core Module: structures experiments (evidence: `README.md`)
- AnIML Ontology → Technique Module: defines techniques (evidence: `README.md`)
- AnIML Ontology → Reference Pattern: models references (evidence: `README.md`)
- Core Module → AnIML Ontology: represents data (evidence: `README.md`)
- Technique Module → AnIML Ontology: constrains data (evidence: `README.md`)
- Reference Pattern → AnIML Ontology: links data slices (evidence: `README.md`)
- AnIML Ontology → Competency Queries: answers questions (evidence: `README.md`)
- Competency Queries → Validation Results: checked by queries (evidence: `README.md`)
- AnIML Ontology → SHACL Constraints: constrained by (evidence: `README.md`)
- SHACL Constraints → Validation Results: validates structure (evidence: `README.md`)
- Lab Data User → Method Runner: selects alignment (evidence: `alignments/run_methods.py`)
- Method Runner → Alignment Methods: dispatches method (evidence: `alignments/run_methods.py`)
- Alignment Methods → Alignment Dependencies: uses aligners (evidence: `alignments/methods.py`)
- Alignment Methods → Mapping Evaluation: evaluates matches (evidence: `alignments/methods.py`)
- Alignment Methods → Mapping Outputs: writes mappings (evidence: `alignments/methods.py`)
- Mapping Outputs → Mapping Spreadsheet: imports mappings
- AnIML Ontology → ADF Ontologies: aligns with ADF (evidence: `README.md`)
- Mapping Outputs → Validation Results: reviewed by experts
