A subject-predicate-object data structure encoding relationships in knowledge graphs.
A triple is the fundamental unit of data representation in RDF (Resource Description Framework) and semantic web technologies. It encodes a single factual statement as three components: a subject (the entity being described), a predicate (the relationship or property), and an object (the value or related entity). For example, the statement "Alice knows Bob" becomes a triple where "Alice" is the subject, "knows" is the predicate, and "Bob" is the object. This deceptively simple structure allows arbitrarily complex networks of facts to be expressed as collections of atomic statements, forming the backbone of knowledge graphs.
Triples are stored in specialized databases called triple stores, which are optimized for graph traversal and relationship queries. The SPARQL query language was developed specifically to retrieve and manipulate triple-based data, allowing systems to ask questions like "find all people Alice knows who also know Carol." Because each triple can be uniquely identified and linked to others, large collections of triples naturally form directed graphs where nodes represent entities and edges represent predicates. This graph structure makes it straightforward to merge datasets from different sources, since triples from separate knowledge bases can be combined as long as they share common identifiers.
In machine learning and AI, triples have become central to knowledge graph embedding methods, where the goal is to learn dense vector representations of entities and predicates that capture the relational structure of the graph. Models such as TransE, RotatE, and ComplEx operate directly on triple-formatted data, learning to predict missing links by scoring candidate triples. These embeddings can then enrich downstream tasks like question answering, entity disambiguation, and recommendation systems with structured world knowledge.
The practical importance of triples extends to large-scale industrial knowledge graphs such as Google's Knowledge Graph, Wikidata, and Freebase, all of which store billions of facts in triple form. As language models increasingly incorporate structured knowledge retrieval, the triple remains a critical interface between symbolic knowledge representations and neural systems, bridging the gap between human-readable facts and machine-learnable representations.