# ukparliament/ontologies architecture

> Architecture diagram of the GitHub repository ukparliament/ontologies, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ukparliament/ontologies
- Repository: https://github.com/ukparliament/ontologies

## Overview

##### Main Components

a) Ontology Layer
- Various ontology domains (bill, agency, citation, etc.)
- Relationships between ontological concepts

b) Documentation System
- HTML generation pipeline
- Documentation templates
- GitHub Pages integration

c) Metadata Management
- Meta directory structure
- Configuration files
- Documentation generation scripts

d) Procedure Maps
- Legislative procedures
- Treaty procedures
- Committee workflows

##### Architectural Patterns to Highlight

a) Core Architecture
- TTL (Turtle) files containing RDF triples
- HTML representation layer
- Python/Ruby documentation generators

b) Integration Points
- GitHub Actions for CI/CD
- Documentation publishing workflow
- Version control integration

**[Documentation Layer]**
- ↑
**[Ontology Processing Layer]**
- ↑
**[Core Ontology Definitions]**
- ↑
**[Source Files Layer]**

##### Key Relationships

- How ontologies relate to each other
- Documentation generation flow
- GitHub Actions integration
- Procedure map relationships
- Meta-data management flow

##### Implementation Details

- File formats (.ttl, .html, .graffle)
- Automation points
- Validation steps
- Publication endpoints

**[GitHub Actions CI/CD]**
- ↓
**[Source Control Layer]**
- ↓
**[Ontology Definition Layer]**
- [Domain Ontologies]
- [Procedure Maps]
- [Metadata]
- ↓
**[Processing Layer]**
- [Documentation Generation]
- [Validation]
- ↓
**[Publication Layer]**
- [GitHub Pages]
- [HTML Documentation]

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph CI["CI/CD Layer"]
        GHA["GitHub Actions"]:::cicd
    end

    subgraph SRC["Source Control Layer"]
        TTL["TTL Source Files"]:::source
        GRAFF["Graffle Diagrams"]:::source
    end

    subgraph ONT["Ontology Definition Layer"]
        subgraph DOM["Domain Ontologies"]
            BILL["Bill Domain"]:::ontology
            AGENCY["Agency Domain"]:::ontology
            CIT["Citation Domain"]:::ontology
            CORE["Core Ontology"]:::ontology
        end

        subgraph PROC["Procedure Maps"]
            LEG["Legislative Procedures"]:::procedure
            TREATY["Treaty Procedures"]:::procedure
            COMM["Committee Workflows"]:::procedure
        end

        subgraph META["Metadata Management"]
            CONF["Configuration"]:::meta
            VAL["Validation"]:::meta
        end
    end

    subgraph PROC_LAYER["Processing Layer"]
        DOC_GEN["Documentation Generator"]:::processing
        VAL_PROC["Validation Process"]:::processing
    end

    subgraph PUB["Publication Layer"]
        GH_PAGES["GitHub Pages"]:::publication
        HTML_DOC["HTML Documentation"]:::publication
        CSS["CSS Styling"]:::publication
    end

    GHA --> TTL
    GHA --> GRAFF
    TTL --> DOM
    GRAFF --> DOM
    DOM --> PROC
    DOM --> META
    PROC --> DOC_GEN
    META --> VAL_PROC
    DOC_GEN --> HTML_DOC
    VAL_PROC --> HTML_DOC
    HTML_DOC --> GH_PAGES
    CSS --> HTML_DOC

    %% Click Events
    click BILL "https://github.com/ukparliament/ontologies/blob/master/bill/bill-ontology.ttl"
    click AGENCY "https://github.com/ukparliament/ontologies/blob/master/agency/agency-ontology.ttl"
    click CIT "https://github.com/ukparliament/ontologies/blob/master/citation/citation-ontology.ttl"
    click CORE "https://github.com/ukparliament/ontologies/blob/master/procedure/procedure-ontology.ttl"
    click DOC_GEN "https://github.com/ukparliament/ontologies/blob/master/meta/generate-docs.py"
    click HTML_DOC "https://github.com/ukparliament/ontologies/tree/master/meta/html/"
    click CSS "https://github.com/ukparliament/ontologies/blob/master/meta/assets/css.css"
    click CONF "https://github.com/ukparliament/ontologies/tree/master/meta/meta/"
    click VAL "https://github.com/ukparliament/ontologies/blob/master/meta/validator.py"
    click LEG "https://github.com/ukparliament/ontologies/tree/master/procedure/maps/legislation/"
    click TREATY "https://github.com/ukparliament/ontologies/tree/master/procedure/maps/treaties/"
    click COMM "https://github.com/ukparliament/ontologies/tree/master/procedure/maps/legislation/secondary/statutory-instruments/components/"
    click GHA "https://github.com/ukparliament/ontologies/blob/master/.github/workflows/docs.yml"

    %% Styling
    classDef ontology fill:#3498db,stroke:#2980b9,color:white
    classDef procedure fill:#e67e22,stroke:#d35400,color:white
    classDef meta fill:#9b59b6,stroke:#8e44ad,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef publication fill:#e74c3c,stroke:#c0392b,color:white
    classDef source fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef cicd fill:#f1c40f,stroke:#f39c12,color:black

    %% Legend
    subgraph Legend
        L1["Ontology"]:::ontology
        L2["Procedure"]:::procedure
        L3["Metadata"]:::meta
        L4["Processing"]:::processing
        L5["Publication"]:::publication
        L6["Source"]:::source
        L7["CI/CD"]:::cicd
    end
```
