Skip to content

Examples of Data Contracts

This folder contains example data contracts illustrating each section of the Open Data Contract Standard. Most files are excerpts that exercise a single feature; the full examples put many features together in a single contract.

Every YAML file here validates against schema/odcs-json-schema-latest.json.

Table of contents

Full examples

End-to-end contracts that combine many sections.

  • Full example — covers fundamentals, schema with relationships and an enum, a map property, quality, pricing, team, support, roles, SLA, servers, and custom properties.
  • PostgreSQL AdventureWorks

Fundamentals

Top-level contract identification (apiVersion, id, name, version, status, domain, dataProduct, description).

Schema

Objects, properties, primary keys, partitioning, and the v3.2.0 logical types.

Data types

References & relationships

Foreign-key relationships at property level, schema level, composite, and via shorthand notation (RFC 0026).

Data quality

Servers

Per-server-type connection metadata.

Pricing

Team (formerly stakeholders)

Owners, stewards, and contributors of the data contract. Pre-v3.x of the standard called this section stakeholders; from v3.x onward the canonical name is team. Both shapes are still accepted by the schema, but the legacy stakeholders array structure is deprecated and will be removed in ODCS v4 — new contracts should use the team object.

Roles

Service-level agreement

Support & communication channels

All recommended tool values (email, slack, teams, discord, ticket, googlechat) and the four scope values (interactive, announcements, issues, notifications).

Authoritative definitions

Linking the contract — at root, element, and property scope — to external sources of truth (business glossaries, dbt models, video tutorials, canonical URLs, etc.).

Tags

Lightweight classification labels at every supported scope: contract root, schema element, schema property, enum value, quality rule, team, and team member.

Custom & other properties

Free-form customProperties arrays at root, element, and property scope, plus the standard contractCreatedTs field.


Validating an example locally

The negative-test scripts under src/script/ use ajv; for a one-off positive validation, any JSON Schema validator that supports draft 2019-09 will do. Example with Python jsonschema:

python3 -c "
import json, yaml, jsonschema
schema = json.load(open('schema/odcs-json-schema-latest.json'))
data = yaml.safe_load(open('docs/examples/schema/map.md'))
jsonschema.Draft201909Validator(schema).validate(data)
print('ok')
"