-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataset-binding.schema.json
More file actions
247 lines (247 loc) · 13 KB
/
Copy pathdataset-binding.schema.json
File metadata and controls
247 lines (247 loc) · 13 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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ver.cy/schemas/mmas/2.1/dataset-binding.schema.json",
"title": "MMAS 2.1 Dataset Binding",
"type": "object",
"additionalProperties": false,
"required": ["id", "dataset", "structure", "representations", "carrier", "access", "traversal"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"dataset": {
"type": "object", "additionalProperties": false, "required": ["id", "mastershipRef"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"description": { "type": "string" },
"mastershipRef": { "type": "string" }
}
},
"structure": { "$ref": "#/$defs/structure" },
"representations": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/representation" } },
"carrier": { "$ref": "#/$defs/carrier" },
"access": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/access" } },
"traversal": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/traversal" } },
"compatibility": {
"type": "array", "items": {
"type": "object", "additionalProperties": false,
"required": ["representationRef", "accessRef", "traversalRef"],
"properties": {
"representationRef": { "$ref": "#/$defs/id" },
"accessRef": { "$ref": "#/$defs/id" },
"traversalRef": { "$ref": "#/$defs/id" }
}
}
},
"package": { "$ref": "#/$defs/package" },
"extensions": { "type": "object", "additionalProperties": true }
},
"$defs": {
"id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$" },
"uri": { "type": "string", "format": "uri" },
"digest": {
"type": "object", "additionalProperties": false, "required": ["algorithm", "value"],
"properties": {
"algorithm": { "enum": ["sha256", "sha384", "sha512", "blake3"] },
"value": { "type": "string", "pattern": "^[A-Fa-f0-9]+$" }
}
},
"structure": {
"type": "object", "additionalProperties": false, "required": ["kind"],
"properties": {
"kind": { "enum": ["record", "table", "tree", "graph", "document", "stream", "binary", "hybrid"] },
"schemaRef": { "$ref": "#/$defs/uri" },
"identityKeys": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
"ordering": { "enum": ["unordered", "declared", "key", "event-time"] },
"partitionKeys": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
"rootType": { "type": "string" }
}
},
"representation": {
"type": "object", "additionalProperties": false,
"required": ["id", "mediaType", "role"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"mediaType": { "type": "string", "pattern": "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+$" },
"profile": { "$ref": "#/$defs/uri" },
"role": { "enum": ["semantic-primary", "alternate", "evidence", "projection-output", "package-manifest"] },
"encoding": { "type": "string", "default": "utf-8" },
"compression": { "enum": ["none", "gzip", "zstd", "zip", "other"] },
"container": { "type": "string" },
"documentModel": { "type": "string" },
"parserRef": { "$ref": "#/$defs/id" },
"extractorRef": { "$ref": "#/$defs/id" },
"canonicalization": { "type": "string" },
"loss": { "type": "array", "items": { "type": "string" } },
"markdown": { "$ref": "#/$defs/markdown" },
"html": { "$ref": "#/$defs/html" }
},
"allOf": [
{ "if": { "properties": { "mediaType": { "const": "text/markdown" } }, "required": ["mediaType"] }, "then": { "required": ["markdown"] } },
{ "if": { "properties": { "mediaType": { "const": "text/html" } }, "required": ["mediaType"] }, "then": { "required": ["html"] } }
]
},
"markdown": {
"type": "object", "additionalProperties": false, "required": ["dialect", "orphanNarrative"],
"properties": {
"dialect": { "enum": ["commonmark", "gfm", "extension"] },
"dialectProfile": { "$ref": "#/$defs/uri" },
"frontMatter": { "type": "array", "uniqueItems": true, "items": { "enum": ["yaml", "toml", "json"] } },
"selectors": { "type": "array", "items": { "$ref": "#/$defs/selector" } },
"allowRawHtml": { "type": "boolean", "default": false },
"orphanNarrative": { "enum": ["semantic", "evidence", "ignore", "error"] },
"linkResolution": { "enum": ["document-base", "binding-base", "absolute-only"] }
}
},
"html": {
"type": "object", "additionalProperties": false, "required": ["documentKind", "scripts", "externalResources"],
"properties": {
"documentKind": { "enum": ["document", "fragment"] },
"selectors": { "type": "array", "items": { "$ref": "#/$defs/selector" } },
"structuredData": { "type": "array", "uniqueItems": true, "items": { "enum": ["microdata", "rdfa", "json-ld"] } },
"scripts": { "enum": ["reject", "strip", "allow-trusted"] },
"externalResources": { "enum": ["reject", "declared-only", "allow-trusted"] },
"allowedTargets": { "type": "array", "uniqueItems": true, "items": { "type": "string", "format": "uri" } },
"baseUri": { "$ref": "#/$defs/uri" }
},
"allOf": [{ "if": { "properties": { "externalResources": { "const": "declared-only" } }, "required": ["externalResources"] }, "then": { "required": ["allowedTargets"] } }]
},
"selector": {
"type": "object", "additionalProperties": false, "required": ["kind", "value"],
"properties": {
"kind": { "enum": ["heading", "block-marker", "fenced-block", "line-range", "css", "xpath", "json-pointer", "fragment", "symbol"] },
"value": { "type": "string", "minLength": 1 },
"multiple": { "type": "boolean", "default": false }
}
},
"snapshot": {
"type": "object", "additionalProperties": false, "required": ["scheme", "value"],
"properties": {
"scheme": { "enum": ["git-commit", "inventory-digest", "db-snapshot", "object-version", "etag", "mcp-revision", "timestamp", "extension"] },
"value": { "type": "string", "minLength": 1 },
"observedAt": { "type": "string", "format": "date-time" }
}
},
"carrier": {
"type": "object", "additionalProperties": false, "required": ["kind", "locator"],
"properties": {
"kind": { "enum": ["package-tree", "filesystem", "git", "relational-db", "document-db", "graph-db", "object-store", "http", "mcp", "extension"] },
"locator": { "$ref": "#/$defs/locator" },
"integrity": { "$ref": "#/$defs/digest" },
"extensionId": { "$ref": "#/$defs/uri" },
"extension": { "type": "object", "additionalProperties": true }
},
"allOf": [
{ "if": { "properties": { "kind": { "const": "extension" } }, "required": ["kind"] }, "then": { "required": ["extensionId", "extension"] } }
]
},
"locator": {
"type": "object", "additionalProperties": false, "required": ["scheme", "value"],
"properties": {
"scheme": { "enum": ["path", "git", "sql", "mongodb", "cypher", "s3", "gs", "azblob", "https", "http", "mcp", "urn", "extension"] },
"value": { "type": "string", "minLength": 1, "maxLength": 4096 },
"subpath": { "type": "string" },
"ref": { "type": "string" },
"resource": { "type": "string" },
"namespace": { "type": "string" },
"addressFragment": {
"type": "object", "additionalProperties": false, "required": ["kind", "value"],
"properties": {
"kind": { "enum": ["path", "object-key", "table", "collection", "graph", "resource", "row-key", "version"] },
"value": { "type": "string", "minLength": 1 }
}
}
}
},
"access": {
"type": "object", "additionalProperties": false, "required": ["id", "protocol", "operations", "operationClass"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"protocol": { "enum": ["local-fs", "git", "https", "sql", "mongodb", "cypher", "s3", "mcp", "extension"] },
"operations": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["list", "read", "query", "subscribe", "write", "propose-change"] } },
"operationClass": { "enum": ["read", "write", "side-effect"] },
"credentialRef": { "type": "string" },
"capabilities": { "type": "object", "additionalProperties": true },
"allowedTargets": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
"rateLimit": { "type": "string" }
}
},
"traversal": {
"type": "object", "additionalProperties": false,
"required": ["id", "algorithm", "snapshot", "order", "coverage"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"algorithm": { "enum": ["package-tree-walk", "filesystem-walk", "git-tree-walk", "sql-query", "document-query", "graph-query", "object-list", "http-pagination", "mcp-resource-list", "mcp-tool", "extension"] },
"roots": { "type": "array", "items": { "type": "string" } },
"include": { "type": "array", "items": { "type": "string" } },
"exclude": { "type": "array", "items": { "type": "string" } },
"ignoreFiles": { "type": "array", "items": { "type": "string" } },
"hidden": { "enum": ["include", "exclude", "declared-only"], "default": "exclude" },
"maxDepth": { "type": "integer", "minimum": 0 },
"caseSensitive": { "type": "boolean", "default": true },
"symlinks": { "enum": ["error", "record-as-link", "follow"], "default": "error" },
"submodules": { "enum": ["exclude", "record", "recurse"], "default": "exclude" },
"gitLfs": { "enum": ["pointer", "resolve", "error"], "default": "pointer" },
"snapshot": { "$ref": "#/$defs/snapshot" },
"order": { "type": "array", "minItems": 1, "items": { "type": "string" } },
"query": { "type": "string" },
"parameters": { "type": "object", "additionalProperties": true },
"pagination": { "$ref": "#/$defs/pagination" },
"mcp": { "$ref": "#/$defs/mcp" },
"parserRules": { "type": "array", "items": { "$ref": "#/$defs/parserRule" } },
"coverage": {
"type": "object", "additionalProperties": false, "required": ["mode", "proofRequired"],
"properties": {
"mode": { "enum": ["semantic-units", "bytes", "declared-scope"] },
"proofRequired": { "type": "boolean" }
}
}
},
"allOf": [
{ "if": { "properties": { "algorithm": { "enum": ["sql-query", "document-query", "graph-query"] } }, "required": ["algorithm"] }, "then": { "required": ["query", "pagination", "snapshot"] } },
{ "if": { "properties": { "algorithm": { "enum": ["object-list", "http-pagination"] } }, "required": ["algorithm"] }, "then": { "required": ["pagination", "snapshot"] } },
{ "if": { "properties": { "algorithm": { "enum": ["package-tree-walk", "filesystem-walk", "git-tree-walk"] } }, "required": ["algorithm"] }, "then": { "required": ["hidden", "symlinks", "snapshot"] } },
{ "if": { "properties": { "algorithm": { "enum": ["mcp-resource-list", "mcp-tool"] } }, "required": ["algorithm"] }, "then": { "required": ["mcp"] } }
]
},
"pagination": {
"type": "object", "additionalProperties": false, "required": ["strategy"],
"properties": {
"strategy": { "enum": ["none", "cursor", "keyset", "offset", "link-header", "continuation-token"] },
"pageSize": { "type": "integer", "minimum": 1, "maximum": 100000 },
"cursorField": { "type": "string" },
"stableKeys": { "type": "array", "items": { "type": "string" } }
},
"allOf": [{ "if": { "properties": { "strategy": { "not": { "const": "none" } } }, "required": ["strategy"] }, "then": { "required": ["pageSize"] } }]
},
"mcp": {
"type": "object", "additionalProperties": false, "required": ["mode"],
"properties": {
"mode": { "enum": ["resource", "tool"] },
"resourceUriTemplate": { "type": "string" },
"toolName": { "type": "string" },
"arguments": { "type": "object", "additionalProperties": true },
"cursorField": { "type": "string" }
}
},
"parserRule": {
"type": "object", "additionalProperties": false, "required": ["parserRef"],
"properties": {
"mediaType": { "type": "string" },
"profile": { "$ref": "#/$defs/uri" },
"pathPattern": { "type": "string" },
"parserRef": { "$ref": "#/$defs/id" },
"extractorRef": { "$ref": "#/$defs/id" }
}
},
"package": {
"type": "object", "additionalProperties": false,
"required": ["mode", "packageFingerprintPolicy"],
"properties": {
"mode": { "enum": ["embed", "reference", "hybrid"] },
"packageFingerprintPolicy": { "type": "string" },
"semanticFingerprintRef": { "type": "string" },
"coverageProofRef": { "type": "string" },
"signatureRef": { "type": "string" }
}
}
}
}