Repository navigation
Expand file tree
/
Copy pathfull-example.odcs.yaml
More file actions
362 lines (341 loc) · 10.7 KB
/
Copy pathfull-example.odcs.yaml
File metadata and controls
362 lines (341 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# Copyright 2026 The Bitol Contributors
# SPDX-License-Identifier: Apache-2.0
# What's this data contract about?
domain: seller # Domain
dataProduct: my quantum # Data product name
version: 1.1.0 # Version (follows semantic versioning)
status: active
id: 53581432-6c55-4ba2-a65f-72344a91553a
authoritativeDefinitions:
- type: canonical
url: https://github.com/bitol-io/open-data-contract-standard/blob/main/docs/examples/all/full-example.odcs.yaml
description: Canonical URL to the latest version of the contract.
# Lots of information
description:
purpose: Views built on top of the seller tables.
limitations: Data based on seller perspective, no buyer information
usage: Predict sales over time
authoritativeDefinitions:
- type: privacy-statement
url: https://example.com/gdpr.pdf
tenant: ClimateQuantumInc
kind: DataContract
apiVersion: v3.2.0 # Standard version (follows semantic versioning)
# Infrastructure & servers
servers:
- server: my-postgres
type: postgres
host: localhost
port: 5432
database: pypl-edw
schema: pp_access_views
# Dataset, schema, and quality
schema:
- id: tbl_obj
name: tbl
physicalName: tbl_1
physicalType: table
businessName: Core Payment Metrics
description: Provides core payment metrics
authoritativeDefinitions:
- url: https://catalog.data.gov/dataset/air-quality
type: businessDefinition
- url: https://youtu.be/jbY1BKFj9ec
type: videoTutorial
tags: [ 'finance', 'payments']
dataGranularityDescription: Aggregation on columns txn_ref_dt, pmt_txn_id
# Schema-level relationships (for composite keys)
relationships:
- type: foreignKey
from:
- tbl.rcvr_id
- tbl.rcvr_cntry_code
to:
- receivers.id
- receivers.country_code
customProperties:
- property: description
value: "Composite key linking to receivers table"
- property: cardinality
value: "many-to-one"
properties:
- id: txn_ref_dt_prop
name: transaction_reference_date
physicalName: txn_ref_dt
primaryKey: false
primaryKeyPosition: -1
businessName: transaction reference date
logicalType: date
physicalType: date
required: false
description: Reference date for transaction
partitioned: true
partitionKeyPosition: 1
criticalDataElement: false
tags: [ ]
classification: public
transformSourceObjects:
- table_name_1
- table_name_2
- table_name_3
transformLogic: sel t1.txn_dt as txn_ref_dt from table_name_1 as t1, table_name_2 as t2, table_name_3 as t3 where t1.txn_dt=date-3
transformDescription: defines the logic in business terms; logic for dummies
examples:
- "2022-10-03"
- "2020-01-28"
customProperties:
- property: anonymizationStrategy
value: none
- id: rcvr_id_prop
name: rcvr_id
primaryKey: true
primaryKeyPosition: 1
businessName: receiver id
logicalType: string
physicalType: varchar(18)
required: false
description: A description for column rcvr_id.
partitioned: false
partitionKeyPosition: -1
criticalDataElement: false
tags: [ 'uid' ]
classification: restricted
# Property-level relationship (from is implicit)
relationships:
- to: receivers.id
type: foreignKey
customProperties:
- property: description
value: "Links to receiver master data"
- id: rcvr_cntry_code_prop
name: rcvr_cntry_code
primaryKey: false
primaryKeyPosition: -1
businessName: receiver country code
logicalType: string
physicalType: varchar(2)
required: false
description: Country code
partitioned: false
partitionKeyPosition: -1
criticalDataElement: false
tags: [ ]
classification: public
# Enumeration of allowed values (RFC 0033, ODCS v3.2.0+)
enum:
- value: US
label: United States
description: ISO 3166-1 alpha-2 code for the United States.
- value: CA
label: Canada
- value: MX
label: Mexico
customProperties:
- property: languageEs
value: México
authoritativeDefinitions:
- url: https://collibra.com/asset/742b358f-71a5-4ab1-bda4-dcdba9418c25
type: businessDefinition
- url: https://github.com/myorg/myrepo
type: transformationImplementation
- url: jdbc:postgresql://localhost:5432/adventureworks/tbl_1/rcvr_cntry_code
type: implementation
encryptedName: rcvr_cntry_code_encrypted
quality:
- metric: nullValues
mustBe: 0
description: column should not contain null values
dimension: completeness
type: library
severity: error
businessImpact: operational
schedule: 0 20 * * *
scheduler: cron
customProperties:
- property: FIELD_NAME
value:
- property: COMPARE_TO
value:
- property: COMPARISON_TYPE
value: Greater than
quality:
- metric: rowCount
mustBeGreaterThan: 1000000
type: library
description: Ensure row count is within expected volume range
dimension: completeness
method: reconciliation
severity: error
businessImpact: operational
schedule: 0 20 * * *
scheduler: cron
customProperties:
- property: business-key
value:
- txn_ref_dt
- rcvr_id
# Receivers master table
- id: receivers_obj
name: receivers
physicalName: receivers_master
physicalType: table
businessName: Receivers Master Data
description: Master data for all receivers
tags: [ 'master-data', 'receivers' ]
properties:
- id: receiver_id_prop
name: id
primaryKey: true
primaryKeyPosition: 1
businessName: receiver identifier
logicalType: string
physicalType: varchar(18)
required: true
description: Unique identifier for receiver
unique: true
classification: restricted
- id: country_code_prop
name: country_code
primaryKey: true
primaryKeyPosition: 2
businessName: receiver country
logicalType: string
physicalType: varchar(2)
required: true
description: Country code of the receiver
classification: public
- id: receiver_name_prop
name: receiver_name
businessName: receiver name
logicalType: string
physicalType: varchar(255)
required: true
description: Name of the receiver
classification: restricted
- id: receiver_type_prop
name: receiver_type
businessName: receiver type
logicalType: string
physicalType: varchar(20)
required: false
description: Type of receiver (individual, business, etc.)
classification: public
# Example of nested reference
relationships:
- to: receiver_types.type_code
customProperties:
- property: description
value: "Links to receiver type definitions"
# Map-typed property (RFC 0030, ODCS v3.2.0+)
- id: receiver_attributes_prop
name: receiver_attributes
businessName: receiver attributes
logicalType: map
physicalType: "MAP<STRING, STRING>"
required: false
description: Free-form attributes attached to a receiver, keyed by attribute name.
classification: restricted
map:
key:
logicalType: string
description: Attribute name.
value:
logicalType: string
description: Attribute value.
# Pricing
price:
priceAmount: 9.95
priceCurrency: USD
priceUnit: megabyte
# Team
team:
name: my-team
description: The team owning the data contract
members:
- username: ceastwood
role: Data Scientist
dateIn: "2022-08-02"
dateOut: "2022-10-01"
replacedByUsername: mhopper
- username: mhopper
role: Data Scientist
dateIn: "2022-10-01"
- username: daustin
role: Owner
description: Keeper of the grail
dateIn: "2022-10-01"
# Roles
roles:
- role: microstrategy_user_opr
access: read
firstLevelApprovers: Reporting Manager
secondLevelApprovers: 'mandolorian'
- role: bq_queryman_user_opr
access: read
firstLevelApprovers: Reporting Manager
secondLevelApprovers: na
- role: risk_data_access_opr
access: read
firstLevelApprovers: Reporting Manager
secondLevelApprovers: 'dathvador'
- role: bq_unica_user_opr
access: write
firstLevelApprovers: Reporting Manager
secondLevelApprovers: 'mickey'
# SLA
slaProperties:
- property: latency # Property, see list of values in DP QoS
value: 4
unit: d # d, day, days for days; y, yr, years for years
element: tab1.txn_ref_dt # This would not be needed as it is the same table.column as the default one
- property: generalAvailability
value: "2022-05-12T09:30:10-08:00"
- property: endOfSupport
value: "2032-05-12T09:30:10-08:00"
- property: endOfLife
value: "2042-05-12T09:30:10-08:00"
- property: retention
value: 3
unit: y
element: tab1.txn_ref_dt
- property: frequency
value: 1
valueExt: 1
unit: d
element: tab1.txn_ref_dt
- property: timeOfAvailability
value: 09:00-08:00
element: tab1.txn_ref_dt
driver: regulatory # Describes the importance of the SLA: [regulatory|analytics|operational|...]
- property: timeOfAvailability
value: 08:00-08:00
element: tab1.txn_ref_dt
driver: analytics
# Support
support:
- channel: '#product-help' # Simple Slack communication channel
tool: slack
- channel: datacontract-ann # Simple distribution list
tool: email
url: mailto:datacontract-ann@bitol.io
- channel: Feedback # Product Feedback
description: General Product Feedback (Public)
url: https://product-feedback.com
- channel: 'product-issues'
tool: teams
scope: issues
customProperties:
- property: servicehours
value: 9-5 CET
# Tags
tags:
- transactions
# Custom properties
customProperties:
- property: refRulesetName
value: gcsc.ruleset.name
- property: somePropertyName
value: property.value
- property: dataprocClusterName # Used for specific applications like Elevate
value: [ cluster name ]
contractCreatedTs: "2022-11-15T02:59:43+00:00"