agentsclimarketplace

Ontology design

Skill viktorbezdek/skillstack/ontology-design/skills/ontology-design

Design formal knowledge models — classes, properties, relationships, hierarchies, and semantic graphs — for knowledge representation and reasoning. Use when the user asks to build an ontology, design a knowledge graph, model entity relationships formally, define class hierarchies, create a taxonomy for semantic reasoning, or structure data for RDF/OWL. NOT for CMS content types, editorial workflows, or publishing structures (use content-modelling). NOT for naming conventions or terminology standards across docs (use consistency-standards).From its SKILL.md

Install
npx -y skills add viktorbezdek/skillstack --skill ontology-design

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 10 stars10 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.5 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

Ontology Design

Model domain knowledge through classes, properties, and relationships. An ontology is not a database schema — it encodes meaning, not just structure. A well-designed ontology enables reasoning (inferring new facts from existing ones), not just storage.

When to Use

  • Building a knowledge graph that requires formal class hierarchies
  • Designing semantic models where relationships carry meaning (not just foreign keys)
  • Creating taxonomies that enable automated reasoning or inference
  • Modeling domains where "is-a" and "has-a" distinctions matter
  • Structuring data for RDF/OWL or semantic web technologies
  • Designing type systems where inheritance and composition have semantic weight

When NOT to Use

  • CMS content types, editorial workflows, or publishing structures (use content-modelling)
  • Naming conventions or terminology standards across docs (use consistency-standards)
  • Database schema design for CRUD applications (use database schema tools)
  • API data models (use API design or TypeScript/Python type definitions)
  • Simple key-value or document storage (no ontology needed)

Decision Tree

What are you modeling?
│
├─ Entities with "is-a" relationships (inheritance)?
│  ├─ Need automated reasoning over the hierarchy? → Yes, ontology
│  └─ Just need type categories in code? → No, use enum/interface in code
│
├─ Relationships between entities with semantic meaning?
│  ├─ Need to infer new relationships? → Yes, ontology with reasoning
│  └─ Just need to join tables? → No, use database schema
│
├─ Taxonomy with formal classification?
│  ├─ Multiple inheritance or overlapping categories? → Yes, ontology
│  └─ Simple flat categories? → No, use tags or enums
│
├─ Need RDF/OWL/SPARQL?
│  └─ Yes → Ontology design (this skill)
│
└─ Not sure if ontology or schema
   ├─ Does "Dog is-a Animal" enable reasoning beyond code type checks? → Ontology
   └─ Just storing data with relationships? → Database schema

Core Components

ComponentPurposeExample
ClassCategory of thingsPerson, Product
PropertyAttribute of classname, price
RelationshipConnection between classesowns, partOf
InstanceSpecific entityJohn, iPhone15
AxiomRule that constrains interpretationPerson ⊓ hasChild ≥ 1 → Parent

Relationship Types

TypeNotationExampleInverse
Is-a (inheritance)subClassOfDog is-a Animal
Has-a (composition)hasPartCar has-a EnginepartOf
Uses (association)usesPerson uses ToolusedBy
Instance-oftypeFido instance-of Dog
Causes (causation)causesSmoking causes DiseasecausedBy

Always define inverse relationships where they exist. Missing inverses break traversal and reasoning.

Taxonomy Levels

Kingdom
  └── Phylum
        └── Class
              └── Order
                    └── Family
                          └── Genus
                                └── Species

Rule: taxonomies deeper than 7 levels become unmaintainable. If you need more, consider faceted classification instead.

Design Template

## Class: [Name]

**Description**: [purpose]
**Parent**: [superclass]

### Properties
| Name | Type | Required | Description |
|------|------|----------|-------------|
| id | string | yes | Unique identifier |
| name | string | yes | Display name |

### Relationships
| Relation | Target | Cardinality | Inverse |
|----------|--------|-------------|---------|
| belongsTo | Category | many-to-one | contains |
| contains | Item | one-to-many | belongsTo |

Design Principles

  • MECE: Mutually exclusive, collectively exhaustive
  • Single inheritance preferred: Avoid diamond problem; use composition for shared behavior
  • Normalize: Reduce redundancy; each fact stated once
  • Domain-driven: Match real-world concepts, not implementation artifacts
  • Define inverses: Every bidirectional relationship needs both directions
  • Constrain cardinality: State minimum and maximum explicitly (1..*, 0..1, etc.)
  • Separate taxonomy from ontology: Taxonomy classifies; ontology relates

Anti-Patterns

Anti-PatternProblemSolution
God class (too many responsibilities)Class becomes a catch-all; reasoning produces false inferencesSplit into focused classes; use composition over inheritance
Orphan classes (no relationships)Class exists in isolation; no reasoning possibleConnect via at least one relationship or place in hierarchy
Circular dependenciesA depends on B depends on A; reasoning loopsBreak cycle by extracting shared concept into a third class
Over-abstractionGeneric classes like Thing or Entity add no semantic valueOnly abstract when subclasses share meaningful properties
Missing inversesTraversal works in one direction only; queries failDefine inverse for every bidirectional relationship
Diamond inheritanceClass inherits from two parents that share an ancestorPrefer single inheritance + composition; use mixins/traits if needed
Confusing is-a with has-a"Car is-a Wheel" instead of "Car has-a Wheel"Is-a = "every X is also a Y"; Has-a = "X contains Y as a part"
Modeling implementation, not domainClasses mirror database tables or API endpointsModel the domain concepts; map to implementation separately
Ignoring temporal aspects"Person lives-at Address" with no time rangeAdd valid-from/valid-to for facts that change over time

Related Skills

  • content-modelling — CMS content types, editorial workflows, publishing structures
  • consistency-standards — Naming conventions and terminology standards
  • memory-systems — Knowledge graph storage and retrieval for agents

What ships with it: 2 files

3.3 KB alongside SKILL.md

Keep looking

Skills are one crate of 326,834. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.