Skip to content

Filters in Relational Classifications: Overview

Relational classifications can follow paths through multiple tables, but paths alone are often not enough to express real-world logic. In many cases, you need to refine which rows are included at one or more steps along the path. Filters provide this control.

Filters are applied to a specific step in the relations path and determine which rows may continue along the evaluation path. They allow relational classifications to remain precise and efficient, even when the underlying data is large or complex.

Minyu supports three filter types, each designed for a different category of problem:

  • Classification Filters – include or exclude rows based on existing value, relational, or logical classifications.
  • Set Filters – compare sets from different steps in the path using set operations (intersection, difference, etc.).
  • Temporal Filters – refine rows based on time-range relationships (overlaps, before, during, etc.).

All filters modify the set of rows before the final distinct row count is applied.

Why Filters Are Needed

A pure relational path retrieves all related rows, but practical rules often require additional conditions:

  • Only orders from the last six months
  • Only customers in the same region
  • Only meetings that overlap in time
  • Only active subscriptions
  • Only contacts with a specific role

Filters enable these constraints directly within the relational classification, without requiring additional tables or manual logic.

Where Filters Apply

Filters can be added to any step in the relations path. The system evaluates them in order:

  1. Follow the relation from the previous step.
  2. Apply all filters defined on that step.
  3. Produce the filtered set of rows to pass to the next step.

Multiple filters can be placed on the same step.

At the end of the path, the distinct filtered rows are counted and compared to the classification’s expectation.

Inclusion and Exclusion

Most filters can work in two modes:

  • Include – only rows matching the filter pass through.
  • Exclude – rows matching the filter are removed.

This dual mode allows filters to solve both “keep only these rows” and “filter out these rows” problems.

The Three Filter Families

1. Classification Filters

Use an existing classification to determine whether each row should continue. Example use cases:

  • Only active subscriptions
  • Orders newer than 6 months
  • Contacts with name present

Article 3 will cover these in detail.

2. Set Filters

Operate on groups of rows and compare sets from different steps. They solve problems involving “matching” across multiple tables. Example use cases:

  • Customers served by the correct sales rep
  • Items belonging to required categories
  • Ensuring region alignment

Article 4 will cover these in detail.

3. Temporal Filters

Evaluate relations between time intervals using Minyu’s temporal relation engine. Example use cases:

  • Detect overlapping meetings
  • Prevent double-booking of rooms
  • Identify contracts valid at the same time

Article 5 will cover these in detail.

When to Use Filters

Filters should be used when:

  • The relational path returns too many rows, and you need to narrow them down.
  • A rule depends on properties of intermediate rows, not just the final ones.
  • Time-based comparisons are required.
  • Two sets must be compared (e.g., region of rep vs region of customer).
  • Intermediate rows must be included or excluded based on conditions.

Without filters, relational classifications would not be able to express common scenarios like “recent orders,” “matching regions,” or “non-overlapping bookings.”