Theory
RDF objects come in two flavours:
- IRIs — globally unique identifiers for things you might want to say more about later (
:Alice,:Tokyo,:Book123). - Literals — raw data values you'll never need to identify on their own (
"Alice",42,"2024-01-01"^^xsd:date).
Rule of thumb: if you might attach more triples to it later, make it an IRI.
Quick decision table:
| Use an IRI when… | Use a literal when… |
|---|---|
| The thing has its own identity | It's just a value carried along |
| You'll add more facts about it later | It's terminal data — nothing more |
| Two graphs might want to refer to it | Only this triple needs it |
| It's a person, place, document, event… | It's a name, number, date, flag… |