Skip to content

Temporal filters

Temporal filters are used in relational classifications when the rule depends on how time ranges relate to each other.

They restrict the rows at a path step by comparing the time-range value of each related row with the time-range value of the starting row.

This makes them useful for cases where the system must reason about how two intervals interact in time.

Examples:

  • prevent overlapping bookings for the same resource
  • find contracts that are active during a requested period
  • keep only availability ranges that contain a requested interval

How temporal filters work

A temporal filter is applied at a specific step in a relation path.

At that step, the system:

  1. follows the relation path and collects related rows
  2. reads the time range from each related row
  3. compares that time range with the time range of the starting row
  4. keeps only rows that match the selected temporal relation

Rows that do not match are removed from the set before evaluation continues.

Reference interval

The reference interval always comes from the starting row of the relational classification.

That interval stays the same while the system evaluates one starting row.

Example:

Table: Booking

Booking Start End
B001 10:00 11:00

This booking interval becomes the reference interval.

Candidate intervals

The candidate intervals come from the related rows at the filtered step.

Example:

Table: Reservation

Reservation Start End
R001 09:30 10:30
R002 11:00 12:00

Each reservation interval is compared to the booking interval from the starting row.

Temporal relations

Temporal filters use Minyu’s temporal-relation engine.

These relations are based on the 13 standard interval relations from temporal logic, commonly known as Allen’s interval algebra.

Examples of temporal relations include:

  • Before
  • After
  • Meets
  • Overlaps
  • During
  • Contains
  • Starts
  • Finishes
  • Equals

A row is kept if its interval matches one of the selected temporal relations.

A separate article describes temporal relations in more detail.

Example: overlapping bookings

Imagine the system is evaluating whether a booking conflicts with existing reservations.

Starting row:

Booking Start End
B001 10:00 11:00

Related rows:

Reservation Start End
R001 09:30 10:30
R002 11:00 12:00

Temporal filter:

Reservation overlaps Booking

Result:

Reservation Overlaps booking Counted
R001 yes yes
R002 no no

Only rows whose intervals match the selected relation remain in the result set.

Important requirements

Temporal filters can only be used when:

  • the starting row has a supported time-range value
  • the filtered step also has a supported time-range value

Without compatible time ranges, the system cannot apply temporal relations.

A simple way to think about temporal filters

Temporal filters answer the question:

How does the time range of this related row relate to the time range of the starting row?

By comparing intervals directly, the system can express scheduling conflicts, availability checks, and other time-based rules that cannot be handled by ordinary value checks.