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 ..)

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