Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

90 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ Universal Ontology Definition

An Open, Standardized Four-Layer Enterprise Ontology Framework

Anti-entropy by design โ€” structured, governed, and built to scale.

License Version PRs Welcome

ไธญๆ–‡ | English


๐Ÿ“– What is Universal Ontology Definition?

Universal Ontology Definition (UOD) is an open, standardized four-layer enterprise ontology framework designed to provide a unified conceptual modeling foundation for enterprise knowledge graphs, semantic layers, master data management, and AI Agent knowledge bases.

๐Ÿ”ด The Problem

Enterprise digitalization commonly faces:

  • Inconsistent concept definitions โ€” Different teams use different terms for the same objects, making cross-system reuse difficult.
  • Industry knowledge silos โ€” Industry-specific knowledge is scattered with no standardized extension mechanism.
  • Customization vs. standardization conflicts โ€” Enterprise-specific needs continuously erode the underlying structure.
  • Platform lock-in โ€” Ontology definitions tied to a single serialization format, limiting interoperability.

๐ŸŸข The Solution: Four-Layer Architecture

flowchart TD
    classDef layer3 fill:#f8f9fa,stroke:#dee2e6,stroke-width:2px,stroke-dasharray: 5 5,color:#495057
    classDef layer2 fill:#e9ecef,stroke:#ced4da,stroke-width:2px,color:#495057
    classDef layer1 fill:#e0f3ff,stroke:#0d6efd,stroke-width:2px,color:#0a58ca,font-weight:bold
    classDef layer0 fill:#f8f9fa,stroke:#dee2e6,stroke-width:2px,color:#6c757d
    classDef label fill:none,stroke:none,color:#6c757d,font-size:12px
    
    L3["<b>L3: Enterprise Customization Layer</b><br/><span style='font-size:13px'>Company A | Company B | Company C</span>"]:::layer3
    L2["<b>L2: Industry & Domain Extensions</b><br/><span style='font-size:13px'>Common | Consulting | Luxury | Finance | Manufacturing</span>"]:::layer2
    L1["<b>L1: Universal Enterprise Ontology Core (v2.0)</b><br/>Entity ๐Ÿ”ธ Governance ๐Ÿ”ธ Operational ๐Ÿ”ธ Measurement"]:::layer1
    L0["<b>L0: Platform & Syntax Bindings</b><br/><span style='font-size:13px'>OWL/RDF | JSON-LD | GraphQL | SQL DDL</span>"]:::layer0

    L3 -. "Private extensions (Optional)" .-> L2
    L3 -. "Mandatory inheritance" .-> L1
    L2 -- "Pluggable domain models" --> L1
    L1 == "Binds to" ==> L0
Loading

โœจ Key Features

  • ๐Ÿ—๏ธ Four-Layer Separation โ€” Stable semantic core, pluggable Industry and Domain Extension, free enterprise customization, and multi-platform bindings.
  • ๐Ÿ›ก๏ธ Anti-Entropy by Design โ€” 4 abstract domain roots, hard class caps, governance rules, and CI validation prevent ontology sprawl.
  • ๐Ÿ“ Standardized Definition Format โ€” Unified JSON Schema with lifecycle management (status, since, deprecated_since).
  • ๐Ÿ”— Inheritance & Extension โ€” L2 extends L1, L3 extends L1+L2, with generalized domain/range relations.
  • โš™๏ธ Platform Bindings โ€” L0 provides ready-to-use OWL/RDF, JSON-LD, GraphQL, and SQL mappings.
  • ๐ŸŒ Bilingual Support โ€” All concepts include Chinese and English labels and definitions.
  • ๐Ÿค Community-Driven โ€” Anyone can contribute Industry and Domain Extensions, platform bindings, or improve core definitions.
  • ๐Ÿ–ฅ๏ธ Ontology Studio โ€” Production-ready visual web workspace for browsing and managing all ontology layers.

๐Ÿ–ฅ๏ธ Ontology Studio

A production-ready Next.js web application for visually browsing, searching, and managing the ontology across all four layers.

  • Multi-Layer Visual Editors โ€” Interactive node graphs for L0 (Platform), L1 (Core), L2 (Extensions), and L3 (Enterprise) layers.
  • Live GitHub Sync โ€” Reads ontology data directly from the repository via GitHub API in real time.
  • Role-Based Access Control โ€” GitHub OAuth with three roles (Admin / Editor / Viewer) backed by Netlify Blobs.
  • Public Read-Only Access โ€” Anonymous users can browse the full ontology; only the admin panel requires login.

Live Demo: ontologystudio.netlify.app | Source code in studio/.

Local Development

cd studio
npm install

Create studio/.env.local with the following variables:

GITHUB_TOKEN=ghp_your_personal_access_token
GITHUB_REPO_OWNER=your-github-username
GITHUB_REPO_NAME=universal-ontology-definition
GITHUB_ID=your_oauth_app_client_id
GITHUB_SECRET=your_oauth_app_client_secret
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=any-random-secret-string
SUPER_ADMIN=your-github-username

Then start the dev server:

npm run dev

GITHUB_ID and GITHUB_SECRET come from a GitHub OAuth App. Set the callback URL to http://localhost:3000/api/auth/callback/github.

Deploy to Netlify

  1. Create a new site on Netlify linked to your GitHub repo.
  2. Build settings (auto-detected from netlify.toml):
    • Base directory: studio
    • Build command: npm run build
    • Publish directory: studio/.next
  3. Environment variables โ€” add the same variables as above in Netlify's site settings (Settings > Environment variables), but set NEXTAUTH_URL to your deployed URL (e.g. https://your-site.netlify.app).
  4. Deploy. The @netlify/plugin-nextjs plugin handles SSR and serverless functions automatically.

Permission data (user roles) is stored in Netlify Blobs โ€” no external database required.


๐Ÿ“ Repository Structure

.
โ”œโ”€โ”€ l1-core/                    # L1 Universal Enterprise Ontology Core
โ”‚   โ””โ”€โ”€ universal_ontology_v1.json
โ”œโ”€โ”€ l2-extensions/              # L2 Industry & Domain Extensions
โ”‚   โ”œโ”€โ”€ consulting/             #   โ””โ”€โ”€ Consulting Industry
โ”‚   โ”œโ”€โ”€ financial-services/     #   โ””โ”€โ”€ Financial Services (Banking, Insurance, Asset Mgmt)
โ”‚   โ”œโ”€โ”€ fnb/                    #   โ””โ”€โ”€ Food & Beverage
โ”‚   โ”œโ”€โ”€ healthcare/             #   โ””โ”€โ”€ Healthcare (Clinical, Pharma, Medical Devices)
โ”‚   โ”œโ”€โ”€ luxury-goods/           #   โ””โ”€โ”€ Luxury Goods
โ”‚   โ”œโ”€โ”€ manufacturing/          #   โ””โ”€โ”€ Manufacturing (Factory Ops, MES, Quality)
โ”‚   โ”œโ”€โ”€ technology/             #   โ””โ”€โ”€ Technology (SaaS, DevOps, AI/ML)
โ”‚   โ””โ”€โ”€ _template/              #   โ””โ”€โ”€ Extension Contribution Template
โ”œโ”€โ”€ l3-enterprise/              # L3 Enterprise Examples
โ”‚   โ”œโ”€โ”€ acme-tech-solutions/    #   โ””โ”€โ”€ Sample Virtual Enterprise
โ”‚   โ””โ”€โ”€ _template/              #   โ””โ”€โ”€ Enterprise Layer Template
โ”œโ”€โ”€ l0-platform/                # L0 Platform & Syntax Bindings
โ”‚   โ”œโ”€โ”€ owl-rdf/                #   โ””โ”€โ”€ OWL 2 / RDF Turtle
โ”‚   โ”œโ”€โ”€ json-ld/                #   โ””โ”€โ”€ JSON-LD Context
โ”‚   โ”œโ”€โ”€ graphql/                #   โ””โ”€โ”€ GraphQL Schema
โ”‚   โ”œโ”€โ”€ sql/                    #   โ””โ”€โ”€ PostgreSQL DDL
โ”‚   โ””โ”€โ”€ _template/              #   โ””โ”€โ”€ Platform Binding Template
โ”œโ”€โ”€ scripts/                    # Tooling & Automation
โ”‚   โ”œโ”€โ”€ validate_governance.py  #   โ””โ”€โ”€ L1 Governance Validator
โ”‚   โ”œโ”€โ”€ validate_l3.py          #   โ””โ”€โ”€ L2/L3 Referential Integrity Validator
โ”‚   โ”œโ”€โ”€ merge_layers.py         #   โ””โ”€โ”€ Multi-Layer Merger (L1+L2+L3 โ†’ 5 formats)
โ”‚   โ”œโ”€โ”€ visualize_ontology.py   #   โ””โ”€โ”€ Interactive HTML Visualization Generator
โ”‚   โ”œโ”€โ”€ diff_ontology.py        #   โ””โ”€โ”€ Structural Diff Between Versions
โ”‚   โ”œโ”€โ”€ export_for_llm.py       #   โ””โ”€โ”€ LLM Export (System Prompt, Tools, RAG Chunks)
โ”‚   โ”œโ”€โ”€ export_neo4j.py         #   โ””โ”€โ”€ Neo4j Cypher Import Generator
โ”‚   โ””โ”€โ”€ json_to_owl.py          #   โ””โ”€โ”€ JSON โ†’ OWL/RDF Turtle Converter
โ”œโ”€โ”€ studio/                     # Ontology Studio (Next.js Web App)
โ”‚   โ”œโ”€โ”€ app/                    #   โ””โ”€โ”€ Pages, layouts, API routes
โ”‚   โ”œโ”€โ”€ components/             #   โ””โ”€โ”€ React components (editors, flow graphs)
โ”‚   โ””โ”€โ”€ lib/                    #   โ””โ”€โ”€ Auth, permissions, GitHub integration
โ”œโ”€โ”€ docs-site/                  # MkDocs Documentation Site Source
โ””โ”€โ”€ schema/                     # JSON Schema Validation
    โ”œโ”€โ”€ core_schema.json
    โ””โ”€โ”€ extension_schema.json

๐Ÿš€ Quick Start

1๏ธโƒฃ Understanding Core Ontology

L1 v2.0 defines 24 classes and 13 generalized relations, organized into 4 abstract semantic domains. Within Entity, Party and Resource act as intermediate abstractions used as relation signatures (e.g. owns: Party โ†’ Resource). In total: 6 abstract classes (4 domain roots + Party + Resource) and 18 concrete leaf classes.

Domain Semantic Focus Classes
๐ŸŸฆ Entity Physical & logical entities Party (abstract), Person, Organization, OrgUnit, Resource (abstract), ProductService, Asset, DataObject, Document, SystemApplication
๐ŸŸจ Governance Control & compliance Policy, Rule, Control, Risk
๐ŸŸฉ Operational Execution & capabilities Role, Capability, Process, Event
๐ŸŸช Measurement Outcomes & metrics Goal, KPI

2๏ธโƒฃ Using Platform Bindings (L0)

Choose the binding that matches your technology stack:

Platform Use Case Directory
OWL/RDF Knowledge graphs, SPARQL queries platform/owl-rdf/
JSON-LD REST APIs, Linked Data platform/json-ld/
GraphQL Modern API layers, Frontend platform/graphql/
SQL DDL Relational DBs, Data warehouses platform/sql/

3๏ธโƒฃ Using Industry & Domain Extensions

Browse the l2-extensions/ directory and select the appropriate industry package. Each extension declares its parent through the extends field:

{
  "layer": "L2_consulting_industry_extension",
  "version": "1.0.0",
  "extends": "L1_universal_organization_ontology",
  "classes": [
    {
      "id": "ConsultingFirm",
      "label_zh": "ๅ’จ่ฏขๅ…ฌๅธ",
      "parent": "Organization",
      "definition": "An enterprise entity providing professional consulting services"
    }
  ]
}

4๏ธโƒฃ Contributing a New Extension

  1. Copy l2-extensions/_template/ as your starting point.
  2. Follow the Extension Development Guide.
  3. Validate against schema/extension_schema.json.
  4. Submit a Pull Request! (See CONTRIBUTING.md)

๐Ÿ“š Full Ontology Creation & Update Guide

For the full step-by-step walkthrough with detailed examples in Chinese, see README_CN.md โ€” Ontology ๅˆ›ๅปบไธŽๆ›ดๆ–ฐๅฎŒๆ•ดๆŒ‡ๅ—.

End-to-End Workflow

1. Identify parent dependencies (L1 core, L2 extensions)
2. Copy template โ†’ l2-extensions/_template/ or l3-enterprise/_template/
3. Inherit parent classes via the "parent" field
4. Define domain-specific classes (PascalCase IDs, bilingual labels)
5. Define relations with "specializes" inheritance chain (snake_case IDs)
6. Add sample instances (type must reference a concrete, non-abstract class)
7. Validate: JSON Schema โ†’ Governance rules โ†’ Referential integrity
8. Generate derived formats (OWL/RDF, Neo4j, LLM exports)
9. Version management & release

Validation & Export Commands

# L1 governance rules (class caps, naming, relation density, etc.)
python scripts/validate_governance.py

# L2/L3 referential integrity (9 rules: parent refs, domain/range, aliases, cycles)
python scripts/validate_l3.py --all

# Generate all derived formats
python scripts/json_to_owl.py                                          # OWL/RDF Turtle
python scripts/export_neo4j.py l1-core/universal_ontology_v1.json      # Neo4j Cypher
python scripts/export_for_llm.py l1-core/universal_ontology_v1.json    # LLM (prompt, tools, RAG)
python scripts/visualize_ontology.py                                   # Interactive HTML

Pro Tip: A working L3 sample is available at l3-enterprise/acme-tech-solutions/ โ€” a fictional technology consulting company demonstrating the full workflow.


๐Ÿ—‚๏ธ Available Industry & Domain Extensions

Industry Directory Classes Relations Status
Consulting l2-extensions/consulting/ 54 45 v1.1.0
Financial Services l2-extensions/financial-services/ 30 12 v1.0.0
Food & Beverage l2-extensions/fnb/ 19 7 v1.0.1
Healthcare l2-extensions/healthcare/ 28 10 v1.0.0
Luxury Goods l2-extensions/luxury-goods/ 39 14 v2.0.0
Manufacturing l2-extensions/manufacturing/ 27 11 v1.0.0
Technology l2-extensions/technology/ 29 12 v1.0.0

๐ŸŒŸ We're looking for community contributions! Retail, Education, Real Estate, Logistics, Energy, and more.


โš™๏ธ Available Platform Bindings

Platform Directory Format Status
OWL/RDF platform/owl-rdf/ Turtle (.ttl) v1.0.0
JSON-LD platform/json-ld/ Context (.jsonld) v1.0.0
GraphQL platform/graphql/ Schema (.graphql) v1.0.0
SQL DDL platform/sql/ PG DDL (.sql) v1.0.0

๐ŸŒŸ Want more? Protobuf, Avro, Neo4j Cypher, and more are welcome contributions!


๐Ÿค Contributing

We welcome all contributions! Please read CONTRIBUTING.md to learn about:

  • Proposing changes to the Core Ontology
  • Submitting new Industry & Domain Extensions
  • Contributing new Platform Bindings
  • Coding standards and PR workflow

๐Ÿ“„ License & Acknowledgments

License

This project is licensed under the Apache License 2.0. You are free to:

  • โœ… Use commercially
  • โœ… Modify and distribute
  • โœ… Build private L3 enterprise layers on top

Acknowledgments

The ontology design draws inspiration from:


If this project helps you, please give it a โญ Star!

About

๐ŸŒ An open, standardized four-layer enterprise ontology framework for knowledge graphs, semantic layers, master data management, and AI Agent knowledge bases.

Topics

Resources

Code of conduct

Contributing

Stars

11 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages