## Definition
**Ontologies** and **semantic networks** are structured forms of [[Knowledge Representation]] that model concepts and relations as labelled graphs. Foundational for the Semantic Web, biomedical knowledge bases, and many enterprise data integration systems.
## Semantic Networks
A semantic network is a graph:
- **Nodes** represent concepts (objects, categories, properties).
- **Edges** represent relations (is-a, part-of, has-property).
The classic example: WordNet, a lexical database where words connect via synonymy, hyponymy, meronymy.
Strengths: visual, intuitive. Limitations: semantics often informal, hard to reason rigorously.
## Ontologies
An ontology is a **formal, explicit specification of a shared conceptualisation** (Gruber, 1993). Three properties separate it from a semantic network:
1. **Formal semantics.** Underlying logic (typically a description logic).
2. **Explicit definitions.** Concepts and relations are precisely specified.
3. **Shared.** Designed for use by multiple agents or systems.
## Components
- **Classes (concepts):** `Person`, `Vehicle`, `Disease`.
- **Individuals:** `Alice`, `Tesla-Model-3`.
- **Object properties:** `worksFor`, `livesIn`.
- **Data properties:** `hasAge`, `hasName`.
- **Axioms:** logical statements constraining the model (e.g., disjointness, inverse, transitivity).
## OWL and the Semantic Web
**OWL** (Web Ontology Language, W3C standard) is the dominant ontology language. Variants:
- **OWL Lite** — simplest, decidable.
- **OWL DL** — balances expressivity and decidability; based on the SHOIN(D) description logic.
- **OWL Full** — most expressive, undecidable.
Storage and query: **RDF triples** (subject-predicate-object) in **triplestores** (GraphDB, Stardog, Apache Jena). Query language: **SPARQL**.
## Notable Ontologies
- **SNOMED CT** — clinical terminology, ~350k concepts.
- **Gene Ontology** — molecular biology.
- **DBpedia / Wikidata** — encyclopedic knowledge graphs from Wikipedia.
- **Schema.org** — web markup vocabulary.
- **FOAF** — social relations ("Friend of a Friend").
## Reasoning
DL reasoners (HermiT, Pellet, ELK) perform:
- **Classification** — compute the subsumption hierarchy.
- **Consistency checking** — detect logically conflicting axioms.
- **Instance retrieval** — find all instances of a class.
## Relevance in the LLM Era
Knowledge graphs and ontologies have not been displaced by LLMs — they complement them:
- **Grounded retrieval.** [[Retrieval-Augmented Generation]] over a knowledge graph constrains the LLM to factual entities.
- **Auditing.** Ontology axioms can verify LLM outputs.
- **Integration.** Enterprise data integration still relies on explicit schemas.
## Related
- [[Knowledge Representation]]
- [[First-Order Logic]]
- [[Retrieval-Augmented Generation]]