Semantic Triples
The smallest meaningful statement a machine can understand: a subject, a predicate, and an object --- “Paris is-capital-of France” expressed as three connected parts.
What is it?
A semantic triple is a three-part statement that expresses a single fact: subject — predicate ⇒ object. The subject is the thing you are talking about. The predicate is the relationship. The object is the thing it relates to. “Paris is-capital-of France” is a triple. So is “Marie Curie won Nobel Prize” and “DNA encodes Proteins.”1
Triples are the atomic unit of machine-readable knowledge. Just as sentences are the atoms of human communication and cells are the atoms of biology, triples are the atoms of knowledge graphs and the Semantic Web. Every fact in a knowledge graph --- no matter how complex the overall structure --- is stored as one or more triples.2
The power of triples comes from their composability. A single triple is a simple fact. But triples share subjects, predicates, and objects, and when they do, they link together into a graph. “Paris is-capital-of France” and “France is-in Europe” share the node “France,” so they connect. Add “Europe contains 44 countries” and “Paris has-population 2.1 million” and you are building a web of interconnected facts from individually simple statements.1
The standard for expressing triples on the web is RDF (Resource Description Framework), which ensures that triples written by one system can be read by another. RDF gives every subject, predicate, and object a unique identifier (a URI), so “Paris” in one dataset is provably the same “Paris” in another.3
In epistemology --- the philosophical study of knowledge --- the parallel concept is a claim or proposition: a statement that can be true or false. Triples bring this philosophical idea into the machine world, giving computers a way to represent, store, and reason about propositions.2
In plain terms
A semantic triple is like a single entry in a ledger: “who did what to whom.” Each entry is tiny, but thousands of entries paint a complete picture. The ledger’s power is not in any single line --- it is in how the lines connect.
At a glance
How triples compose into a graph (click to expand)
graph LR P[Paris] -->|is-capital-of| F[France] F -->|is-in| E[Europe] MC[Marie Curie] -->|born-in| P MC -->|won| NP[Nobel Prize] NP -->|awarded-by| RSA[Royal Swedish Academy] RSA -->|located-in| S[Stockholm]Key: Each arrow is one triple (subject — predicate ⇒ object). Shared nodes (Paris appears twice, once as a capital, once as a birthplace) link the triples into a connected graph. Six triples, six facts, one navigable web of knowledge.
How does it work?
1. Subject (the thing)
The subject is the entity the triple is about. In “Paris is-capital-of France,” the subject is Paris. In RDF, the subject is identified by a URI --- a globally unique identifier like http://dbpedia.org/resource/Paris --- which ensures that every system referring to “Paris” means the same Paris.3
Think of it like...
The subject is the noun at the start of a sentence. It is the thing you are pointing at and saying something about.
2. Predicate (the relationship)
The predicate describes the relationship between the subject and the object. It is the verb of the triple. “is-capital-of,” “won,” “born-in,” “discovered” --- each predicate defines a specific type of connection.1
Predicates are themselves defined in ontologies, which specify what types of subjects and objects a predicate can connect. The predicate is-capital-of connects a City to a Country --- not a Person to a Country. This constraint is what makes triples semantic (meaningful) rather than merely syntactic (structurally correct).2
Think of it like...
The predicate is the verb in a sentence. But unlike natural language verbs (which are ambiguous --- “ran” can mean jogging, operating, or flowing), a triple’s predicate has a precise, defined meaning that machines can rely on.
3. Object (the other thing)
The object is what the subject relates to. It can be another entity (an object node) or a literal value (a string, number, or date). “Paris is-capital-of France” has an entity object. “Paris has-population 2161000” has a literal object.3
When the object is an entity, it can be the subject of other triples, creating chains: Paris is-capital-of France. France is-in Europe. Europe contains 44 countries. This chaining is how individual triples compose into knowledge graphs.
Example: decomposing a fact into triples (click to expand)
Consider the statement: “Marie Curie, a Polish-born physicist, won the Nobel Prize in Physics in 1903.”
This single sentence decomposes into multiple triples:
Subject Predicate Object Marie Curie is-a Physicist Marie Curie born-in Poland Marie Curie won Nobel Prize in Physics Nobel Prize in Physics awarded-in 1903 Each triple captures one fact. Together, they represent the full sentence in a form a machine can store, query, and reason about.
4. Composability (from atoms to graphs)
The defining feature of triples is that they compose. When two triples share a node, they link. When thousands of triples share nodes, they form a knowledge graph. No triple needs to know about any other --- each is a self-contained fact. But the graph that emerges from their connections captures far more meaning than any individual statement.1
This composability also means triples are additive. To add a new fact, you add a new triple. You never need to redesign a table, add a column, or modify an existing record. This makes triple-based systems extremely flexible for domains where the data model evolves over time.2
Think of it like...
LEGO bricks. Each brick is simple and self-contained. But because they share a universal connection system (the studs), any brick can connect to any other. From simple, uniform pieces, you can build structures of arbitrary complexity --- and you can always add more bricks without tearing anything down.
Concept to explore
RDF (Resource Description Framework) is the W3C standard that defines how triples are encoded, serialised, and exchanged between systems.
Why do we use it?
Key reasons
1. Universal simplicity. Every fact, no matter how complex the domain, can be expressed as a triple. This uniformity means one data model works for medicine, geography, commerce, and any other field --- no custom schemas required for each domain.1
2. Machine reasoning. Because triples have formal semantics, machines can infer new triples from existing ones. If “Dog is-a Mammal” and “Mammal is-a Animal” are both triples, a reasoner can infer “Dog is-a Animal” without being told explicitly.2
3. Data integration without central coordination. Because RDF triples use globally unique URIs, datasets created independently by different organisations can be merged simply by combining their triples. Shared URIs link automatically. This is the foundation of Linked Data on the web.3
4. Grounding LLMs. Large language models generate fluent text but can fabricate facts. Grounding an LLM in a triple store gives it a structured, verifiable source of truth --- the model can check its claims against explicit subject-predicate-object statements before responding.2
When do we use it?
- When building or extending a knowledge graph and needing a standard way to represent facts
- When working with Linked Data or the Semantic Web, where interoperability between datasets is essential
- When designing a system that needs to reason about relationships, not just store and retrieve data
- When integrating data from multiple sources that were not designed to work together
- When grounding an AI system in verifiable, structured facts
Rule of thumb
If you can express your data as “thing A has relationship R with thing B” and you need a machine to understand what that means, you are working with semantic triples.
How can I think about it?
The witness statement analogy
In a courtroom, a witness makes individual claims: “I saw the defendant at the bank.” “The defendant was wearing a red jacket.” “The bank is on Elm Street.” Each claim is a simple statement --- a triple. The prosecution’s job is to connect the claims into a coherent narrative (a graph). The jury reasons over the connected claims to reach a verdict.
- Each claim = a triple (subject-predicate-object)
- Connecting claims through shared entities = composing triples into a graph (“the defendant” appears in multiple claims, linking them)
- The prosecution’s narrative = the knowledge graph
- The jury’s reasoning = machine inference over the graph
- Cross-examination = validation (checking whether the triples are consistent and true)
The molecular chemistry analogy
Atoms are the smallest unit of a chemical element. On their own, a hydrogen atom or an oxygen atom is simple. But atoms bond to form molecules: two hydrogen atoms and one oxygen atom form water. Molecules combine to form complex substances. The properties of water are not properties of hydrogen or oxygen alone --- they emerge from the connections.
- An atom = a single triple (the smallest meaningful unit)
- A bond = a shared node between two triples
- A molecule = a small cluster of connected triples
- A substance = a knowledge graph (complex, emergent meaning from simple parts)
- Chemistry’s periodic table = the ontology (defining what types of atoms exist and how they can bond)
Concepts to explore next
| Concept | What it covers | Status |
|---|---|---|
| rdf | The W3C standard for encoding and exchanging triples | stub |
| sparql | The query language for retrieving data from triple stores | stub |
| linked-data | The practice of publishing interconnected datasets on the web using triples | stub |
Some cards don't exist yet
A broken link is a placeholder for future learning, not an error.
Check your understanding
Test yourself (click to expand)
- Explain what a semantic triple is to someone who has never heard the term, using an example from everyday life.
- Name the three components of a triple and describe the role of each.
- Distinguish between an entity object and a literal object in a triple. Why does this distinction matter for composability?
- Interpret these three triples: “Alice works-at Acme Corp,” “Acme Corp located-in London,” “London is-in United Kingdom.” What question can you answer by traversing all three that you could not answer from any single triple alone?
- Connect semantic triples to ontology: how does an ontology constrain which triples are valid?
Where this concept fits
Position in the knowledge graph
graph TD KE[Knowledge Engineering] --> O[Ontology] O --> ST[Semantic Triples] KE --> KG[Knowledge Graphs] KG --> NE[Nodes and Edges] style ST fill:#4a9ede,color:#fffRelated concepts:
- knowledge-graphs --- triples are the atomic statements that knowledge graphs are built from; every edge in a knowledge graph is a triple
- json --- JSON-LD extends JSON to express triples, bridging web development and the Semantic Web
- claims-and-propositions --- in epistemology, propositions are the philosophical parallel to triples: statements that can be true or false
- structured-data-vs-prose --- triples represent the most granular form of structured data, where every fact is individually addressable
Sources
Further reading
Resources
- The Smallest Useful Unit (How to Think AI) --- Beginner-friendly introduction to why triples are the atom of machine knowledge
- Knowledge Representation Methods (Knowledge Systems Authority) --- Broader context on how triples fit into the landscape of knowledge representation
- RDF Primer (W3C) --- The official W3C introduction to RDF, the standard for encoding triples
- Semantic Triple (Wikipedia) --- Concise reference covering the concept, its history, and its role in the Semantic Web