Relational classification filters overview
Relational classifications often follow relations that produce many related rows.
Filters are used to narrow those rows down so the classification evaluates only the rows that matter.
Instead of counting every related row, filters allow the system to:
- keep rows that match a condition
- remove rows that should not be considered
- compare row sets
- evaluate time relationships
Filters help express real business rules more precisely.
Types of filters
Relational classifications support three types of filters.
Classification filters
Classification filters reuse an existing classification to decide whether a row should remain in the result set.
Example:
Relation path
Filter
Only rooms marked as active are kept.
Set filters
Set filters compare two sets of rows produced during evaluation.
Example:
A customer may have bookings and reservations.
A set filter could check:
This allows the classification to reason about how two sets of rows relate to each other.
Temporal filters
Temporal filters compare time intervals.
Example:
A room booking may overlap with another booking.
A temporal filter could check:
Temporal filters make it possible to evaluate scheduling conflicts and time-based logic.
When filters are evaluated
Filters are applied during evaluation, not after.
Evaluation happens step by step:
- Start with the row being evaluated
- Follow a relation to collect related rows
- Apply filters to remove unwanted rows
- Continue to the next relation step
- Count the remaining rows at the end
If filters remove all rows, the classification result becomes false.
Example
Tables
- Customer
- Booking
- Room
Relations
Filter
Evaluation
| Customer | Rooms found | Rooms counted |
|---|---|---|
| Anna | Room101, Room102 | Room101 |
| Erik | Room103 | Room103 |
The filter ensures that only active rooms are counted.
Why filters matter
Without filters, relational classifications could produce large result sets that do not reflect the intended rule.
Filters make relational logic:
- more precise
- easier to understand
- easier to reuse
They ensure the classification counts only the rows that are relevant to the rule.
A simple way to think about filters
Filters answer the question:
Which of the related rows should actually be considered?
By applying filters during evaluation, the system can express complex rules while keeping the underlying relation paths simple.
Related resources
Related concepts