What Are Taxonomy, Thesaurus, and Ontology?
Contents
Also available in Korean: 택소노미, 시소러스, 온톨로지란?
Taxonomies, thesauri, and ontologies are all ways to organize concepts, so the terms are easy to mix up.
But what each one can express is different.
A thesaurus contains a taxonomy, and an ontology contains a thesaurus.
This post walks through all three using the same example: classifying security threats.
What is a taxonomy?
A taxonomy is a classification that divides concepts by a single parent-child relation.
Classifying security threats gives a tree like this.
Standard classifications in security have the same shape.
OCSF divides security events into categories and classes, and MITRE ATT&CK divides attacks into tactics and techniques.
OCSF (Open Cybersecurity Schema Framework) is an open schema for which fields a security event carries; it divides events into categories and classes and gives them numeric IDs.
MITRE ATT&CK is a knowledge base of adversary tactics and techniques based on real-world observations.
A taxonomy can express a relation like “ransomware is a kind of malware”, and that is enough for filtering and counting by category.
But the same threat goes by different names in different classification schemes.
OCSF records the malware classification as the numeric code 10 (Ransomware), and ATT&CK records the core behavior of this attack as technique T1486 (Data Encrypted for Impact).
A taxonomy alone cannot express that these are connected to “ransomware”.
Each concept in a taxonomy has only one name.
What is a thesaurus?
A thesaurus is a taxonomy plus alternative names with the same meaning and related concepts.
The international standard is ISO 25964, and on the web it is written in W3C SKOS.
SKOS records the preferred name (prefLabel), alternative names (altLabel), broader and narrower concepts (broader, narrower), and related concepts (related).
SKOS (Simple Knowledge Organization System) is a W3C standard data model for sharing and linking knowledge organization systems such as thesauri and classification schemes on the web.
The ex:ransomware in the figure and code below is an identifier for the concept “ransomware”.
Separate from the human-readable name (prefLabel), it is a shortened form of a unique address (IRI) that lets machines point to one concept without ambiguity.
The ex: prefix abbreviates an example address such as http://example.org/, so ex:ransomware means http://example.org/ransomware.
In the same way, skos: abbreviates the address of the SKOS vocabulary, and ocsf: and attack: are prefixes this post uses to point to OCSF and ATT&CK values.
SKOS can also map between different classification schemes.
Each scheme is kept as its own concept scheme, and correspondences between concepts are written with mapping properties (exactMatch, closeMatch, broadMatch, narrowMatch, relatedMatch).
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix ex: <http://example.org/> .
@prefix ocsf: <http://example.org/ocsf/> .
@prefix attack: <http://example.org/attack/> .
# OCSF: malware classification as a numeric code
ocsf:malware-10 a skos:Concept ;
skos:inScheme ocsf:malwareClassification ;
skos:prefLabel "Ransomware"@en ;
skos:notation "10" .
# MITRE ATT&CK: attack behavior as a technique
attack:T1486 a skos:Concept ;
skos:inScheme attack:techniques ;
skos:prefLabel "Data Encrypted for Impact"@en ;
skos:notation "T1486" .
# Mappings from the reference scheme's "ransomware" to other schemes
ex:ransomware skos:exactMatch ocsf:malware-10 .
ex:ransomware skos:relatedMatch attack:T1486 .
OCSF and ATT&CK are not published as SKOS.
The code above is an example made to show how to treat each scheme’s values as concepts and write the mappings.
Each classification stays as it is, and only the correspondences are recorded separately.
The mapping property is chosen by how close the match is.
OCSF’s Ransomware is the same concept as ransomware, so it is written as exactMatch.
ATT&CK’s T1486 is the signature technique of ransomware, but a technique and a kind of malware are not the same concept, so it is written as relatedMatch.
The two have to be kept apart because only exactMatch has a property called transitivity.
Transitivity means that if A equals B and B equals C, then A equals C.
In SKOS only exactMatch has this property; the other mapping properties, such as closeMatch and relatedMatch, do not.
So if concepts that are not fully identical are linked with exactMatch, different concepts end up merged through the one in the middle, as the figure below shows.
A wiper is malware that erases or corrupts data so it cannot be used; it is number 21 in the OCSF malware classification.
What is an ontology?
A thesaurus only expresses relations between concepts (broader, narrower, related, mapped).
It does not express what a concept has, such as “a detection has a source IP” or “an IP is assigned to a host”.
So it cannot answer a question like “which host is this detection’s source IP assigned to, and were there other detections on that host?”
An ontology adds properties of concepts, relations between concepts, and inference rules.
On the web it is written in RDFS and OWL.
RDFS (RDF Schema) is a W3C language for defining the classes and properties used in RDF data and the hierarchy between them; OWL (Web Ontology Language) is a W3C ontology language that defines classes and properties with richer logic so that a reasoner can draw conclusions.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix ex: <http://example.org/> .
ex:sourceIP a owl:ObjectProperty ;
rdfs:domain ex:Detection ; rdfs:range ex:IPAddress .
ex:assignedTo a owl:ObjectProperty ;
rdfs:domain ex:IPAddress ; rdfs:range ex:Host .
ex:RansomwareDetection rdfs:subClassOf ex:MalwareDetection .
ex:MalwareDetection rdfs:subClassOf ex:Detection .
The first definition means “a detection has a source IP”, and the second means “an IP is assigned to a host”.
With these relations defined, a query can follow a detection to its IP, the IP to its host, and the host back to other detections.
The last two lines are inference rules.
Since ransomware detection is defined as a subclass of malware detection, a reasoner also treats detection case A, classified as a ransomware detection, as a malware detection.
Where the hierarchy in a taxonomy was just classification, the hierarchy in an ontology is a rule a machine can draw conclusions from.
Comparing the three
| Taxonomy | Thesaurus | Ontology | |
|---|---|---|---|
| What it expresses | Parent-child classification | + alternative names, related concepts, mappings to other schemes | + properties of concepts, relations between concepts, inference rules |
| Standards | None in particular | ISO 25964, SKOS | RDFS, OWL |
| Example | Threat › Malware › Ransomware | Ransomware = OCSF 10, related to ATT&CK T1486 | Detection → source IP → host, RansomwareDetection subClassOf MalwareDetection |
| Questions it can answer | What kind of threat is ransomware? | Which concept in the reference scheme matches OCSF’s 10? | Which host is this detection’s source IP assigned to? |
Summary
If you only need to classify, filter, and count, a taxonomy is enough.
If the same concept arrives under several names or from several classification schemes, you need a thesaurus.
If you need to follow what a concept has, or draw conclusions from definitions, you need an ontology.
The three are not competing approaches; as you need to express more, you add a thesaurus on top of a taxonomy and an ontology on top of a thesaurus, one layer at a time.
References
- W3C, SKOS Simple Knowledge Organization System Reference https://www.w3.org/TR/skos-reference/
- W3C, RDF Schema 1.1 https://www.w3.org/TR/rdf-schema/
- W3C, OWL 2 Web Ontology Language Document Overview https://www.w3.org/TR/owl2-overview/
- ISO 25964-1:2011, Thesauri and interoperability with other vocabularies - Part 1 https://www.iso.org/standard/53657.html
- OCSF Schema 1.3.0, Detection Finding https://schema.ocsf.io/1.3.0/classes/detection_finding
- OCSF Schema 1.3.0, Malware object https://schema.ocsf.io/1.3.0/objects/malware
- MITRE ATT&CK https://attack.mitre.org/
- MITRE ATT&CK, T1486 Data Encrypted for Impact https://attack.mitre.org/techniques/T1486/