# microsoft/ontology-playground architecture

> Architecture diagram of the GitHub repository microsoft/ontology-playground, 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/microsoft/ontology-playground
- Repository: https://github.com/microsoft/ontology-playground

## Overview

Ontology Playground is a static React application for exploring, designing, learning about, and sharing Fabric IQ ontologies. A user can open a catalogue ontology, inspect and search its graph, query it in natural language, or edit a draft and import/export RDF. The README also documents learning courses, quests, embeddable viewing, and catalogue contributions. Edges follow excerpted calls or explicit README capabilities; some documented subsystems lack sampled implementation details, so their internal wiring is not asserted.

Main entry points: [`src/App.tsx`](https://github.com/microsoft/ontology-playground/blob/main/src/App.tsx) (Application shell), [`src/data/ontology.ts`](https://github.com/microsoft/ontology-playground/blob/main/src/data/ontology.ts) (Ontology model), [`src/store/appStore.ts`](https://github.com/microsoft/ontology-playground/blob/main/src/store/appStore.ts) (Application state), [`src/components/designer/DesignerPreview.tsx`](https://github.com/microsoft/ontology-playground/blob/main/src/components/designer/DesignerPreview.tsx) (Designer preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application &amp; navigation"]
  node_app["Application shell<br/>[App.tsx]"]
  node_routing["Hash routing<br/>[router.ts]"]
  node_appstate["Application state<br/>[appStore.ts]"]
  node_header["Navigation header<br/>[Header.tsx]"]
  node_footer["Application footer<br/>[AppFooter.tsx]"]
end

subgraph group_exploration["Ontology exploration"]
  node_ontology["Ontology model<br/>[ontology.ts]"]
  node_catalogue["Ontology catalogue<br/>[catalogue.ts]"]
  node_gallery["Catalogue browser<br/>[GalleryModal.tsx]"]
  node_graph["Interactive graph<br/>[OntologyGraph.tsx]"]
  node_queryui["Query playground"]
  node_queryengine["Natural-language query engine<br/>[queryEngine.ts]"]
end

subgraph group_authoring["Ontology authoring"]
  node_designer["Visual designer"]
  node_designerstate["Designer state<br/>[designerStore.ts]"]
  node_designerpreview["Designer preview"]
  node_rdfparser["RDF parser<br/>[parser.ts]"]
  node_rdfserializer["RDF serializer<br/>[serializer.ts]"]
  node_importexport["Import and export"]
  node_fabricexport["Fabric export"]
end

subgraph group_learning["Learning &amp; guidance"]
  node_learn["Ontology School<br/>[LearnPage.tsx]"]
  node_quests["Quest definitions<br/>[quests.ts]"]
  node_questpanel["Quest guidance<br/>[QuestPanel.tsx]"]
end

subgraph group_exchange["Sharing &amp; integrations"]
  node_embed["Embeddable viewer<br/>[EmbedWidget.tsx]"]
  node_github["Catalogue contribution"]
  node_githubservice["GitHub OAuth proxy<br/>[index.ts]"]
  node_aiapi["Ontology generation API<br/>[index.ts]"]
end

node_user(("User"))
node_githubexternal(("GitHub"))

node_user -->|"uses"| node_app
node_app -->|"reads routes"| node_routing
node_app -->|"loads ontology"| node_appstate
node_app -->|"renders"| node_header
node_app -->|"renders"| node_gallery
node_app -->|"routes to"| node_learn
node_app -->|"opens"| node_designer
node_app -->|"renders"| node_graph
node_app -->|"renders"| node_questpanel
node_app -->|"renders"| node_queryui
node_app -.->|"renders"| node_footer
node_gallery -->|"browses"| node_catalogue
node_catalogue -->|"contains models"| node_ontology
node_appstate -->|"stores current"| node_ontology
node_graph -.->|"reads selection"| node_appstate
node_queryui -->|"processes query"| node_queryengine
node_queryui -->|"reads ontology"| node_appstate
node_queryengine -->|"interprets against"| node_ontology
node_designer -.->|"edits draft"| node_designerstate
node_designerstate -->|"models draft"| node_ontology
node_designer -->|"shows preview"| node_designerpreview
node_designerpreview -->|"reads draft"| node_designerstate
node_designerpreview -->|"serializes preview"| node_rdfserializer
node_designerpreview -->|"parses import"| node_rdfparser
node_rdfparser -->|"produces model"| node_ontology
node_rdfserializer -->|"serializes model"| node_ontology
node_importexport -.->|"imports RDF"| node_rdfparser
node_importexport -.->|"exports RDF"| node_rdfserializer
node_fabricexport -.->|"exports for Fabric"| node_ontology
node_learn -->|"embeds ontology graphs"| node_catalogue
node_questpanel -.->|"updates progress"| node_appstate
node_appstate -->|"loads quests"| node_quests
node_embed -->|"renders ontology"| node_ontology
node_github -->|"opens pull request"| node_githubexternal
node_github -.->|"authenticates through"| node_githubservice
node_githubservice -.->|"proxies OAuth"| node_githubexternal
node_aiapi -.->|"generates ontology"| node_ontology

click node_app "https://github.com/microsoft/ontology-playground/blob/main/src/App.tsx"
click node_routing "https://github.com/microsoft/ontology-playground/blob/main/src/lib/router.ts"
click node_appstate "https://github.com/microsoft/ontology-playground/blob/main/src/store/appStore.ts"
click node_header "https://github.com/microsoft/ontology-playground/blob/main/src/components/Header.tsx"
click node_ontology "https://github.com/microsoft/ontology-playground/blob/main/src/data/ontology.ts"
click node_catalogue "https://github.com/microsoft/ontology-playground/blob/main/src/types/catalogue.ts"
click node_gallery "https://github.com/microsoft/ontology-playground/blob/main/src/components/GalleryModal.tsx"
click node_graph "https://github.com/microsoft/ontology-playground/blob/main/src/components/OntologyGraph.tsx"
click node_queryui "https://github.com/microsoft/ontology-playground/blob/main/src/components/QueryPlayground.tsx"
click node_queryengine "https://github.com/microsoft/ontology-playground/blob/main/src/data/queryEngine.ts"
click node_designer "https://github.com/microsoft/ontology-playground/blob/main/src/components/OntologyDesigner.tsx"
click node_designerstate "https://github.com/microsoft/ontology-playground/blob/main/src/store/designerStore.ts"
click node_designerpreview "https://github.com/microsoft/ontology-playground/blob/main/src/components/designer/DesignerPreview.tsx"
click node_rdfparser "https://github.com/microsoft/ontology-playground/blob/main/src/lib/rdf/parser.ts"
click node_rdfserializer "https://github.com/microsoft/ontology-playground/blob/main/src/lib/rdf/serializer.ts"
click node_importexport "https://github.com/microsoft/ontology-playground/blob/main/src/components/ImportExportModal.tsx"
click node_fabricexport "https://github.com/microsoft/ontology-playground/blob/main/src/components/FabricExportModal.tsx"
click node_learn "https://github.com/microsoft/ontology-playground/blob/main/src/components/LearnPage.tsx"
click node_quests "https://github.com/microsoft/ontology-playground/blob/main/src/data/quests.ts"
click node_questpanel "https://github.com/microsoft/ontology-playground/blob/main/src/components/QuestPanel.tsx"
click node_embed "https://github.com/microsoft/ontology-playground/blob/main/src/components/EmbedWidget.tsx"
click node_github "https://github.com/microsoft/ontology-playground/blob/main/src/components/designer/SubmitCatalogueModal.tsx"
click node_githubservice "https://github.com/microsoft/ontology-playground/blob/main/api/github-oauth-proxy/index.ts"
click node_aiapi "https://github.com/microsoft/ontology-playground/blob/main/api/generate-ontology/index.ts"
click node_footer "https://github.com/microsoft/ontology-playground/blob/main/src/components/AppFooter.tsx"

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_app,node_routing,node_appstate,node_header,node_footer,node_user toneBlue
class node_ontology,node_catalogue,node_gallery,node_graph,node_queryui,node_queryengine toneAmber
class node_designer,node_designerstate,node_designerpreview,node_rdfparser,node_rdfserializer,node_importexport,node_fabricexport toneMint
class node_learn,node_quests,node_questpanel toneRose
class node_embed,node_github,node_githubservice,node_aiapi,node_githubexternal toneIndigo
```

## Components

### Application & navigation

- [Application shell](https://github.com/microsoft/ontology-playground/blob/main/src/App.tsx): `src/App.tsx`
- [Hash routing](https://github.com/microsoft/ontology-playground/blob/main/src/lib/router.ts): `src/lib/router.ts`
- [Application state](https://github.com/microsoft/ontology-playground/blob/main/src/store/appStore.ts): `src/store/appStore.ts`
- [Navigation header](https://github.com/microsoft/ontology-playground/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Application footer](https://github.com/microsoft/ontology-playground/blob/main/src/components/AppFooter.tsx): `src/components/AppFooter.tsx`

### Ontology exploration

- [Ontology model](https://github.com/microsoft/ontology-playground/blob/main/src/data/ontology.ts): `src/data/ontology.ts`
- [Ontology catalogue](https://github.com/microsoft/ontology-playground/blob/main/src/types/catalogue.ts): `src/types/catalogue.ts`
- [Catalogue browser](https://github.com/microsoft/ontology-playground/blob/main/src/components/GalleryModal.tsx): `src/components/GalleryModal.tsx`
- [Interactive graph](https://github.com/microsoft/ontology-playground/blob/main/src/components/OntologyGraph.tsx): `src/components/OntologyGraph.tsx`
- [Query playground](https://github.com/microsoft/ontology-playground/blob/main/src/components/QueryPlayground.tsx): `src/components/QueryPlayground.tsx`
- [Natural-language query engine](https://github.com/microsoft/ontology-playground/blob/main/src/data/queryEngine.ts): `src/data/queryEngine.ts`

### Ontology authoring

- [Visual designer](https://github.com/microsoft/ontology-playground/blob/main/src/components/OntologyDesigner.tsx): `src/components/OntologyDesigner.tsx`
- [Designer state](https://github.com/microsoft/ontology-playground/blob/main/src/store/designerStore.ts): `src/store/designerStore.ts`
- [Designer preview](https://github.com/microsoft/ontology-playground/blob/main/src/components/designer/DesignerPreview.tsx): `src/components/designer/DesignerPreview.tsx`
- [RDF parser](https://github.com/microsoft/ontology-playground/blob/main/src/lib/rdf/parser.ts): `src/lib/rdf/parser.ts`
- [RDF serializer](https://github.com/microsoft/ontology-playground/blob/main/src/lib/rdf/serializer.ts): `src/lib/rdf/serializer.ts`
- [Import and export](https://github.com/microsoft/ontology-playground/blob/main/src/components/ImportExportModal.tsx): `src/components/ImportExportModal.tsx`
- [Fabric export](https://github.com/microsoft/ontology-playground/blob/main/src/components/FabricExportModal.tsx): `src/components/FabricExportModal.tsx`

### Learning & guidance

- [Ontology School](https://github.com/microsoft/ontology-playground/blob/main/src/components/LearnPage.tsx): `src/components/LearnPage.tsx`
- [Quest definitions](https://github.com/microsoft/ontology-playground/blob/main/src/data/quests.ts): `src/data/quests.ts`
- [Quest guidance](https://github.com/microsoft/ontology-playground/blob/main/src/components/QuestPanel.tsx): `src/components/QuestPanel.tsx`

### Sharing & integrations

- [Embeddable viewer](https://github.com/microsoft/ontology-playground/blob/main/src/components/EmbedWidget.tsx): `src/components/EmbedWidget.tsx`
- [Catalogue contribution](https://github.com/microsoft/ontology-playground/blob/main/src/components/designer/SubmitCatalogueModal.tsx): `src/components/designer/SubmitCatalogueModal.tsx`
- [GitHub OAuth proxy](https://github.com/microsoft/ontology-playground/blob/main/api/github-oauth-proxy/index.ts): `api/github-oauth-proxy/index.ts`
- [Ontology generation API](https://github.com/microsoft/ontology-playground/blob/main/api/generate-ontology/index.ts): `api/generate-ontology/index.ts`

### Other components

- **User**
- **GitHub**

## Connections

- User → Application shell: uses
- Application shell → Hash routing: reads routes (evidence: `src/App.tsx`)
- Application shell → Application state: loads ontology (evidence: `src/App.tsx`)
- Application shell → Navigation header: renders (evidence: `src/App.tsx`)
- Application shell → Catalogue browser: renders (evidence: `src/App.tsx`)
- Application shell → Ontology School: routes to
- Application shell → Visual designer: opens (evidence: `src/App.tsx`)
- Application shell → Interactive graph: renders (evidence: `src/App.tsx`)
- Application shell → Quest guidance: renders (evidence: `src/App.tsx`)
- Application shell → Query playground: renders (evidence: `src/App.tsx`)
- Application shell → Application footer: renders
- Catalogue browser → Ontology catalogue: browses
- Ontology catalogue → Ontology model: contains models (evidence: `src/types/catalogue.ts`)
- Application state → Ontology model: stores current (evidence: `src/store/appStore.ts`)
- Interactive graph → Application state: reads selection
- Query playground → Natural-language query engine: processes query (evidence: `src/components/QueryPlayground.tsx`)
- Query playground → Application state: reads ontology (evidence: `src/components/QueryPlayground.tsx`)
- Natural-language query engine → Ontology model: interprets against (evidence: `src/data/queryEngine.ts`)
- Visual designer → Designer state: edits draft
- Designer state → Ontology model: models draft (evidence: `src/store/designerStore.ts`)
- Visual designer → Designer preview: shows preview
- Designer preview → Designer state: reads draft (evidence: `src/components/designer/DesignerPreview.tsx`)
- Designer preview → RDF serializer: serializes preview (evidence: `src/components/designer/DesignerPreview.tsx`)
- Designer preview → RDF parser: parses import (evidence: `src/components/designer/DesignerPreview.tsx`)
- RDF parser → Ontology model: produces model (evidence: `src/lib/rdf/parser.ts`)
- RDF serializer → Ontology model: serializes model (evidence: `src/lib/rdf/serializer.ts`)
- Import and export → RDF parser: imports RDF
- Import and export → RDF serializer: exports RDF
- Fabric export → Ontology model: exports for Fabric
- Ontology School → Ontology catalogue: embeds ontology graphs (evidence: `src/components/LearnPage.tsx`)
- Quest guidance → Application state: updates progress
- Application state → Quest definitions: loads quests (evidence: `src/store/appStore.ts`)
- Embeddable viewer → Ontology model: renders ontology
- Catalogue contribution → GitHub: opens pull request
- Catalogue contribution → GitHub OAuth proxy: authenticates through
- GitHub OAuth proxy → GitHub: proxies OAuth
- Ontology generation API → Ontology model: generates ontology
