Contact

What is Semantic Triple?

Definition

A semantic triple is a unit of data that records one fact as a subject, a predicate and an object, such as "Albert Einstein – place of birth – Ulm". It is the basic building block of the W3C's RDF data model. Linked together, triples form a knowledge graph in which entities are nodes and relationships are edges. Schema.org markup written in JSON-LD can also be read as a set of triples.

Also known as: RDF triple, subject-predicate-object, triple, entity relationship, SPO triple

Diagram of a fact written as a semantic triple and broken down into its subject, predicate and object

The smallest unit of a fact

"Einstein was born in Ulm" breaks down into three parts: who the statement is about (subject: Einstein), what is being said about him (predicate: place of birth) and the value (object: Ulm). A semantic triple stores a fact in exactly that shape and needs nothing else to make sense. Unlike a database table, triples don't require a fixed schema; a new fact is simply a new triple.

In the W3C's RDF 1.1 specification, the subject of a triple is an IRI or a blank node, the predicate is an IRI, and the object is an IRI, a literal (text, number, date) or a blank node. The predicate always being an IRI matters: "place of birth" is expressed not as a loose word but as an address with a defined meaning.

SubjectPredicateObjectObject kind
Albert Einsteinplace of birthUlmAnother entity (IRI)
Albert Einsteindate of birth1879-03-14Date value (literal)
UlmcountryGermanyAnother entity (IRI)

Entity relationships and the graph they form

A triple whose object is another entity describes a relationship between two entities. In the table, Ulm is the object of the first row and the subject of the third, and that shared node is what connects the statements. With enough triples you get a network in which entities are nodes and relationships are edges. RDF defines a graph simply as a set of triples, and the knowledge graphs used by search engines and AI systems rest on the same idea.

Wikidata is the best-known open example. Einstein's item is Q937 and "place of birth" is property P19; every statement in Wikidata is a subject–property–value structure built from such identifiers. Because the identifiers are numbers rather than names, the same relationship reads the same way in every language. Newer RDF work also adds ways to make statements about statements, such as recording the source of a claim.

From JSON-LD markup to triples

JSON-LD is an RDF syntax, so writing structured data means producing triples. Take this markup:

{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://www.example.com/#org",
  "name": "Example Software",
  "founder": { "@id": "https://www.example.com/#jane-doe" }
}

Schema.org's JSON-LD context maps the short property names to the http://schema.org/ vocabulary, so the block above corresponds to three triples in Turtle syntax:

@prefix schema: <http://schema.org/> .

<https://www.example.com/#org> a schema:Organization .
<https://www.example.com/#org> schema:name "Example Software" .
<https://www.example.com/#org> schema:founder <https://www.example.com/#jane-doe> .

The @id values give nodes stable names. If the founder is described on another page with the same @id, the triples from both pages meet at one node. Without @id, each block yields blank nodes that belong to that page alone, and relationships stay disconnected across pages.

Why it's worth thinking in triples

The habit helps when writing, too. "We are a leading player in our industry" produces no triple at all; "Example Software was founded in Leeds in 2015" carries two clear ones, founding date and founding location. The facts a machine can extract from a text are the ones stated with a clear subject, a clear relationship and a clear value. The Schema.org vocabulary gives those relationships standard names, but every triple in your markup should also be backed by visible content on the page.

Related terms

← Back to the glossary