Allen's Interval Algebra is a calculus for qualitative temporal reasoning that defines 13 possible mutually exclusive relations between two convex time intervals. These relations, such as before, meets, overlaps, during, and their inverses, form a complete set for describing any relative positioning of intervals on a timeline. The algebra provides a formal language to express temporal constraints (e.g., Event A overlaps Event B) and supports reasoning tasks like consistency checking and temporal query answering within systems like temporal knowledge graphs.
Glossary
Allen's Interval Algebra

What is Allen's Interval Algebra?
A formal system for representing and reasoning about the qualitative temporal relationships between two time intervals.
The formalism is foundational for temporal knowledge representation, enabling the modeling of events and states with durations in enterprise knowledge graphs. It underpins temporal reasoning engines that can infer new relations from a set of constraints and detect inconsistencies. While powerful for qualitative analysis, it is often integrated with quantitative time points for hybrid reasoning. Its concepts are directly applicable to temporal SPARQL extensions and temporal graph database schemas for querying versioned data.
The 13 Fundamental Relations
Allen's Interval Algebra defines a complete set of 13 mutually exclusive, qualitative relations that can hold between any two time intervals. These relations form the basis for temporal reasoning in knowledge graphs, logic programming, and scheduling systems.
Before / After
The Before relation (and its inverse After) describes two intervals where one ends before the other begins. There is a temporal gap between them.
- Notation:
X before YorX < Y;Y after XorY > X. - Example: A project's planning phase (Interval A) ends on Friday. The execution phase (Interval B) starts the following Monday.
A before B. - Key Property: The relations are converse of each other. If
A before B, thenB after A.
Meets / Met By
The Meets relation describes two intervals where one ends exactly when the other begins. There is no gap and no overlap.
- Notation:
X meets YorX m Y;Y met-by XorY mi X. - Example: A one-hour meeting ends at 3:00 PM. A subsequent meeting begins at 3:00 PM. The first meeting meets the second.
- Key Property: This is the fundamental relation for modeling contiguous events or processes in schedules and workflows.
Overlaps / Overlapped By
The Overlaps relation describes two intervals where one starts before the other, and they share a common period before the first one ends.
- Notation:
X overlaps YorX o Y;Y overlapped-by XorY oi X. - Example: A software development sprint (Interval A: weeks 1-4) and a quality assurance phase (Interval B: weeks 3-6).
A overlaps B. - Key Property: This is a common relation for modeling concurrent, interacting processes with partial temporal alignment.
Starts / Started By
The Starts relation describes two intervals that begin at the same instant, but the first interval ends before the second.
- Notation:
X starts YorX s Y;Y started-by XorY si X. - Example: A temporary promotional discount (Interval A: Jan 1 - Jan 15) begins on the same day as a quarterly sales period (Interval B: Jan 1 - Mar 31).
A starts B. - Key Property: Useful for modeling sub-events or conditions that are initiated simultaneously with a larger containing event.
During / Contains
The During relation describes an interval that is completely contained within another, with different start and end times.
- Notation:
X during YorX d Y;Y contains XorY di X. - Example: A employee's two-week vacation (Interval A) occurs entirely within the third fiscal quarter (Interval B).
A during B. - Key Property: This is the primary relation for modeling hierarchical or nested temporal structures, such as events within a timeframe.
Finishes / Finished By
The Finishes relation describes two intervals that end at the same instant, but the first interval starts after the second.
- Notation:
X finishes YorX f Y;Y finished-by XorY fi X. - Example: A final project milestone review (Interval A: last 3 days of March) concludes at the end of the month, coinciding with the end of the monthly reporting cycle (Interval B: entire month of March).
A finishes B. - Key Property: Models events that culminate or terminate simultaneously with a larger containing interval.
Equals
The Equals relation describes two intervals that share identical start and end times. They are temporally coincident.
- Notation:
X equals YorX = Y. - Example: A scheduled server maintenance window is defined as 2:00 AM to 4:00 AM. The recorded downtime for the server is also from 2:00 AM to 4:00 AM. The scheduled window equals the recorded downtime.
- Key Property: This relation is its own converse and is symmetric. It is crucial for data reconciliation and verifying temporal alignment between different records of the same event.
How Allen's Interval Algebra Works
Allen's Interval Algebra is a foundational formalism for qualitative temporal reasoning, defining the complete set of possible relationships between two time intervals.
Allen's Interval Algebra is a formal system for representing and reasoning about the qualitative temporal relationships between two convex time intervals. It defines thirteen possible base relations (e.g., before, meets, overlaps, during, finishes, equals) that exhaustively describe how one interval can be positioned relative to another on a timeline. These relations form the atomic vocabulary for expressing constraints in a temporal constraint satisfaction problem (TCSP), enabling logical inference about event ordering without requiring precise quantitative timestamps.
The algebra's power lies in its composition table, which defines how known relations between intervals A-B and B-C constrain the possible relation between A-C. This allows temporal reasoning engines to perform consistency checks and deduce new interval relationships within a network. In temporal knowledge graphs, Allen's relations are used to annotate edges between event or state nodes, providing a rich, human-interpretable structure for querying complex event sequences and narratives over time.
Applications in AI and Data Systems
Allen's Interval Algebra provides a formal, qualitative framework for reasoning about the temporal relationships between events or states, which is foundational for building intelligent systems that understand time.
Temporal Knowledge Graph Completion
Allen's relations are used to infer missing temporal facts within a Temporal Knowledge Graph (TKG). By applying the algebra's transitivity rules, a system can deduce that if Event A overlaps Event B, and Event B is during Event C, then Event A must overlap or be during Event C. This enables Temporal Knowledge Graph Completion (TKGC) models to predict not just what happened, but when it happened relative to other known events, filling gaps in historical records.
Event-Centric Graph Modeling
In Event Graph architectures, Allen's 13 relations serve as the primary edge types connecting interval-based events. This creates a rich, queryable structure for complex temporal narratives. For example:
- A manufacturing process meets a quality inspection.
- A server outage overlaps with a maintenance window.
- A financial transaction is before an audit cycle. This modeling is central to the Event Sourcing Pattern, where the sequence and relationships of immutable events define system state.
Temporal Query & Reasoning Engines
Specialized Temporal Reasoning Engines implement Allen's algebra to answer complex queries over time-varying data. These systems power:
- Temporal SPARQL extensions that allow queries like "Find all contracts that were active during the 2023 fiscal year."
- Consistency checking to ensure no logical contradictions exist in scheduled events (e.g., a task cannot start before and finish after its prerequisite).
- Temporal Fact Checking by verifying if a claimed sequence of events (e.g., "X happened after Y") is consistent with the known graph.
Temporal Constraint Satisfaction Problems
Allen's algebra formalizes scheduling and planning as Temporal Constraint Satisfaction Problems (TCSPs). Each interval (e.g., a task, a meeting, a machine operation) is a variable, and the allowed relationships between them are constraints. A solver finds a consistent global arrangement, enabling applications in:
- Autonomous Supply Chain Intelligence: Scheduling shipments where loading meets transit, which overlaps with customs clearance.
- Clinical Workflow Automation: Ensuring a patient assessment is before treatment, which is during a hospital stay.
- Smart Grid Optimization: Coordinating maintenance windows that must be before peak demand periods.
Foundation for Temporal Embeddings
Temporal Knowledge Graph Embedding (TKGE) models, such as TA-TransE or TeRo, incorporate Allen's relations into their learning objective. Instead of treating time as a simple timestamp, these models learn vector representations that encode how entities interact over specific intervals. This allows machine learning models to perform Temporal Link Prediction, forecasting not just if a relationship will form, but the qualitative temporal context (e.g., will Project Beta start after Project Alpha concludes?).
Narrative Understanding & Question Answering
Temporal Knowledge Graph Question Answering (TKGQA) systems use Allen's algebra to parse and reason over natural language questions involving time. For example, the question "What ongoing initiatives overlapped with the CEO's tenure?" requires the system to:
- Identify the interval for "CEO's tenure."
- Find all "initiative" intervals.
- Apply the overlaps relation filter. This enables Multi-Document Legal Reasoning to establish timelines of case law or Biomarker Identification Systems to correlate treatment intervals with patient outcome periods.
Allen's Algebra vs. Point-Based Temporal Models
A comparison of two fundamental approaches to representing time in knowledge graphs and reasoning systems, highlighting their core representational units, expressive power, and typical use cases.
| Feature / Dimension | Allen's Interval Algebra (Qualitative) | Point-Based Temporal Models (Quantitative) |
|---|---|---|
Primary Representational Unit | Time intervals (durations with start and end) | Time points (instants or timestamps) |
Core Temporal Primitive | Interval relationships (e.g., before, meets, overlaps) | Point ordering and metric distance (<, >, =, delta-t) |
Temporal Relationship Expressiveness | Qualitative (ordinal relationships between intervals) | Quantitative (metric distances and precise timestamps) |
Reasoning Mechanism | Constraint propagation over a network of interval relations | Mathematical/logical operations on point values and ranges |
Representation of Duration | Implicit within the interval entity | Explicit, calculated as the difference between two points |
Query Example | Find all events that overlapped during the project. | Find all transactions between 14:00 and 15:00 on 2024-01-15. |
Consistency Checking | Checks for global satisfiability of qualitative constraints (NP-hard in general). | Checks for contradictions in linear point orderings and metric constraints. |
Typical Application Domain | Narrative understanding, process modeling, common-sense reasoning. | Event logging, time-series analysis, financial transactions, IoT sensor data. |
Integration with Knowledge Graphs | Models events/entity states as nodes with interval-valued properties; edges capture qualitative temporal links. | Models facts as triples annotated with validity timestamps or point-in-time snapshots. |
Computational Complexity | High for full algebra (13 relations); tractable subsets (e.g., Pointisable) exist. | Generally lower; leverages efficient indexing of timestamps in databases. |
Frequently Asked Questions
A formal system for representing and reasoning about the qualitative relationships between time intervals. It is a foundational model for temporal reasoning in artificial intelligence, knowledge representation, and temporal databases.
Allen's Interval Algebra (IA) is a formal calculus for representing and reasoning about the qualitative temporal relationships between two convex time intervals. Developed by James F. Allen in 1983, it defines a set of 13 mutually exclusive primitive relations (e.g., before, meets, overlaps) that can describe all possible positional configurations between any two intervals on a timeline. It provides a logical framework for expressing temporal constraints and performing consistency checking and temporal inference without requiring precise numeric timestamps.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Allen's Interval Algebra provides the foundational logic for representing qualitative time. These related concepts build upon it to create practical systems for storing, querying, and reasoning over time-varying data.
Temporal Knowledge Graph (TKG)
A knowledge graph that explicitly represents the time-varying nature of facts, entity states, and relationships by associating them with temporal validity intervals or timestamps. It transforms static entity-relationship models into dynamic systems that can answer questions like "What was the organizational structure in Q3 2023?" or "When did this product become obsolete?"
- Core Extension: Adds a temporal dimension to each triple (subject, predicate, object), creating a quadruple (subject, predicate, object, time).
- Use Case: Enterprise change tracking, regulatory compliance auditing, and predictive maintenance based on historical asset states.
Temporal Validity Interval
A time range, defined by a start timestamp (validFrom) and an end timestamp (validTo), during which a specific fact, entity property, or relationship in a knowledge graph is considered to be true. This is the concrete data structure that implements the abstract intervals defined in Allen's Algebra.
- Representation: Often stored as
[t_start, t_end)where the interval is inclusive of the start time and exclusive of the end time. - Key Challenge: Managing overlapping, contiguous, or gap-filled intervals to ensure a consistent historical narrative.
Temporal Graph Database
A specialized graph database system with native support for storing, indexing, and querying time-evolving graph data. It provides built-in operators for reasoning over temporal validity intervals, eliminating the need for manual time-filtering in application code.
- Native Features: Include time-aware indexes, interval intersection joins, and support for temporal graph traversal queries.
- Examples: Systems like Apache Age with temporal extensions, or custom layers atop Neo4j or Amazon Neptune using property graphs with temporal attributes.
Temporal SPARQL
An extension to the standard SPARQL query language that incorporates temporal operators and functions to query time-annotated RDF data. It allows direct expression of Allen's relations (e.g., ?event1 :before ?event2) within the query itself.
- Core Functions: Include
VALID_TIME(?triple)to extract an interval, andDURING(?interval1, ?interval2)to test relationships. - Query Example:
SELECT * WHERE { ?employee :heldPosition ?role . VALID_TIME(?role) DURING "2023-01-01"^^xsd:dateTime . }finds roles active during 2023.
Temporal Reasoning Engine
A system that performs logical inference and consistency checking over temporal knowledge graphs by applying formal rules, including those defined by Allen's Interval Algebra. It can deduce new time-aware facts or identify contradictions (e.g., an employee being in two cities simultaneously).
- Mechanism: Uses a temporal constraint satisfaction problem (TCSP) solver to propagate interval relationships and maintain a consistent global timeline.
- Application: Critical for automated planning, scheduling systems, and maintaining data integrity in complex event histories.
Event Graph
A temporal knowledge graph model where events are first-class entities, connected by temporal (e.g., before, meets), causal (e.g., triggers), and participative (e.g., involves) relationships. It provides a narrative-centric view complementary to the state-centric view of interval-based TKGs.
- Core Structure: Nodes represent events (e.g., "Product Launch", "System Failure"), edges represent their qualitative and causal linkages.
- Integration with Allen's Algebra: The temporal relationships between event nodes are precisely defined using Allen's 13 relations.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us