A single binary assertion, column never null, value in range, identifier unique, making quality testable.
A data quality rule is a single testable assertion about data: a column is never null, a value sits inside a range, an identifier is unique, a table was refreshed within the hour. Each rule is small and binary.
An analytics team runs a model that computes daily active users. They attach four rules to it: user_id is unique, event_date is not null, the count stays within 50 percent of the trailing seven-day average, and the source table was loaded in the last two hours. One morning the freshness rule fails, the count rule passes, and the model is held back before it can publish a stale number to leadership. Tools like dbt tests and Great Expectations make rules like these declarative and run them on every pipeline execution.
The six widely cited dimensions, formalised by Wang and Strong in 1996, give a vocabulary for what rules check: accuracy, completeness, consistency, validity, timeliness, and uniqueness.
In the Unified Product Graph, a data quality rule sits in the data and analytics region and connects most directly to the things it protects. A metric is validated by a rule (Metricvalidated byData Quality Rulehierarchy), and rules associate with the metric_validated_by_data_quality_ruleData SourceData & AnalyticsA data source or integrationView reference → they test and the data_sourceData LineageData & AnalyticsA record of data origin and transformationsView reference → that traces failures. That metric edge is the meaningful one: it turns an abstract assertion into a guarantee attached to a specific business number, so you can ask which metrics are guarded and which are flying blind.data_lineage
Worked example: Trellis
A core data quality rule in Trellis requires that every agent-change event in the event schemaEvent SchemaData & AnalyticsAn event schema for trackingView reference → carries who initiated it, what records it touched, why it was proposed, and an approval state before it is considered complete. Without that rule, the audit trail behind Guardrails and audit would have gaps, and one-click rollback could not guarantee it was undoing the right thing.
Type-specific fields on BaseNode
rule_typeenumQuality dimension this rule validates
test_typeenumSpecific test implementation
column_refstringColumn or field this rule applies to
thresholdstringAcceptable threshold value for the rule
alert_on_breachbooleanWhether to send an alert when the rule is breached
last_run_statusenumResult of the most recent run
last_run_datestringISO date of the most recent run
idstringrequiredUnique identifier (UUID)
typeNodeTyperequiredDiscriminator for the entity type
titlestringrequiredDisplay name
descriptionstringOptional detailed description
statusstringLifecycle status
tagsstring[]Freeform tags for filtering
2 edge types connected to this entity.
metric_validated_by_data_quality_ruledata_quality_rule_governs_data_source