How microsoft/ontology-playground works
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: App.tsx Application shell · ontology.ts Ontology model · appStore.ts Application state · DesignerPreview.tsx Designer preview
Components 27
Application & navigation
- Application shell
src/App.tsx - Hash routing
src/lib/router.ts - Application state
src/store/appStore.ts - Navigation header
src/components/Header.tsx - Application footer
src/components/AppFooter.tsx
Ontology exploration
- Ontology model
src/data/ontology.ts - Ontology catalogue
src/types/catalogue.ts - Catalogue browser
src/components/GalleryModal.tsx - Interactive graph
src/components/OntologyGraph.tsx - Query playground
src/components/QueryPlayground.tsx - Natural-language query engine
src/data/queryEngine.ts
Ontology authoring
- Visual designer
src/components/OntologyDesigner.tsx - Designer state
src/store/designerStore.ts - Designer preview
src/components/designer/DesignerPreview.tsx - RDF parser
src/lib/rdf/parser.ts - RDF serializer
src/lib/rdf/serializer.ts - Import and export
src/components/ImportExportModal.tsx - Fabric export
src/components/FabricExportModal.tsx
Learning & guidance
- Ontology School
src/components/LearnPage.tsx - Quest definitions
src/data/quests.ts - Quest guidance
src/components/QuestPanel.tsx
Sharing & integrations
- Embeddable viewer
src/components/EmbedWidget.tsx - Catalogue contribution
src/components/designer/SubmitCatalogueModal.tsx - GitHub OAuth proxy
api/github-oauth-proxy/index.ts - Ontology generation API
api/generate-ontology/index.ts
Other components
- User
- GitHub
Connections 37
- User → Application shell: uses
- Application shell → Hash routing: reads routes
src/App.tsx - Application shell → Application state: loads ontology
src/App.tsx - Application shell → Navigation header: renders
src/App.tsx - Application shell → Catalogue browser: renders
src/App.tsx - Application shell → Ontology School: routes to
- Application shell → Visual designer: opens
src/App.tsx - Application shell → Interactive graph: renders
src/App.tsx - Application shell → Quest guidance: renders
src/App.tsx - Application shell → Query playground: renders
src/App.tsx - Application shell → Application footer: renders
- Catalogue browser → Ontology catalogue: browses
- Ontology catalogue → Ontology model: contains models
src/types/catalogue.ts - Application state → Ontology model: stores current
src/store/appStore.ts - Interactive graph → Application state: reads selection
- Query playground → Natural-language query engine: processes query
src/components/QueryPlayground.tsx - Query playground → Application state: reads ontology
src/components/QueryPlayground.tsx - Natural-language query engine → Ontology model: interprets against
src/data/queryEngine.ts - Visual designer → Designer state: edits draft
- Designer state → Ontology model: models draft
src/store/designerStore.ts - Visual designer → Designer preview: shows preview
- Designer preview → Designer state: reads draft
src/components/designer/DesignerPreview.tsx - Designer preview → RDF serializer: serializes preview
src/components/designer/DesignerPreview.tsx - Designer preview → RDF parser: parses import
src/components/designer/DesignerPreview.tsx - RDF parser → Ontology model: produces model
src/lib/rdf/parser.ts - RDF serializer → Ontology model: serializes model
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
src/components/LearnPage.tsx - Quest guidance → Application state: updates progress
- Application state → Quest definitions: loads quests
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