A data quality rule is a testable statement about a column or a table that returns pass or fail. It names a target, a condition, a threshold, and an action on failure. Every quality tool on the market writes one the same way, in a rule language the tool owns. This post shows data quality rules examples in six of those languages, each quoted from the vendor's own documentation. Then it asks the question the examples pages skip: when the platform changes, what happens to the rule?
Five rules cover most of what a quality programme checks: completeness, allowed values, referential integrity, a cross-column business rule, and membership of the concept. The first four have a syntax in every tool below. The fifth has a syntax in one, because only one rule language sits on the model of what the column means. That is the rule that can leave the tool.
Four parts, in every language. Our post What Is Data Quality? covers the six dimensions a rule serves and the definition each one assumes.
| Part | What it names | Example |
|---|---|---|
| Target | The column or table the rule is about | order_id |
| Condition | The boolean each row, or the whole table, must satisfy | Is never null |
| Threshold | How many failures still count as a pass | Zero rows, or 99 percent |
| Action | What the engine does on failure | Warn, drop the row, or fail the load |
The Open Data Contract Standard, ODCS, writes the four into one YAML block. Its library example for order_id reads metric: nullValues, mustBe: 0, unit: rows (Bitol, ODCS, read 2026-11-27). The same page puts meaning somewhere else: "Authoritative definitions indicate the link to external definition." Our post Data Product vs Data Contract: A Contract Is Not a Definition follows that link.
Most programmes write the same five rules under different names. The first four each serve one of the six dimensions DAMA UK published in 2013, which DAMA-DMBOK carries. DAMA UK measures completeness against "Business rules which define what '100% complete' represents" (DAMA UK, 2013). The fifth rule is the one those business rules assume.
| Rule | Plain English | Dimension (DAMA UK, 2013) | Measured against |
|---|---|---|---|
| Completeness | order_id is never null | Completeness | A business rule that says the field is required |
| Allowed values | size is S, M, or L | Validity | The permitted values in the field's definition |
| Referential integrity | Every zipcode exists in the reference table | Consistency | The reference data set |
| Cross-column business rule | Fare is positive whenever trip distance is positive | Accuracy | The business rule, written in prose |
| Membership of the concept | Every row in customers is a customer as the business defines one | None of the six | The governed definition of a customer |
Our post Data Quality Dimensions: The Six, and the One They All Assume takes the fifth row dimension by dimension. Here the question is which language can write it.
The allowed-values rule is the cleanest comparison. Every tool has one, and every version reads the same way: a column and a list. Each snippet below is quoted from the vendor's documentation, read on 2026-11-27.
AWS Glue DQDL. "Data Quality Definition Language (DQDL) is a domain specific language that you use to define rules for AWS Glue Data Quality" (AWS documentation).
ColumnValues "colA" in [ "a", "b", "c" ]Databricks expectation. "Expectations are optional clauses in pipeline materialized view, streaming table, or view creation statements that apply data quality checks on each record passing through a query." Its documented example is a range (Databricks documentation, last updated 2026-11-13).
CONSTRAINT valid_customer_age EXPECT (age BETWEEN 0 AND 120)Snowflake data metric function. "A DMF measures an attribute of your data such as how many NULL values exist in a column or how often a table is being updated" (Snowflake documentation). The allowed-values DMF (Snowflake documentation):
ALTER TABLE t1 ADD DATA METRIC FUNCTION SNOWFLAKE.CORE.ACCEPTED_VALUES ON (age, age -> age = 5);Soda check. "The checks in a Soda data contract are similar to unit tests for testing software." A column-level check in the contract YAML (Soda contract language reference).
- name: size
checks:
- invalid:
valid_values: ['S', 'M', 'L']Great Expectations assertion. "An Expectation is a verifiable assertion about data" (GX Core overview). From the 1.25.0 page on expectation conditions (GX documentation):
gx.expectations.ExpectColumnValuesToBeInSet(
column="status",
value_set=["unpaid", "partially_paid"],
row_condition=row_condition,
)SHACL shape. SHACL, the W3C Shapes Constraint Language, is "a language for validating RDF graphs against a set of conditions". Its sh:in constraint "specifies the condition that each value node is a member of a provided SHACL list" (W3C Recommendation, 20 July 2017). The specification's own example:
ex:InExampleShape
a sh:NodeShape ;
sh:targetNode ex:RainbowPony ;
sh:property [
sh:path ex:color ;
sh:in ( ex:Pink ex:Purple ) ;
] .Five of the six name a column in a table. The sixth names a property of a thing in a model, and the allowed values are themselves things in that model. Our post What Is SHACL? explains the language. Our post Data Quality vs Data Validation: Where the Rule Lives covers where each rule runs.
The other three value rules show the same split. Every cell is quoted from the page linked, read 2026-11-27.
| Tool | Completeness | Referential integrity | Cross-column rule |
|---|---|---|---|
| AWS Glue DQDL | (IsComplete "id") and (IsUnique "id") (DQDL reference) | ReferentialIntegrity "zipcode" "reference.zipcode" >= 0.9 (AWS) | CustomSql "select id from primary where age < 100" (AWS) |
| Snowflake | SNOWFLAKE.CORE.NULL_COUNT ON (c1) (Snowflake) | A user-defined DMF, referential_check, whose body is SELECT COUNT(*) FROM arg_t1 WHERE arg_c1 NOT IN (SELECT arg_c2 FROM arg_t2) (Snowflake) | Any user-defined DMF |
| Microsoft Purview | An "Empty/blank fields" rule type (Microsoft Learn, dated 2026-10-13) | "Table lookup": "Confirms that a value in one table can be found in the specific column of another table." | Row expression tripDistance > 0 AND fareAmount > 0. "Custom SQL rules in Microsoft Purview Data Quality don't support joins." |
| SHACL | sh:minCount 1 on a property (W3C) | sh:class ex:PostalAddress: "each value node is a SHACL instance of a given type" | A SHACL-SPARQL constraint, Part 2 of the Recommendation |
Three tools treat referential integrity as a lookup from one table into another. SHACL treats it as a type: the value has to be an instance of PostalAddress in the model.
Four products put a catalog in front of the rule. Each is quoted from its own page, read on 2026-11-27.
So a catalog-side product can bind a rule to a term, and two of the four say so in their own words. Three questions follow. What is the definition held as: a glossary entry, or a class in a model with its properties? What language is the rule written in: the product's own expression language, SQL, or a standard? And can the rule and the definition leave together, in a form another engine can run? No Purview, Collibra, Informatica, or Ataccama page read on 2026-11-27 names RDF, OWL, SKOS, SHACL, or SPARQL.
Three things happen to every rule. The platform under it is replaced. The rule is asked to run on a second platform. An auditor or an agent asks what the rule was testing for, and who agreed to it. A rule in a product's own language answers none of those.
Regulation now asks the third question in writing. Article 10 of the EU AI Act requires practices covering "the formulation of assumptions, in particular with respect to the information that the data are supposed to measure and represent" (Article 10(2)(d), artificialintelligenceact.eu, read 2026-11-27). A pass rate records that the values met the rule; the article asks for the assumption behind it. The regulation page, read on 2026-11-27, gives two application dates. High-risk systems under Annex III: 2 December 2027. High-risk systems under Annex I: 2 August 2028. Both cite Article 113(c). The dates moved during 2026; read the page before you plan against them.
That is the fifth rule from the examples table. In SHACL, "every row in customers is a customer" is a shape with sh:targetClass on Customer and a property constraint that requires at least one billed account. The same shape validates the Finance table and the Sales table, and says which rows are the thing the definition names. This is semantic data quality, or data quality measured against the governed meaning of the column. Cortés, Ehrlinger, Etcheverry, and Naumann "defined SHACL shapes for 69 data quality metrics proposed by Zaveri et al." (arXiv 2507.22305, ISWC 2025 workshop, v3 dated 2025-09-14).
Our post Metadata Quality: How to Measure It and What to Do About It already writes quality rules as SHACL shapes. Our post How to Validate an Ontology with SHACL walks through a run. Our post Data Quality Standards Compared: ISO 8000, DAMA, ODCS and SHACL lays the four standards side by side.
Keep your rule engine. It scores the values well. TQ Data Foundation holds the rule the scores assume: the SHACL shape on the governed definition, with the approver, the version, and the review date on the same record. SHACL is a standard TopQuadrant helped author. Policy-as-code, SHACL constraints, and validation rules run on the data, and validated data publishes automatically. AI proposes the first draft of a shape; your experts confirm it. Your catalog stays, and it syncs. Agents receive the definition, its relationships, and the rule over MCP, a Python SDK, and REST. Everything is RDF, SKOS, OWL and SHACL, exportable in full at any time.
Take the busiest rule in your engine and ask what it looks like outside the engine. If the answer is a screenshot, the rule has never travelled. TopQuadrant holds the version that does: a shape on the definition, in TQ Data Foundation.