Subject – Predicate – Object

The atomic unit of meaning in RDF.

0/4 done

Theory

An RDF triple is a single statement of fact:

<subject>  <predicate>  <object> .
  • The subject is what you're talking about.
  • The predicate is the relationship or attribute.
  • The object is the value — another resource, or a literal.

A graph is just a bag of triples. That's it. Everything else in RDF — vocabularies, reasoning, validation — composes from this atom.

Use this S/P/O reference whenever you read a triple aloud:

SlotWhat goes thereExample
SubjectAn IRI (the thing):Alice
PredicateAn IRI (the relationship):knows
ObjectAn IRI or a literal:Bob, 42

(Recap from Level 0: the file always starts with @prefix lines so :Alice is shorthand for the full IRI. Every fact ends with a ..)

Theory

Going deeper — why the triple is the whole game

Why it works. Fixing the arity of every fact at exactly three makes RDF composable in a way tables and objects are not. Because every statement has the identical shape, two graphs authored by strangers merge by simple set-union of their triples — no schema reconciliation, no migration. The model is a labelled directed graph, and the triple is its edge. Everything richer (RDFS classes, OWL axioms, SHACL shapes, SPARQL patterns) is just more triples read by a tool that knows certain predicates — the data model never changes.

Why three and not two or four? Two slots (subject, value) can't name the relationship, so you'd lose the ability to mix relationship types freely. Four-plus slots (n-ary facts: 'Alice rated Inception 4 stars on Tuesday') do occur — but RDF deliberately keeps the atom binary and asks you to reify the extra context as its own node (a :Rating resource with its own triples). That keeps merge-by-union intact at the cost of an extra node when context is needed.

Where it bites.

  • Order matters, direction matters. :Alice :knows :Bob and :Bob :knows :Alice are different facts. RDF stores no reverse edge unless you assert it (or declare the property symmetric in OWL).
  • No native n-ary facts. The moment a fact needs a third party or a timestamp, you must reify — beginners try to cram it into the object and lose the data.
  • Predicates are global, not local. A predicate IRI means the same thing everywhere; you can't quietly redefine :knows for one dataset without consequences when graphs merge.

Analogy

An English sentence in the simplest possible form: Alice knows Bob.

  • Subject — Alice
  • Predicate — knows
  • Object — Bob

That sentence is one triple. A paragraph of facts becomes a graph of triples.

The mapping is exact: every simple declarative sentence (subject, verb, object) can be rewritten as one RDF triple. Compound sentences become several triples sharing a subject — which is why the ; shortcut exists.

Visualization

Subject Object predicate

Every RDF fact is a directed arrow from a subject to an object, labelled with the predicate. Memorize this shape — it's the atom.

Two details worth burning in: the arrow has a direction (subject → object — swapping them changes the meaning), and the predicate label lives on the edge, not on either node. Every other RDF construct in this course is built by composing this one shape.

Worked example

Worked example — one fact, one line, one period.

We want to say Alice knows Bob. In Turtle:

:Alice  :knows  :Bob  .
  • :Alice and :Bob are IRIs in our namespace (the empty prefix : introduced in Level 0).
  • :knows is our predicate — also in our namespace because we defined it.
  • The single period . closes the statement. Forget it and the parser will reject the file.

The starter code below already has the @prefix header filled in for you.

Reading in progress · 0 of 4 activities done