Introduction to Temporal Relations: With Examples
Temporal relations describe how two time intervals relate to each other. These relations are based on Allen's Interval Algebra1, which defines 13 distinct ways in which two intervals can interact. Understanding these temporal relations is key to effectively managing time-based data, such as scheduling or resource allocation.
This article explains the 13 temporal relations with clear examples, using time intervals to illustrate each variant and screens from how these relations are visualized in Minyu.
Visualizing Temporal Relations in the UI Component
The UI component for selecting temporal relations is designed to visually illustrate how different time intervals relate to a reference interval. This intuitive design allows users to both define and refine temporal filters with ease.

Figure: Example on how to filter on any rows that in any way intersects with the reference interval.
-
Vertical Bar (Reference Interval)
The vertical bar represents the time span of the source row and serves as the baseline against which all other intervals are evaluated. -
Horizontal Bars (Candidate Intervals)
Each horizontal bar represents a potential time interval being compared to the reference interval. The horizontal dimension corresponds to a timeline, visually demonstrating how each interval aligns, overlaps, or interacts with the reference interval. -
Placement and Relations
The relative position of the horizontal bars to the vertical bar visually defines the temporal relation. Examples include:- A horizontal bar starting before and ending after the vertical bar represents an "overlaps" relation.
- A horizontal bar fully enclosed within the vertical bar represents a "during" relation.
- A horizontal bar starting and ending after the vertical bar represents a "starts after" relation.
-
Interactive Selection
Users can interact with the visual representation to toggle or select desired temporal relations:- Clicking on a horizontal bar activates or deactivates its inclusion in the filter.
- This makes it straightforward to define temporal relations without needing to rely on complex text-based configurations.
-
Exclude Matching Option
The component also allows users to specify that rows matching the selected temporal relations should be excluded. By toggling an Exclude Matching option, users can invert the filter's behavior, ensuring that rows matching the selected temporal relations are excluded, while all other rows are included in the results.
The 13 Temporal Relations:
The examples below illustrate the 13 temporal relations and how they are represented in the UI component. In Minyu, Interval A (horizontal bars) represents the rows being evaluated for inclusion or exclusion, while Interval B (vertical bar) represents the reference interval derived from the source row in the first step of the filter.
1. Before
One interval ends entirely before another begins.
- Example:
- Interval A: 09:00–10:00
- Interval B: 11:00–12:00
- Relation: A is before B.

2. Meets
One interval ends exactly as another begins.
- Example:
- Interval A: 09:00–10:00
- Interval B: 10:00–11:00
- Relation: A meets B.

3. Overlaps
One interval starts before another begins and ends after the other has started.
- Example:
- Interval A: 09:00–11:00
- Interval B: 10:00–12:00
- Relation: A overlaps B.

4. Starts
One interval starts exactly when another starts but ends earlier.
- Example:
- Interval A: 09:00–10:00
- Interval B: 09:00–11:00
- Relation: A starts B.

5. During
One interval is fully contained within another.
- Example:
- Interval A: 09:30–10:00
- Interval B: 09:00–11:00
- Relation: A is during B.

6. Finishes
One interval ends exactly when another ends but starts later.
- Example:
- Interval A: 10:00–11:00
- Interval B: 09:00–11:00
- Relation: A finishes B.

7. Equals
Two intervals start and end at exactly the same time.
- Example:
- Interval A: 09:00–11:00
- Interval B: 09:00–11:00
- Relation: A equals B.

8. After
One interval starts entirely after another ends.
- Example:
- Interval A: 11:00–12:00
- Interval B: 09:00–10:00
- Relation: A is after B.

9. Met By
One interval starts exactly as another ends.
- Example:
- Interval A: 10:00–11:00
- Interval B: 09:00–10:00
- Relation: A is met by B.

10. Overlapped By
One interval starts after another has started but ends before the other ends.
- Example:
- Interval A: 10:00–12:00
- Interval B: 09:00–11:00
- Relation: A is overlapped by B.

11. Started By
One interval starts exactly when another starts but ends later.
- Example:
- Interval A: 09:00–11:00
- Interval B: 09:00–10:00
- Relation: A is started by B.

12. Contains
One interval fully contains another.
- Example:
- Interval A: 09:00–11:00
- Interval B: 09:30–10:00
- Relation: A contains B.

13. Finished By
One interval ends exactly when another ends but starts earlier.
- Example:
- Interval A: 09:00–11:00
- Interval B: 10:00–11:00
- Relation: A is finished by B.

Understanding these 13 temporal relations provides a solid foundation for building complex temporal logic in Minyu, where time-based relationships are crucial for data management and decision-making.
-
James F. Allen is a prominent computer scientist known for his work in artificial intelligence and temporal reasoning. He introduced the Interval Algebra in 1983 to formalize how time intervals can relate to one another. ↩