data-graf 0.1.0.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data_graf-0.1.0.dev0.dist-info/METADATA +86 -0
- data_graf-0.1.0.dev0.dist-info/RECORD +15 -0
- data_graf-0.1.0.dev0.dist-info/WHEEL +4 -0
- data_graf-0.1.0.dev0.dist-info/entry_points.txt +2 -0
- data_graf-0.1.0.dev0.dist-info/licenses/LICENSE +201 -0
- data_graf-0.1.0.dev0.dist-info/licenses/NOTICE +10 -0
- datagraf/__init__.py +17 -0
- datagraf/checks.py +114 -0
- datagraf/cli.py +231 -0
- datagraf/export.py +41 -0
- datagraf/lineage.py +212 -0
- datagraf/model.py +201 -0
- datagraf/schemas/osi-0.1.1.schema.json +344 -0
- datagraf/schemas/ossie-0.3.0.dev0.schema.json +398 -0
- datagraf/sqlite.py +134 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/open-semantic-interchange/OSI/core-spec/osi-schema.json",
|
|
4
|
+
"title": "OSI Core Metadata Specification",
|
|
5
|
+
"description": "JSON Schema for validating OSI (Open Semantic Interoperability) semantic model definitions",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"version": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "0.1.1",
|
|
11
|
+
"description": "OSI specification version"
|
|
12
|
+
},
|
|
13
|
+
"dialects": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"description": "Supported expression language dialects (enumeration definition)",
|
|
16
|
+
"items": {
|
|
17
|
+
"$ref": "#/$defs/Dialect"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"vendors": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"description": "Supported vendors for custom extensions (enumeration definition)",
|
|
23
|
+
"items": {
|
|
24
|
+
"$ref": "#/$defs/Vendor"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"semantic_model": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"description": "Collection of semantic model definitions",
|
|
30
|
+
"items": {
|
|
31
|
+
"$ref": "#/$defs/SemanticModel"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"required": ["version", "semantic_model"],
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"$defs": {
|
|
38
|
+
"Dialect": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"enum": ["ANSI_SQL", "SNOWFLAKE", "MDX", "TABLEAU", "DATABRICKS", "MAQL"],
|
|
41
|
+
"description": "Supported SQL and expression language dialects"
|
|
42
|
+
},
|
|
43
|
+
"Vendor": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"enum": ["COMMON", "SNOWFLAKE", "SALESFORCE", "DBT", "DATABRICKS", "GOODDATA"],
|
|
46
|
+
"description": "Supported vendors for custom extensions"
|
|
47
|
+
},
|
|
48
|
+
"AIContext": {
|
|
49
|
+
"description": "Additional context for AI tools",
|
|
50
|
+
"oneOf": [
|
|
51
|
+
{
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"instructions": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "Instructions for AI on how to use this entity"
|
|
60
|
+
},
|
|
61
|
+
"synonyms": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
},
|
|
66
|
+
"description": "Alternative names and terms"
|
|
67
|
+
},
|
|
68
|
+
"examples": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
"description": "Sample questions or use cases"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"additionalProperties": true
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"CustomExtension": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"description": "Vendor-specific attributes for extensibility",
|
|
83
|
+
"properties": {
|
|
84
|
+
"vendor_name": {
|
|
85
|
+
"$ref": "#/$defs/Vendor"
|
|
86
|
+
},
|
|
87
|
+
"data": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"description": "JSON string containing vendor-specific data"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"required": ["vendor_name", "data"],
|
|
93
|
+
"additionalProperties": false
|
|
94
|
+
},
|
|
95
|
+
"DialectExpression": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"description": "Expression in a specific dialect",
|
|
98
|
+
"properties": {
|
|
99
|
+
"dialect": {
|
|
100
|
+
"$ref": "#/$defs/Dialect"
|
|
101
|
+
},
|
|
102
|
+
"expression": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "SQL or dialect-specific expression"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"required": ["dialect", "expression"],
|
|
108
|
+
"additionalProperties": false
|
|
109
|
+
},
|
|
110
|
+
"Expression": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"description": "Expression definition with multi-dialect support",
|
|
113
|
+
"properties": {
|
|
114
|
+
"dialects": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"items": {
|
|
117
|
+
"$ref": "#/$defs/DialectExpression"
|
|
118
|
+
},
|
|
119
|
+
"minItems": 1
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"required": ["dialects"],
|
|
123
|
+
"additionalProperties": false
|
|
124
|
+
},
|
|
125
|
+
"Dimension": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"description": "Dimension metadata",
|
|
128
|
+
"properties": {
|
|
129
|
+
"is_time": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"description": "Indicates if this is a time-based dimension for temporal filtering"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"additionalProperties": false
|
|
135
|
+
},
|
|
136
|
+
"Field": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"description": "Row-level attribute for grouping, filtering, and metric expressions",
|
|
139
|
+
"properties": {
|
|
140
|
+
"name": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"description": "Unique identifier for the field within the dataset"
|
|
143
|
+
},
|
|
144
|
+
"expression": {
|
|
145
|
+
"$ref": "#/$defs/Expression"
|
|
146
|
+
},
|
|
147
|
+
"dimension": {
|
|
148
|
+
"$ref": "#/$defs/Dimension"
|
|
149
|
+
},
|
|
150
|
+
"label": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"description": "Label for categorization"
|
|
153
|
+
},
|
|
154
|
+
"description": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"description": "Human-readable description"
|
|
157
|
+
},
|
|
158
|
+
"ai_context": {
|
|
159
|
+
"$ref": "#/$defs/AIContext"
|
|
160
|
+
},
|
|
161
|
+
"custom_extensions": {
|
|
162
|
+
"type": "array",
|
|
163
|
+
"items": {
|
|
164
|
+
"$ref": "#/$defs/CustomExtension"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"required": ["name", "expression"],
|
|
169
|
+
"additionalProperties": false
|
|
170
|
+
},
|
|
171
|
+
"Dataset": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"description": "Logical dataset representing a business entity (fact or dimension table)",
|
|
174
|
+
"properties": {
|
|
175
|
+
"name": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"description": "Unique identifier for the dataset"
|
|
178
|
+
},
|
|
179
|
+
"source": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"description": "Reference to underlying physical table/view (database.schema.table) or query"
|
|
182
|
+
},
|
|
183
|
+
"primary_key": {
|
|
184
|
+
"type": "array",
|
|
185
|
+
"items": {
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
"description": "Primary key columns (single or composite)"
|
|
189
|
+
},
|
|
190
|
+
"unique_keys": {
|
|
191
|
+
"type": "array",
|
|
192
|
+
"items": {
|
|
193
|
+
"type": "array",
|
|
194
|
+
"items": {
|
|
195
|
+
"type": "string"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"description": "Array of unique key definitions (each can be single or composite)"
|
|
199
|
+
},
|
|
200
|
+
"description": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"description": "Human-readable description"
|
|
203
|
+
},
|
|
204
|
+
"ai_context": {
|
|
205
|
+
"$ref": "#/$defs/AIContext"
|
|
206
|
+
},
|
|
207
|
+
"fields": {
|
|
208
|
+
"type": "array",
|
|
209
|
+
"items": {
|
|
210
|
+
"$ref": "#/$defs/Field"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"custom_extensions": {
|
|
214
|
+
"type": "array",
|
|
215
|
+
"items": {
|
|
216
|
+
"$ref": "#/$defs/CustomExtension"
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"required": ["name", "source"],
|
|
221
|
+
"additionalProperties": false
|
|
222
|
+
},
|
|
223
|
+
"Relationship": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"description": "Foreign key relationship between datasets",
|
|
226
|
+
"properties": {
|
|
227
|
+
"name": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"description": "Unique identifier for the relationship"
|
|
230
|
+
},
|
|
231
|
+
"from": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"description": "Dataset on the many side of the relationship"
|
|
234
|
+
},
|
|
235
|
+
"to": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"description": "Dataset on the one side of the relationship"
|
|
238
|
+
},
|
|
239
|
+
"from_columns": {
|
|
240
|
+
"type": "array",
|
|
241
|
+
"items": {
|
|
242
|
+
"type": "string"
|
|
243
|
+
},
|
|
244
|
+
"minItems": 1,
|
|
245
|
+
"description": "Foreign key columns in the 'from' dataset"
|
|
246
|
+
},
|
|
247
|
+
"to_columns": {
|
|
248
|
+
"type": "array",
|
|
249
|
+
"items": {
|
|
250
|
+
"type": "string"
|
|
251
|
+
},
|
|
252
|
+
"minItems": 1,
|
|
253
|
+
"description": "Primary/unique key columns in the 'to' dataset"
|
|
254
|
+
},
|
|
255
|
+
"ai_context": {
|
|
256
|
+
"$ref": "#/$defs/AIContext"
|
|
257
|
+
},
|
|
258
|
+
"custom_extensions": {
|
|
259
|
+
"type": "array",
|
|
260
|
+
"items": {
|
|
261
|
+
"$ref": "#/$defs/CustomExtension"
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"required": ["name", "from", "to", "from_columns", "to_columns"],
|
|
266
|
+
"additionalProperties": false
|
|
267
|
+
},
|
|
268
|
+
"Metric": {
|
|
269
|
+
"type": "object",
|
|
270
|
+
"description": "Quantitative measure defined on business data",
|
|
271
|
+
"properties": {
|
|
272
|
+
"name": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"description": "Unique identifier for the metric"
|
|
275
|
+
},
|
|
276
|
+
"expression": {
|
|
277
|
+
"$ref": "#/$defs/Expression"
|
|
278
|
+
},
|
|
279
|
+
"description": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"description": "Human-readable description of what the metric measures"
|
|
282
|
+
},
|
|
283
|
+
"ai_context": {
|
|
284
|
+
"$ref": "#/$defs/AIContext"
|
|
285
|
+
},
|
|
286
|
+
"custom_extensions": {
|
|
287
|
+
"type": "array",
|
|
288
|
+
"items": {
|
|
289
|
+
"$ref": "#/$defs/CustomExtension"
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
"required": ["name", "expression"],
|
|
294
|
+
"additionalProperties": false
|
|
295
|
+
},
|
|
296
|
+
"SemanticModel": {
|
|
297
|
+
"type": "object",
|
|
298
|
+
"description": "Top-level container representing a complete semantic model",
|
|
299
|
+
"properties": {
|
|
300
|
+
"name": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"description": "Unique identifier for the semantic model"
|
|
303
|
+
},
|
|
304
|
+
"description": {
|
|
305
|
+
"type": "string",
|
|
306
|
+
"description": "Human-readable description"
|
|
307
|
+
},
|
|
308
|
+
"ai_context": {
|
|
309
|
+
"$ref": "#/$defs/AIContext"
|
|
310
|
+
},
|
|
311
|
+
"datasets": {
|
|
312
|
+
"type": "array",
|
|
313
|
+
"items": {
|
|
314
|
+
"$ref": "#/$defs/Dataset"
|
|
315
|
+
},
|
|
316
|
+
"minItems": 1,
|
|
317
|
+
"description": "Collection of logical datasets"
|
|
318
|
+
},
|
|
319
|
+
"relationships": {
|
|
320
|
+
"type": "array",
|
|
321
|
+
"items": {
|
|
322
|
+
"$ref": "#/$defs/Relationship"
|
|
323
|
+
},
|
|
324
|
+
"description": "Defines how datasets are connected"
|
|
325
|
+
},
|
|
326
|
+
"metrics": {
|
|
327
|
+
"type": "array",
|
|
328
|
+
"items": {
|
|
329
|
+
"$ref": "#/$defs/Metric"
|
|
330
|
+
},
|
|
331
|
+
"description": "Quantifiable measures spanning datasets"
|
|
332
|
+
},
|
|
333
|
+
"custom_extensions": {
|
|
334
|
+
"type": "array",
|
|
335
|
+
"items": {
|
|
336
|
+
"$ref": "#/$defs/CustomExtension"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"required": ["name", "datasets"],
|
|
341
|
+
"additionalProperties": false
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|