# wassimj/topologicpy architecture

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

- Interactive diagram: https://gitdiagram.com/wassimj/topologicpy
- Repository: https://github.com/wassimj/topologicpy

## Overview

TopologicPy is a Python library for spatial modeling and analysis in AEC. The principal workflow is to create information-rich geometric/topological models, attach semantic data, and transform or analyze them as graphs, including through BIM/IFC workflows. Its public modeling API selects a geometry backend; README-described capabilities also include graph algorithms, knowledge representations, interoperability, and AI-assisted analysis. Some subsystem links below are documented capabilities rather than inspected calls; those links are marked dashed with no evidence path.

Main entry points: [`src/topologicpy/Graph.py`](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Graph.py) (Graph algorithms), [`src/topologicpy/Topology.py`](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Topology.py) (Topology API), [`src/topologicpy/IFC.py`](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/IFC.py) (IFC workflows), [`src/topologicpy/Core.py`](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Core.py) (Backend selector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Spatial modeling"]
  node_topology["Topology API<br/>[Topology.py]"]
  node_vertex["Vertex<br/>[Vertex.py]"]
  node_edge["Edge<br/>[Edge.py]"]
  node_face["Face<br/>[Face.py]"]
  node_wire["Wire<br/>[Wire.py]"]
  node_shell["Shell<br/>[Shell.py]"]
  node_cell["Cell<br/>[Cell.py]"]
  node_cellcomplex["Cell complex<br/>[CellComplex.py]"]
  node_cluster["Cluster<br/>[Cluster.py]"]
  node_dictionary["Topology dictionaries<br/>[Dictionary.py]"]
end

subgraph group_backend["Geometry backend"]
  node_core["Backend selector<br/>[Core.py]"]
  node_occ["PythonOCC backend<br/>[topology.py]"]
end

subgraph group_analysis["Graph and analysis"]
  node_graph["Graph algorithms<br/>[Graph.py]"]
  node_tgraph["Topologic graph<br/>[TGraph.py]"]
  node_gql["Graph query executor<br/>[Executor.py]"]
  node_graphdb[("Graph databases<br/>[GraphDB.py]")]
end

subgraph group_semantics["Semantics and AI"]
  node_ontology["Ontology<br/>[Ontology.py]"]
  node_graphrag["GraphRAG<br/>[GraphRAG.py]"]
  node_llm["Language models<br/>[LLM.py]"]
end

subgraph group_interop["BIM and interchange"]
  node_ifc["IFC workflows<br/>[IFC.py]"]
  node_bim["BIM elements<br/>[Element.py]"]
  node_ifcexport["IFC exporter<br/>[exporter.py]"]
  node_step["STEP interchange<br/>[step.py]"]
  node_tpy["TPY interchange<br/>[tpy.py]"]
end

node_user(("Python user"))

node_user -->|"uses API"| node_topology
node_topology -.->|"selects backend"| node_core
node_core -->|"loads backend"| node_occ
node_user -.->|"creates geometry"| node_vertex
node_user -.->|"creates geometry"| node_edge
node_user -.->|"creates geometry"| node_face
node_user -.->|"creates geometry"| node_wire
node_user -.->|"creates geometry"| node_shell
node_user -.->|"creates geometry"| node_cell
node_user -.->|"creates geometry"| node_cellcomplex
node_user -.->|"assembles models"| node_cluster
node_topology -.->|"transforms to graphs"| node_graph
node_graph -.->|"represents relationships"| node_tgraph
node_user -.->|"analyzes graphs"| node_graph
node_user -.->|"queries graphs"| node_gql
node_topology -.->|"carries semantic data"| node_dictionary
node_user -.->|"uses ontology"| node_ontology
node_graph -.->|"supports GraphRAG"| node_graphrag
node_graphrag -->|"uses language models"| node_llm
node_user -.->|"imports BIM"| node_ifc
node_ifc -.->|"models elements"| node_bim
node_bim -->|"stores properties"| node_dictionary
node_ifc -.->|"exports IFC"| node_ifcexport
node_user -.->|"exchanges models"| node_step
node_user -.->|"exchanges models"| node_tpy
node_graph -.->|"integrates databases"| node_graphdb

click node_topology "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Topology.py"
click node_vertex "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Vertex.py"
click node_edge "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Edge.py"
click node_face "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Face.py"
click node_wire "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Wire.py"
click node_shell "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Shell.py"
click node_cell "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Cell.py"
click node_cellcomplex "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/CellComplex.py"
click node_cluster "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Cluster.py"
click node_dictionary "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Dictionary.py"
click node_core "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Core.py"
click node_occ "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/pythonocc_backend/topology.py"
click node_graph "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Graph.py"
click node_tgraph "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/TGraph.py"
click node_gql "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/gql/Executor.py"
click node_ontology "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Ontology.py"
click node_graphrag "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/GraphRAG.py"
click node_llm "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/LLM.py"
click node_ifc "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/IFC.py"
click node_bim "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/ifc/BIM/Element.py"
click node_ifcexport "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/ifc/exporter.py"
click node_step "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/io/step.py"
click node_tpy "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/io/tpy.py"
click node_graphdb "https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/GraphDB.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_topology,node_vertex,node_edge,node_face,node_wire,node_shell,node_cell,node_cellcomplex,node_cluster,node_dictionary,node_user toneBlue
class node_core,node_occ toneAmber
class node_graph,node_tgraph,node_gql,node_graphdb toneMint
class node_ontology,node_graphrag,node_llm toneRose
class node_ifc,node_bim,node_ifcexport,node_step,node_tpy toneIndigo
```

## Components

### Spatial modeling

- [Topology API](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Topology.py): `src/topologicpy/Topology.py`
- [Vertex](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Vertex.py): `src/topologicpy/Vertex.py`
- [Edge](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Edge.py): `src/topologicpy/Edge.py`
- [Face](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Face.py): `src/topologicpy/Face.py`
- [Wire](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Wire.py): `src/topologicpy/Wire.py`
- [Shell](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Shell.py): `src/topologicpy/Shell.py`
- [Cell](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Cell.py): `src/topologicpy/Cell.py`
- [Cell complex](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/CellComplex.py): `src/topologicpy/CellComplex.py`
- [Cluster](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Cluster.py): `src/topologicpy/Cluster.py`
- [Topology dictionaries](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Dictionary.py): `src/topologicpy/Dictionary.py`

### Geometry backend

- [Backend selector](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Core.py): `src/topologicpy/Core.py`
- [PythonOCC backend](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/pythonocc_backend/topology.py): `src/topologicpy/pythonocc_backend/topology.py`

### Graph and analysis

- [Graph algorithms](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Graph.py): `src/topologicpy/Graph.py`
- [Topologic graph](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/TGraph.py): `src/topologicpy/TGraph.py`
- [Graph query executor](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/gql/Executor.py): `src/topologicpy/gql/Executor.py`
- [Graph databases](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/GraphDB.py): `src/topologicpy/GraphDB.py`

### Semantics and AI

- [Ontology](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/Ontology.py): `src/topologicpy/Ontology.py`
- [GraphRAG](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/GraphRAG.py): `src/topologicpy/GraphRAG.py`
- [Language models](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/LLM.py): `src/topologicpy/LLM.py`

### BIM and interchange

- [IFC workflows](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/IFC.py): `src/topologicpy/IFC.py`
- [BIM elements](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/ifc/BIM/Element.py): `src/topologicpy/ifc/BIM/Element.py`
- [IFC exporter](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/ifc/exporter.py): `src/topologicpy/ifc/exporter.py`
- [STEP interchange](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/io/step.py): `src/topologicpy/io/step.py`
- [TPY interchange](https://github.com/wassimj/topologicpy/blob/main/src/topologicpy/io/tpy.py): `src/topologicpy/io/tpy.py`

### Other components

- **Python user**

## Connections

- Python user → Topology API: uses API
- Topology API → Backend selector: selects backend
- Backend selector → PythonOCC backend: loads backend (evidence: `src/topologicpy/Core.py`)
- Python user → Vertex: creates geometry
- Python user → Edge: creates geometry
- Python user → Face: creates geometry
- Python user → Wire: creates geometry
- Python user → Shell: creates geometry
- Python user → Cell: creates geometry
- Python user → Cell complex: creates geometry
- Python user → Cluster: assembles models
- Topology API → Graph algorithms: transforms to graphs
- Graph algorithms → Topologic graph: represents relationships
- Python user → Graph algorithms: analyzes graphs
- Python user → Graph query executor: queries graphs
- Topology API → Topology dictionaries: carries semantic data (evidence: `src/topologicpy/Dictionary.py`)
- Python user → Ontology: uses ontology
- Graph algorithms → GraphRAG: supports GraphRAG (evidence: `src/topologicpy/GraphRAG.py`)
- GraphRAG → Language models: uses language models (evidence: `src/topologicpy/GraphRAG.py`)
- Python user → IFC workflows: imports BIM
- IFC workflows → BIM elements: models elements
- BIM elements → Topology dictionaries: stores properties (evidence: `src/topologicpy/ifc/BIM/Element.py`)
- IFC workflows → IFC exporter: exports IFC
- Python user → STEP interchange: exchanges models
- Python user → TPY interchange: exchanges models
- Graph algorithms → Graph databases: integrates databases
