AI Notes
Master ontologies. RDF, OWL, semantic web. Knowledge representation 2024.
Introduction
An ontology in artificial intelligence is a formal, explicit specification of a shared conceptualization. In simpler terms, it is a structured vocabulary that defines the concepts within a domain and the relationships between those concepts. Ontologies enable AI systems to understand and reason about domain knowledge in a machine-readable format. They go beyond simple taxonomies (is-a hierarchies) to capture rich relationships, constraints, and axioms that define how concepts relate to each other.
What an Ontology Contains
| 1. Classes (Concepts) | Categories of things |
| 2. Instances (Individuals) | Specific things |
| 3. Properties (Relations) | Connections between concepts |
| - Object properties | hasPart, isLocatedIn, causes |
| - Data properties | hasAge (integer), hasName (string) |
| 4. Axioms (Constraints) | Logical rules |
OWL: Web Ontology Language
| rdfs | subClassOf :Mammal ; |
| rdfs | subClassOf [ |
| rdf | type owl:Restriction ; |
| owl | onProperty :hasLegs ; |
| owl | hasValue 4 |
| rdfs | domain :WholeObject ; |
| rdfs | range :Part ; |
| rdf | type owl:TransitiveProperty . |
| (Transitivity | if A hasPart B and B hasPart C, then A hasPart C) |
Building an Ontology: Methodology
| Disease | InfectiousDisease → BacterialInfection → Pneumonia |
| Disease | ChronicDisease → Diabetes → Type2Diabetes |
| hasSymptom: Disease | Symptom |
| treatedBy: Disease | Treatment |
| affectsBodyPart: Disease | BodyPart |
| prescribedFor: Medication | Disease |
| contraindicatedWith: Medication | Medication |
Reasoning with Ontologies
| Given | Rex is a Dog. Dogs are Mammals. Mammals are Animals. |
| Inferred | Rex is a Mammal. Rex is an Animal. |
| Given | Animals breathe. Rex is an Animal. |
| Inferred | Rex breathes. |
| Axiom | "Dog hasLegs exactly 4" |
| Assertion | "Rex hasLegs 5" |
| Reasoner | INCONSISTENCY DETECTED! |
| Q | "What diseases cause fever and cough?" |
| Ontology traversal | Find all X where X hasSymptom Fever AND X hasSymptom Cough |
| Answer | {Flu, Pneumonia, Bronchitis, COVID-19} |
Real-World Ontologies
Gene Ontology (GO)
- 44,000+ terms describing gene functions
- Used by all bioinformatics databases worldwide
- Three domains: Biological Process, Molecular Function, Cellular Component
SNOMED CT (Medical)
- 350,000+ medical concepts
- Used in electronic health records globally
- Enables clinical decision support
DBpedia (General knowledge)
- Structured data extracted from Wikipedia
- 6 million+ entities with properties and relationships
- Powers many knowledge-based AI applications
Schema.org (Web):
- Shared vocabulary for web content markup
- Used by Google, Bing, Yahoo for rich search results
- Helps search engines understand web page content
Ontology vs Other Knowledge Representations
| Representation | Expressiveness | Reasoning | Use Case |
|---|---|---|---|
| Taxonomy | Low (is-a only) | Simple inheritance | File systems, catalogs |
| Thesaurus | Low (synonyms, broader/narrower) | Term expansion | Search engines |
| Semantic Network | Medium (arbitrary relations) | Graph traversal | Conceptual modeling |
| Ontology (OWL) | High (axioms, constraints) | Full logical reasoning | Knowledge systems |
| Knowledge Graph | Medium-High (triples + schema) | Graph queries + rules | Google, Wikidata |
Applications in AI
Question Answering: When a user asks "What is the capital of France?", an ontology links the concept "France" to the property "hasCapital" to the instance "Paris" enabling direct factual answers.
Interoperability: Different hospital systems use different terminologies. An ontology maps "heart attack" ↔ "myocardial infarction" ↔ "MI" enabling systems to communicate.
Semantic Search: Instead of keyword matching, ontology-powered search understands that a query for "vehicles" should also return results about "cars", "trucks", and "motorcycles" since they are subclasses.
Intelligent Agents: Autonomous agents use ontologies to understand their domain, reason about goals, and communicate with other agents using shared vocabulary.
Summary
Ontologies provide the formal, structured backbone for knowledge representation in AI systems. By defining concepts, relationships, constraints, and instances in a machine-readable format, they enable automated reasoning, knowledge sharing, and semantic interoperability. From medical informatics to the Semantic Web, ontologies power systems that must understand and reason about complex domain knowledge rather than simply pattern-match from data.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Ontologies - Semantic Knowledge.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Artificial Intelligence topic.
Search Terms
artificial-intelligence, artificial intelligence, artificial, intelligence, knowledge, representation, ontologies, ontologies - semantic knowledge
Related Artificial Intelligence Topics