oatschema 0.0.0-stage → 0.0.1

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ This package uses its own semantic version. `SCHEMA_VERSION` gives the default OATS schema version of each release.
4
+
5
+ ## 0.0.1 (2026-10-18)
6
+
7
+ First release. Schema access only; validation is planned for 0.1.0.
8
+
9
+ - Bundles OATS schema version 0.8.0, the first public OATS release, copied unchanged from the `oatschema/oats` release tag. Its 12 schemas are `audio-transcription`, `classification`, `document-extraction`, `embedding`, `entity-extraction`, `generic`, `geolocation`, `llm-output`, `object-detection`, `ranking`, `regression` and `temporal-segmentation`. `SCHEMA_VERSION` is 0.8.0.
10
+ - `getSchema`, `getSchemaJson`, `availableVersions`, `SCHEMA_VERSION`, `SCHEMA_NAMES` and `SchemaName`.
11
+ - `UnknownSchemaError` and `SchemaLookupError`.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,102 @@
1
- # Temporary Holding Version
1
+ # oatschema
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/oatschema.svg)](https://www.npmjs.com/package/oatschema)
4
+ [![CI](https://github.com/oatschema/oatschema-js/actions/workflows/ci.yml/badge.svg)](https://github.com/oatschema/oatschema-js/actions/workflows/ci.yml)
5
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/oatschema/oatschema-js/blob/main/LICENSE)
6
+
7
+ The [OATS](https://oatschema.org) (Open Annotation Task Schemas) JSON schemas for JavaScript and TypeScript.
8
+
9
+ OATS is a collection of strict, versioned JSON Schema 2020-12 schemas, defining and validating the structured outputs of machine learning models, workflow steps and annotation. Models, pipelines and people write the same JSON for each task, so a classification, a transcription or a set of detected objects has one shape, whatever produced it. This package bundles the schemas so you can validate those records anywhere. (OATS is unrelated to the W3C Web Annotation data model, formerly Open Annotation.)
10
+
11
+ - **No dependencies, no I/O.** The schemas are embedded in the module, so the package works the same in Node.js 22+, browsers, Deno, Bun and any bundler.
12
+ - **Exactly as released.** Each schema is byte-identical to its [oatschema/oats](https://github.com/oatschema/oats) release.
13
+ - **Typed.** ESM with TypeScript types. Schema names are a union type, so typos fail at compile time.
14
+
15
+ ## Quick start
16
+
17
+ ```
18
+ npm install oatschema
19
+ ```
20
+
21
+ ```ts
22
+ import { getSchema, SCHEMA_VERSION } from "oatschema";
23
+
24
+ const schema = getSchema("classification"); // a fresh plain object, safe to modify
25
+ schema.$id; // "https://oatschema.org/0.8.0/classification"
26
+ SCHEMA_VERSION; // "0.8.0", used when you don't pass a version
27
+ ```
28
+
29
+ ## Schemas
30
+
31
+ | Name | Holds |
32
+ | :--- | :--- |
33
+ | `audio-transcription` | Transcribed speech, with timed segments, speakers and non-verbal events |
34
+ | `classification` | Predicted labels with scores and an optional vocabulary |
35
+ | `document-extraction` | Document layout and content: text blocks, coordinates and pages |
36
+ | `embedding` | A dense or sparse vector and the model that produced it |
37
+ | `entity-extraction` | Entities linked to their evidence, and relations between them |
38
+ | `generic` | Arbitrary key-value data |
39
+ | `geolocation` | A geographic feature, as a strict subset of GeoJSON |
40
+ | `llm-output` | One prompt and response, with generation parameters and usage |
41
+ | `object-detection` | Boxes, polygons and their hierarchy within a source |
42
+ | `ranking` | Ranked results for a query, such as search or retrieval hits |
43
+ | `regression` | Numeric predictions, intervals and forecasts |
44
+ | `temporal-segmentation` | Labelled time intervals, such as chapters, scenes or speaker turns |
45
+
46
+ Browse every schema, its fields and the changelog at [oatschema.org](https://oatschema.org).
47
+
48
+ ## Validating records
49
+
50
+ `getSchema` returns a plain object for any JSON Schema 2020-12 validator. With [Ajv](https://ajv.js.org):
51
+
52
+ ```ts
53
+ import Ajv2020 from "ajv/dist/2020.js";
54
+ import addFormats from "ajv-formats";
55
+ import { getSchema } from "oatschema";
56
+
57
+ const ajv = new Ajv2020({ allErrors: true, strictTypes: false, strictTuples: false, strictRequired: false });
58
+ ajv.addKeyword({ keyword: "x-license", schemaType: "object" });
59
+ ajv.addKeyword({ keyword: "x-version", schemaType: "string" });
60
+ addFormats(ajv);
61
+
62
+ const validate = ajv.compile(getSchema("classification"));
63
+ validate({ labels: [{ label: "cat", score: 0.92 }] }); // true
64
+ validate({ labels: [{ label: "cat", score: 1.5 }] }); // false: /labels/0/score must be <= 1
65
+ ```
66
+
67
+ - `x-license` and `x-version` are the only non-standard keywords in OATS. Registering them keeps Ajv's strict mode on for everything else.
68
+ - The three relaxed options switch off Ajv's style checks, which reject some valid 2020-12 patterns that OATS uses, such as `required` inside an `if`.
69
+ - Compile each schema once per Ajv instance and reuse the function. Compiling a second copy with the same `$id` throws; fetch the first with `ajv.getSchema(schema.$id)`.
70
+
71
+ ## API
72
+
73
+ | Export | Description |
74
+ | :--- | :--- |
75
+ | `getSchema(name, version?)` | The schema as a new object on every call |
76
+ | `getSchemaJson(name, version?)` | The schema file's text, exactly as released |
77
+ | `availableVersions()` | Every bundled schema version, oldest first |
78
+ | `SCHEMA_VERSION` | The default schema version, the newest bundled |
79
+ | `SCHEMA_NAMES`, `SchemaName` | The schema names, as an array and a union type |
80
+ | `UnknownSchemaError` | Thrown for a name that exists in no bundled version |
81
+ | `SchemaLookupError` | Thrown for a version that isn't bundled, or that lacks the schema |
82
+
83
+ - `version` must be exact: `"0.8.0"`, never `"0.8"` or `"latest"`.
84
+ - Both errors carry the requested `schemaName`, and `SchemaLookupError` also carries `schemaVersion`.
85
+
86
+ ## Versions
87
+
88
+ **Schema versions.** Before OATS 1.0, a new release may reject records an older one accepted, or the reverse, so pass the version a record was written for.
89
+
90
+ - Each `$id` includes its version (`https://oatschema.org/0.8.0/classification`), so several versions can share one Ajv instance.
91
+ - Each schema states its own version in `x-version`.
92
+ - This package bundles OATS 0.8.0, the first public release, and every later one. For 0.4.0 to 0.7.0, use the Python package, [oatschema-py](https://github.com/oatschema/oatschema-py).
93
+
94
+ **Package versions.** The package has its own semantic version, which never encodes a schema version; read `SCHEMA_VERSION` instead. Upgrading never removes a schema version, but it can move the default. Before 1.0, a release that changes the default is a minor bump, so npm's default `^0.x.y` range keeps your default fixed.
95
+
96
+ ## Contributing
97
+
98
+ Schema changes belong in [oatschema/oats](https://github.com/oatschema/oats). For this package, see [CONTRIBUTING.md](https://github.com/oatschema/oatschema-js/blob/main/CONTRIBUTING.md). Commits need a DCO sign-off (`git commit -s`).
99
+
100
+ ## License
101
+
102
+ Apache-2.0. Copyright [The OATS Authors](https://github.com/oatschema/oatschema-js/blob/main/AUTHORS).
@@ -0,0 +1 @@
1
+ export declare const BUNDLED: ReadonlyMap<string, ReadonlyMap<string, string>>;
@@ -0,0 +1,18 @@
1
+ // SPDX-FileCopyrightText: 2026 The OATS Authors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export const BUNDLED = new Map([
4
+ ["0.8.0", new Map([
5
+ ["audio-transcription", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/audio-transcription\",\n \"title\": \"Audio Transcription\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Store text transcribed from an audio source. Supports timed segments, speaker identification, and non-verbal events.\",\n \"type\": \"object\",\n \"properties\": {\n \"track_id\": {\n \"type\": \"string\",\n \"description\": \"(Optional) Identifier for the specific audio track or channel in the source media. Numeric identifiers are written as strings (e.g., '0').\",\n \"maxLength\": 128\n },\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of this transcription (e.g., 'Whisper-v3', 'Manual Review').\",\n \"maxLength\": 1024\n },\n \"language\": {\n \"type\": \"string\",\n \"description\": \"The 3-letter ISO-639-3 language code of the transcription (e.g., 'eng', 'fra').\",\n \"pattern\": \"^[a-z]{3}$\",\n \"maxLength\": 3\n },\n \"duration\": {\n \"type\": \"number\",\n \"description\": \"The total duration of the source media in seconds.\",\n \"minimum\": 0\n },\n \"score_explanation\": {\n \"type\": \"string\",\n \"description\": \"Defines the meaning of the 'score' field.\",\n \"maxLength\": 256\n },\n \"text\": {\n \"type\": \"string\",\n \"description\": \"The full, concatenated transcribed text. Optional if detailed segments are provided.\",\n \"maxLength\": 524288\n },\n \"segments\": {\n \"type\": \"array\",\n \"description\": \"An array of timed text segments. Can be used for phrases, sentences, or individual words.\",\n \"maxItems\": 100000,\n \"minItems\": 1,\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"text\": {\n \"type\": \"string\",\n \"description\": \"The text for this segment.\",\n \"maxLength\": 4096\n },\n \"start_time\": {\n \"type\": \"number\",\n \"description\": \"Segment start time in seconds.\",\n \"minimum\": 0\n },\n \"end_time\": {\n \"type\": \"number\",\n \"description\": \"Segment end time in seconds. Must not be earlier than start_time.\",\n \"minimum\": 0\n },\n \"language\": {\n \"type\": \"string\",\n \"description\": \"The 3-letter ISO-639-3 language code of this particular segment (e.g., 'eng', 'fra').\",\n \"pattern\": \"^[a-z]{3}$\",\n \"maxLength\": 3\n },\n \"speaker\": {\n \"type\": \"object\",\n \"description\": \"The speaker of this segment.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"Identifier for the speaker. Numeric identifiers, such as diarization cluster numbers, are written as strings (e.g., '0').\",\n \"maxLength\": 128\n },\n \"name\": {\n \"type\": \"string\",\n \"maxLength\": 128,\n \"description\": \"Name of the speaker.\"\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"Confidence that this segment belongs to this speaker (0 to 1).\",\n \"minimum\": 0,\n \"maximum\": 1\n }\n },\n \"required\": [\n \"id\"\n ],\n \"additionalProperties\": false\n },\n \"events\": {\n \"type\": \"array\",\n \"description\": \"Array of strings describing non-verbal sounds or events within the segment (e.g., '[music]', '(laughter)').\",\n \"items\": {\n \"type\": \"string\",\n \"maxLength\": 128\n },\n \"maxItems\": 64\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"The confidence score for this segment's transcription, ranging from 0.0 (uncertain) to 1.0 (certain).\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this segment.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"text\",\n \"start_time\",\n \"end_time\"\n ],\n \"additionalProperties\": false\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this transcription.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"anyOf\": [\n {\n \"required\": [\n \"text\"\n ]\n },\n {\n \"required\": [\n \"segments\"\n ]\n }\n ],\n \"additionalProperties\": false\n}"],
6
+ ["classification", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/classification\",\n \"title\": \"Classification\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Represent the result of a classification. Supports predicted labels, confidence scores, and vocabulary.\",\n \"type\": \"object\",\n \"properties\": {\n \"target\": {\n \"type\": \"string\",\n \"description\": \"The name of or a reference to the variable being classified (e.g., 'sentiment', 'topic').\",\n \"maxLength\": 256\n },\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of this classification.\",\n \"maxLength\": 1024\n },\n \"score_explanation\": {\n \"type\": \"string\",\n \"description\": \"A brief explanation of what the score represents (e.g., 'Model confidence probability [0, 1]', 'Sentiment score [-1, 1]').\",\n \"maxLength\": 256\n },\n \"vocabulary\": {\n \"type\": \"array\",\n \"description\": \"A list of the possible labels in this classification scheme. For more than 100 labels, use 'vocabulary_url'.\",\n \"maxItems\": 100,\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"string\",\n \"description\": \"A single valid label from the vocabulary.\",\n \"maxLength\": 128\n }\n },\n \"vocabulary_url\": {\n \"type\": \"string\",\n \"description\": \"A URL pointing to a more detailed external vocabulary or ontology.\",\n \"format\": \"uri\",\n \"maxLength\": 2048\n },\n \"labels\": {\n \"type\": \"array\",\n \"description\": \"The labels assigned. Can be empty if no labels match.\",\n \"maxItems\": 10000,\n \"minItems\": 0,\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The predicted label. Must be a member of 'vocabulary' when it is present.\",\n \"maxLength\": 128\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"A normalized score for this label (-1.0 to 1.0). Depending on the use case, this may represent a probability (0 to 1) or a bipolar metric like sentiment (-1 to 1).\",\n \"minimum\": -1,\n \"maximum\": 1\n },\n \"timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"maxLength\": 128,\n \"description\": \"The specific time this label applies to. Used for discrete time-series or state logging.\"\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Additional metadata about this specific label.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"label\"\n ],\n \"additionalProperties\": false\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this classification.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"labels\"\n ],\n \"additionalProperties\": false\n}"],
7
+ ["document-extraction", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/document-extraction\",\n \"title\": \"Document Extraction\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Represent the layout and content of a document, including text blocks, geometric coordinates, and page structure.\",\n \"type\": \"object\",\n \"properties\": {\n \"extraction_type\": {\n \"type\": \"string\",\n \"description\": \"Optionally indicate the extraction type.\",\n \"enum\": [\n \"text\",\n \"lines\",\n \"boxes\",\n \"polygons\",\n \"mixed\"\n ]\n },\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of this extraction.\",\n \"maxLength\": 1024\n },\n \"unit\": {\n \"type\": \"string\",\n \"description\": \"The unit for all coordinate values: 'px' for pixels, 'pt' for typographic points, 'normalized' for values from 0.0 to 1.0, and 'per_mille' for values from 0 to 1000. Required whenever geometric data is present.\",\n \"enum\": [\n \"px\",\n \"pt\",\n \"normalized\",\n \"per_mille\"\n ]\n },\n \"page_width\": {\n \"description\": \"The width of the page(s), in the record's unit if 'px' or 'pt', otherwise in any unit shared with page_height. Can be a single number for uniform documents, or an array of objects mapping specific widths to page numbers.\",\n \"oneOf\": [\n {\n \"type\": \"number\",\n \"title\": \"Uniform Width\",\n \"exclusiveMinimum\": 0\n },\n {\n \"type\": \"array\",\n \"title\": \"Variable Widths\",\n \"minItems\": 1,\n \"maxItems\": 10000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A width shared by one or more pages.\",\n \"properties\": {\n \"value\": {\n \"type\": \"number\",\n \"description\": \"The width of these pages.\",\n \"exclusiveMinimum\": 0\n },\n \"pages\": {\n \"type\": \"array\",\n \"description\": \"The page numbers (1-indexed) that share this width.\",\n \"minItems\": 1,\n \"maxItems\": 100000,\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"integer\",\n \"minimum\": 1\n }\n }\n },\n \"required\": [\n \"value\",\n \"pages\"\n ],\n \"additionalProperties\": false\n }\n }\n ]\n },\n \"page_height\": {\n \"description\": \"The height of the page(s), in the record's unit if 'px' or 'pt', otherwise in any unit shared with page_width. Can be a single number for uniform documents, or an array of objects mapping specific heights to page numbers.\",\n \"oneOf\": [\n {\n \"type\": \"number\",\n \"title\": \"Uniform Height\",\n \"exclusiveMinimum\": 0\n },\n {\n \"type\": \"array\",\n \"title\": \"Variable Heights\",\n \"minItems\": 1,\n \"maxItems\": 10000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A height shared by one or more pages.\",\n \"properties\": {\n \"value\": {\n \"type\": \"number\",\n \"description\": \"The height of these pages.\",\n \"exclusiveMinimum\": 0\n },\n \"pages\": {\n \"type\": \"array\",\n \"description\": \"The page numbers (1-indexed) that share this height.\",\n \"minItems\": 1,\n \"maxItems\": 100000,\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"integer\",\n \"minimum\": 1\n }\n }\n },\n \"required\": [\n \"value\",\n \"pages\"\n ],\n \"additionalProperties\": false\n }\n }\n ]\n },\n \"score_explanation\": {\n \"type\": \"string\",\n \"description\": \"Defines the meaning of the 'score' field.\",\n \"maxLength\": 256\n },\n \"blocks\": {\n \"type\": \"array\",\n \"description\": \"An array of text blocks extracted from the document.\",\n \"maxItems\": 100000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single extracted block of text or geometry.\",\n \"properties\": {\n \"block_type\": {\n \"type\": \"string\",\n \"description\": \"Defines the nature of this specific block (text, line, box, polygon, or multi_polygon).\",\n \"enum\": [\n \"text\",\n \"line\",\n \"box\",\n \"polygon\",\n \"multi_polygon\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"A unique identifier (e.g., UUID4) for this block, useful for referencing.\",\n \"maxLength\": 128\n },\n \"text\": {\n \"type\": \"string\",\n \"description\": \"The text content of the block. Required for text and line block types.\",\n \"maxLength\": 4096\n },\n \"line_number\": {\n \"type\": \"integer\",\n \"description\": \"The line number of the block within its page, if applicable.\",\n \"minimum\": 1\n },\n \"page_number\": {\n \"type\": \"integer\",\n \"description\": \"The page number (1-indexed) where this block is located.\",\n \"minimum\": 1\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"The confidence score for this block's detection and transcription, ranging from 0.0 (uncertain) to 1.0 (certain).\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"box\": {\n \"type\": \"object\",\n \"description\": \"A rectangular bounding box defined by its top-left corner (x, y) and its dimensions.\",\n \"properties\": {\n \"x\": {\n \"type\": \"number\",\n \"description\": \"The x-coordinate of the top-left corner.\",\n \"minimum\": 0\n },\n \"y\": {\n \"type\": \"number\",\n \"description\": \"The y-coordinate of the top-left corner.\",\n \"minimum\": 0\n },\n \"width\": {\n \"type\": \"number\",\n \"description\": \"The width of the box.\",\n \"minimum\": 0\n },\n \"height\": {\n \"type\": \"number\",\n \"description\": \"The height of the box.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"x\",\n \"y\",\n \"width\",\n \"height\"\n ],\n \"additionalProperties\": false\n },\n \"polygon\": {\n \"type\": \"array\",\n \"description\": \"An ordered list of vertices defining a non-rectangular boundary.\",\n \"minItems\": 3,\n \"maxItems\": 1000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single vertex, measured from the top-left corner of the page or image.\",\n \"properties\": {\n \"x\": {\n \"type\": \"number\",\n \"description\": \"The x-coordinate of the vertex.\",\n \"minimum\": 0\n },\n \"y\": {\n \"type\": \"number\",\n \"description\": \"The y-coordinate of the vertex.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"x\",\n \"y\"\n ],\n \"additionalProperties\": false\n }\n },\n \"multi_polygon\": {\n \"type\": \"array\",\n \"description\": \"A list of polygons, for a single region that is occluded or fragmented into multiple visible parts.\",\n \"minItems\": 1,\n \"maxItems\": 100,\n \"items\": {\n \"type\": \"array\",\n \"description\": \"An ordered list of vertices defining a non-rectangular boundary.\",\n \"minItems\": 3,\n \"maxItems\": 1000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single vertex, measured from the top-left corner of the page or image.\",\n \"properties\": {\n \"x\": {\n \"type\": \"number\",\n \"description\": \"The x-coordinate of the vertex.\",\n \"minimum\": 0\n },\n \"y\": {\n \"type\": \"number\",\n \"description\": \"The y-coordinate of the vertex.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"x\",\n \"y\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this block.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"block_type\"\n ],\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"block_type\": {\n \"enum\": [\n \"text\",\n \"line\"\n ]\n }\n }\n },\n \"then\": {\n \"required\": [\n \"text\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"block_type\": {\n \"const\": \"box\"\n }\n }\n },\n \"then\": {\n \"required\": [\n \"box\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"block_type\": {\n \"const\": \"polygon\"\n }\n }\n },\n \"then\": {\n \"required\": [\n \"polygon\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"block_type\": {\n \"const\": \"multi_polygon\"\n }\n }\n },\n \"then\": {\n \"required\": [\n \"multi_polygon\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"block_type\": {\n \"const\": \"line\"\n }\n }\n },\n \"then\": {\n \"anyOf\": [\n {\n \"required\": [\n \"box\"\n ]\n },\n {\n \"required\": [\n \"polygon\"\n ]\n },\n {\n \"required\": [\n \"multi_polygon\"\n ]\n }\n ]\n }\n }\n ],\n \"additionalProperties\": false\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this extraction.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"blocks\"\n ],\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"blocks\": {\n \"contains\": {\n \"anyOf\": [\n {\n \"required\": [\n \"box\"\n ]\n },\n {\n \"required\": [\n \"polygon\"\n ]\n },\n {\n \"required\": [\n \"multi_polygon\"\n ]\n }\n ]\n }\n }\n },\n \"required\": [\n \"blocks\"\n ]\n },\n \"then\": {\n \"required\": [\n \"unit\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"unit\": {\n \"const\": \"normalized\"\n }\n },\n \"required\": [\n \"unit\"\n ]\n },\n \"then\": {\n \"properties\": {\n \"blocks\": {\n \"items\": {\n \"properties\": {\n \"box\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1\n },\n \"y\": {\n \"maximum\": 1\n },\n \"width\": {\n \"maximum\": 1\n },\n \"height\": {\n \"maximum\": 1\n }\n }\n },\n \"polygon\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1\n },\n \"y\": {\n \"maximum\": 1\n }\n }\n }\n },\n \"multi_polygon\": {\n \"items\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1\n },\n \"y\": {\n \"maximum\": 1\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"unit\": {\n \"const\": \"per_mille\"\n }\n },\n \"required\": [\n \"unit\"\n ]\n },\n \"then\": {\n \"properties\": {\n \"blocks\": {\n \"items\": {\n \"properties\": {\n \"box\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1000\n },\n \"y\": {\n \"maximum\": 1000\n },\n \"width\": {\n \"maximum\": 1000\n },\n \"height\": {\n \"maximum\": 1000\n }\n }\n },\n \"polygon\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1000\n },\n \"y\": {\n \"maximum\": 1000\n }\n }\n }\n },\n \"multi_polygon\": {\n \"items\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1000\n },\n \"y\": {\n \"maximum\": 1000\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n ],\n \"additionalProperties\": false\n}"],
8
+ ["embedding", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/embedding\",\n \"title\": \"Embedding\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Store a vector and (optionally) the algorithm or embedding model which generated it. Supports both array (dense) and object (sparse) representations.\",\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"string\",\n \"description\": \"The model, tool or algorithm used to create this embedding.\",\n \"maxLength\": 1024\n },\n \"target\": {\n \"type\": \"string\",\n \"description\": \"The name of or a reference to the variable, feature, or file being embedded.\",\n \"maxLength\": 256\n },\n \"vector\": {\n \"description\": \"The embedding vector data.\",\n \"oneOf\": [\n {\n \"title\": \"Array Representation\",\n \"type\": \"array\",\n \"description\": \"A flat list of numbers (typically used for dense vectors).\",\n \"items\": {\n \"type\": \"number\"\n },\n \"minItems\": 1,\n \"maxItems\": 16384\n },\n {\n \"title\": \"Object Representation\",\n \"type\": \"object\",\n \"description\": \"A coordinate list of indices and values (typically used for sparse vectors). 'indices' and 'values' must be the same length, and every index must be less than 'dimensions'.\",\n \"properties\": {\n \"dimensions\": {\n \"type\": \"integer\",\n \"description\": \"The total size of the vector space (e.g. the vocabulary size).\",\n \"minimum\": 1\n },\n \"indices\": {\n \"type\": \"array\",\n \"description\": \"The positions of the non-zero elements.\",\n \"items\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"minItems\": 1,\n \"maxItems\": 100000,\n \"uniqueItems\": true\n },\n \"values\": {\n \"type\": \"array\",\n \"description\": \"The values corresponding to the indices.\",\n \"items\": {\n \"type\": \"number\"\n },\n \"minItems\": 1,\n \"maxItems\": 100000\n }\n },\n \"required\": [\n \"dimensions\",\n \"indices\",\n \"values\"\n ],\n \"additionalProperties\": false\n }\n ]\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this embedding.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"vector\"\n ],\n \"additionalProperties\": false\n}"],
9
+ ["entity-extraction", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/entity-extraction\",\n \"title\": \"Entity Extraction\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Represent named entities, structural slots, or visual concepts extracted from unstructured data. Links raw evidence (character-offset text spans, document blocks, or geometric regions) to normalized values and business concepts, and can record directed relations between entities.\",\n \"type\": \"object\",\n \"properties\": {\n \"unit\": {\n \"type\": \"string\",\n \"description\": \"The unit for all coordinate values: 'px' for pixels, 'pt' for typographic points, 'normalized' for values from 0.0 to 1.0, and 'per_mille' for values from 0 to 1000. Required whenever geometric data is present.\",\n \"enum\": [\n \"px\",\n \"pt\",\n \"normalized\",\n \"per_mille\"\n ]\n },\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of this extraction.\",\n \"maxLength\": 1024\n },\n \"vocabulary_url\": {\n \"type\": \"string\",\n \"format\": \"uri\",\n \"description\": \"URL to the definition of the entity labels.\",\n \"maxLength\": 2048\n },\n \"vocabulary\": {\n \"type\": \"array\",\n \"description\": \"Allowed values for the 'label' field. For more than 100 labels, use 'vocabulary_url'.\",\n \"maxItems\": 100,\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"string\",\n \"description\": \"A single valid label from the vocabulary.\",\n \"maxLength\": 128\n }\n },\n \"score_explanation\": {\n \"type\": \"string\",\n \"description\": \"Defines the meaning of the 'score' field.\",\n \"maxLength\": 256\n },\n \"entities\": {\n \"type\": \"array\",\n \"description\": \"An array of extracted entities.\",\n \"maxItems\": 100000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single extracted entity.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"A unique identifier for this entity instance (e.g. UUID). Required when 'relations' is not empty.\",\n \"maxLength\": 128\n },\n \"concept\": {\n \"type\": \"string\",\n \"description\": \"The business role or slot this entity fills (e.g. 'InvoiceDate', 'Plaintiff'). Optional.\",\n \"maxLength\": 128\n },\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The entity category (e.g. 'PER', 'DATE', 'MONEY'). Must be a member of 'vocabulary' when it is present.\",\n \"maxLength\": 128\n },\n \"text\": {\n \"type\": \"string\",\n \"description\": \"The raw text span as it appears in the source. Optional for visual entities (e.g. logos, signatures).\",\n \"maxLength\": 4096\n },\n \"value\": {\n \"description\": \"The machine-readable value (e.g. '2025-11-21', 3500.00, true).\",\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"definition\": {\n \"type\": \"string\",\n \"description\": \"Definition of the concept.\",\n \"maxLength\": 1024\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"The confidence score for this extraction, ranging from 0.0 (uncertain) to 1.0 (certain).\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"location\": {\n \"type\": \"array\",\n \"description\": \"The physical location(s) of the entity.\",\n \"maxItems\": 10,\n \"items\": {\n \"oneOf\": [\n {\n \"title\": \"Block Reference\",\n \"type\": \"object\",\n \"description\": \"A reference to a block in an associated document extraction.\",\n \"properties\": {\n \"type\": {\n \"const\": \"block_ref\"\n },\n \"block_id\": {\n \"type\": \"string\",\n \"description\": \"The id of the referenced block.\",\n \"maxLength\": 128\n }\n },\n \"required\": [\n \"type\",\n \"block_id\"\n ],\n \"additionalProperties\": false\n },\n {\n \"title\": \"Geometric Location\",\n \"type\": \"object\",\n \"description\": \"A region on a page or image.\",\n \"properties\": {\n \"type\": {\n \"const\": \"block\"\n },\n \"block_type\": {\n \"type\": \"string\",\n \"description\": \"The kind of geometry describing this region.\",\n \"enum\": [\n \"box\",\n \"polygon\",\n \"multi_polygon\"\n ]\n },\n \"page_number\": {\n \"type\": \"integer\",\n \"description\": \"The page number (1-indexed) of the region.\",\n \"minimum\": 1\n },\n \"box\": {\n \"type\": \"object\",\n \"description\": \"A rectangular bounding box defined by its top-left corner (x, y) and its dimensions.\",\n \"properties\": {\n \"x\": {\n \"type\": \"number\",\n \"description\": \"The x-coordinate of the top-left corner.\",\n \"minimum\": 0\n },\n \"y\": {\n \"type\": \"number\",\n \"description\": \"The y-coordinate of the top-left corner.\",\n \"minimum\": 0\n },\n \"width\": {\n \"type\": \"number\",\n \"description\": \"The width of the box.\",\n \"minimum\": 0\n },\n \"height\": {\n \"type\": \"number\",\n \"description\": \"The height of the box.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"x\",\n \"y\",\n \"width\",\n \"height\"\n ],\n \"additionalProperties\": false\n },\n \"polygon\": {\n \"type\": \"array\",\n \"description\": \"An ordered list of vertices defining a non-rectangular boundary.\",\n \"minItems\": 3,\n \"maxItems\": 1000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single vertex, measured from the top-left corner of the page or image.\",\n \"properties\": {\n \"x\": {\n \"type\": \"number\",\n \"description\": \"The x-coordinate of the vertex.\",\n \"minimum\": 0\n },\n \"y\": {\n \"type\": \"number\",\n \"description\": \"The y-coordinate of the vertex.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"x\",\n \"y\"\n ],\n \"additionalProperties\": false\n }\n },\n \"multi_polygon\": {\n \"type\": \"array\",\n \"description\": \"A list of polygons, for a single region that is occluded or fragmented into multiple visible parts.\",\n \"minItems\": 1,\n \"maxItems\": 100,\n \"items\": {\n \"type\": \"array\",\n \"description\": \"An ordered list of vertices defining a non-rectangular boundary.\",\n \"minItems\": 3,\n \"maxItems\": 1000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single vertex, measured from the top-left corner of the page or image.\",\n \"properties\": {\n \"x\": {\n \"type\": \"number\",\n \"description\": \"The x-coordinate of the vertex.\",\n \"minimum\": 0\n },\n \"y\": {\n \"type\": \"number\",\n \"description\": \"The y-coordinate of the vertex.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"x\",\n \"y\"\n ],\n \"additionalProperties\": false\n }\n }\n }\n },\n \"required\": [\n \"type\",\n \"block_type\",\n \"page_number\"\n ],\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"block_type\": {\n \"const\": \"box\"\n }\n }\n },\n \"then\": {\n \"required\": [\n \"box\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"block_type\": {\n \"const\": \"polygon\"\n }\n }\n },\n \"then\": {\n \"required\": [\n \"polygon\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"block_type\": {\n \"const\": \"multi_polygon\"\n }\n }\n },\n \"then\": {\n \"required\": [\n \"multi_polygon\"\n ]\n }\n }\n ],\n \"additionalProperties\": false\n },\n {\n \"title\": \"Text Span\",\n \"type\": \"object\",\n \"description\": \"A span of characters in the source text, or in the text of a referenced block.\",\n \"properties\": {\n \"type\": {\n \"const\": \"span\"\n },\n \"start\": {\n \"type\": \"integer\",\n \"description\": \"The 0-indexed character offset where the span starts (inclusive).\",\n \"minimum\": 0\n },\n \"end\": {\n \"type\": \"integer\",\n \"description\": \"The 0-indexed character offset where the span ends (exclusive). Must not be less than start.\",\n \"minimum\": 0\n },\n \"block_id\": {\n \"type\": \"string\",\n \"description\": \"(Optional) The id of the block whose text the offsets refer to. If omitted, offsets refer to the full source text.\",\n \"maxLength\": 128\n }\n },\n \"required\": [\n \"type\",\n \"start\",\n \"end\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata (e.g. currency, gender). Flat key-value pairs.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"label\"\n ],\n \"additionalProperties\": false\n }\n },\n \"relation_vocabulary_url\": {\n \"type\": \"string\",\n \"format\": \"uri\",\n \"description\": \"URL to the definition of the relation labels.\",\n \"maxLength\": 2048\n },\n \"relation_vocabulary\": {\n \"type\": \"array\",\n \"description\": \"Allowed values for a relation's 'label'. For more than 100 labels, use 'relation_vocabulary_url'.\",\n \"maxItems\": 100,\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"string\",\n \"description\": \"A single valid relation label.\",\n \"maxLength\": 128\n }\n },\n \"relations\": {\n \"type\": \"array\",\n \"description\": \"Directed links between entities in this record. When not empty, every entity requires an 'id'.\",\n \"maxItems\": 100000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single relation, read as 'subject label object' (e.g. 'e2 quantity_of e1').\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"An identifier for this relation.\",\n \"maxLength\": 128\n },\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The kind of relation (e.g. 'price_of', 'employed_by'). Must be a member of 'relation_vocabulary' when it is present.\",\n \"maxLength\": 128\n },\n \"subject_id\": {\n \"type\": \"string\",\n \"description\": \"The id of the entity the relation starts from. Must be the id of an entity in this record.\",\n \"maxLength\": 128\n },\n \"object_id\": {\n \"type\": \"string\",\n \"description\": \"The id of the entity the relation points to. Must be the id of an entity in this record.\",\n \"maxLength\": 128\n },\n \"text\": {\n \"type\": \"string\",\n \"description\": \"The text that states the relation, if any.\",\n \"maxLength\": 4096\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"The confidence in this relation, from 0.0 (uncertain) to 1.0 (certain).\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata for this relation. Flat key-value pairs.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"label\",\n \"subject_id\",\n \"object_id\"\n ],\n \"additionalProperties\": false\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this extraction.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"entities\"\n ],\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"relations\": {\n \"minItems\": 1\n }\n },\n \"required\": [\n \"relations\"\n ]\n },\n \"then\": {\n \"properties\": {\n \"entities\": {\n \"items\": {\n \"required\": [\n \"id\"\n ]\n }\n }\n }\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"entities\": {\n \"contains\": {\n \"properties\": {\n \"location\": {\n \"contains\": {\n \"properties\": {\n \"type\": {\n \"const\": \"block\"\n }\n },\n \"required\": [\n \"type\"\n ]\n }\n }\n },\n \"required\": [\n \"location\"\n ]\n }\n }\n },\n \"required\": [\n \"entities\"\n ]\n },\n \"then\": {\n \"required\": [\n \"unit\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"unit\": {\n \"const\": \"normalized\"\n }\n },\n \"required\": [\n \"unit\"\n ]\n },\n \"then\": {\n \"properties\": {\n \"entities\": {\n \"items\": {\n \"properties\": {\n \"location\": {\n \"items\": {\n \"properties\": {\n \"box\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1\n },\n \"y\": {\n \"maximum\": 1\n },\n \"width\": {\n \"maximum\": 1\n },\n \"height\": {\n \"maximum\": 1\n }\n }\n },\n \"polygon\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1\n },\n \"y\": {\n \"maximum\": 1\n }\n }\n }\n },\n \"multi_polygon\": {\n \"items\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1\n },\n \"y\": {\n \"maximum\": 1\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"unit\": {\n \"const\": \"per_mille\"\n }\n },\n \"required\": [\n \"unit\"\n ]\n },\n \"then\": {\n \"properties\": {\n \"entities\": {\n \"items\": {\n \"properties\": {\n \"location\": {\n \"items\": {\n \"properties\": {\n \"box\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1000\n },\n \"y\": {\n \"maximum\": 1000\n },\n \"width\": {\n \"maximum\": 1000\n },\n \"height\": {\n \"maximum\": 1000\n }\n }\n },\n \"polygon\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1000\n },\n \"y\": {\n \"maximum\": 1000\n }\n }\n }\n },\n \"multi_polygon\": {\n \"items\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1000\n },\n \"y\": {\n \"maximum\": 1000\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n ],\n \"additionalProperties\": false\n}"],
10
+ ["generic", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/generic\",\n \"title\": \"Generic\",\n \"x-version\": \"0.8.0\",\n \"description\": \"A flexible schema for storing arbitrary key-value data.\",\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\",\n \"description\": \"Describe the data.\",\n \"maxLength\": 1024\n },\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of this record.\",\n \"maxLength\": 1024\n },\n \"data\": {\n \"type\": \"object\",\n \"description\": \"An object containing custom key-value data. Nesting is disallowed.\",\n \"maxProperties\": 128,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"data\"\n ],\n \"additionalProperties\": false\n}"],
11
+ ["geolocation", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/geolocation\",\n \"title\": \"Geolocation\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Represent a geographic feature. Defines a subset of GeoJSON (RFC 7946) optimized for predictable parsing and indexing. It restricts the root to a single 'Feature', supports all fixed-depth geometries (Point, Polygon, Multi-types), and enforces flat properties to prevent recursion and nesting attacks.\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"description\": \"The GeoJSON object type.\",\n \"const\": \"Feature\"\n },\n \"id\": {\n \"description\": \"A unique identifier for the feature.\",\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 128\n },\n {\n \"type\": \"number\"\n }\n ]\n },\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of this record.\",\n \"maxLength\": 1024\n },\n \"bbox\": {\n \"$ref\": \"#/$defs/bbox\"\n },\n \"geometry\": {\n \"description\": \"The geometry of the feature. Uses the WGS 84 coordinate reference system.\",\n \"anyOf\": [\n {\n \"type\": \"null\"\n },\n {\n \"title\": \"Point\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"const\": \"Point\"\n },\n \"coordinates\": {\n \"$ref\": \"#/$defs/position\"\n },\n \"bbox\": {\n \"$ref\": \"#/$defs/bbox\"\n }\n },\n \"required\": [\n \"type\",\n \"coordinates\"\n ],\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/foreign-member\"\n }\n },\n {\n \"title\": \"LineString\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"const\": \"LineString\"\n },\n \"coordinates\": {\n \"$ref\": \"#/$defs/line-string-coords\"\n },\n \"bbox\": {\n \"$ref\": \"#/$defs/bbox\"\n }\n },\n \"required\": [\n \"type\",\n \"coordinates\"\n ],\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/foreign-member\"\n }\n },\n {\n \"title\": \"Polygon\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"const\": \"Polygon\"\n },\n \"coordinates\": {\n \"$ref\": \"#/$defs/polygon-coords\"\n },\n \"bbox\": {\n \"$ref\": \"#/$defs/bbox\"\n }\n },\n \"required\": [\n \"type\",\n \"coordinates\"\n ],\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/foreign-member\"\n }\n },\n {\n \"title\": \"MultiPoint\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"const\": \"MultiPoint\"\n },\n \"coordinates\": {\n \"type\": \"array\",\n \"description\": \"A list of positions.\",\n \"items\": {\n \"$ref\": \"#/$defs/position\"\n },\n \"maxItems\": 10000\n },\n \"bbox\": {\n \"$ref\": \"#/$defs/bbox\"\n }\n },\n \"required\": [\n \"type\",\n \"coordinates\"\n ],\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/foreign-member\"\n }\n },\n {\n \"title\": \"MultiLineString\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"const\": \"MultiLineString\"\n },\n \"coordinates\": {\n \"type\": \"array\",\n \"description\": \"A list of line strings.\",\n \"items\": {\n \"$ref\": \"#/$defs/line-string-coords\"\n },\n \"maxItems\": 1000\n },\n \"bbox\": {\n \"$ref\": \"#/$defs/bbox\"\n }\n },\n \"required\": [\n \"type\",\n \"coordinates\"\n ],\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/foreign-member\"\n }\n },\n {\n \"title\": \"MultiPolygon\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"const\": \"MultiPolygon\"\n },\n \"coordinates\": {\n \"type\": \"array\",\n \"description\": \"A list of polygons.\",\n \"items\": {\n \"$ref\": \"#/$defs/polygon-coords\"\n },\n \"maxItems\": 1000\n },\n \"bbox\": {\n \"$ref\": \"#/$defs/bbox\"\n }\n },\n \"required\": [\n \"type\",\n \"coordinates\"\n ],\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/foreign-member\"\n }\n }\n ]\n },\n \"properties\": {\n \"description\": \"An object containing additional properties of the feature. Can be null.\",\n \"anyOf\": [\n {\n \"type\": \"null\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"timestamp\": {\n \"type\": \"string\",\n \"description\": \"The time the feature was observed.\",\n \"format\": \"date-time\",\n \"maxLength\": 128\n },\n \"camera_make\": {\n \"type\": \"string\",\n \"description\": \"The make of the camera that captured the source media.\",\n \"maxLength\": 128\n },\n \"camera_model\": {\n \"type\": \"string\",\n \"description\": \"The model of the camera that captured the source media.\",\n \"maxLength\": 128\n }\n },\n \"maxProperties\": 100,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/foreign-member\"\n }\n }\n ]\n }\n },\n \"required\": [\n \"type\",\n \"geometry\",\n \"properties\"\n ],\n \"maxProperties\": 32,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"$defs\": {\n \"position\": {\n \"type\": \"array\",\n \"description\": \"A single position: [longitude, latitude] or [longitude, latitude, altitude].\",\n \"prefixItems\": [\n {\n \"type\": \"number\",\n \"description\": \"Longitude in decimal degrees.\",\n \"minimum\": -180,\n \"maximum\": 180\n },\n {\n \"type\": \"number\",\n \"description\": \"Latitude in decimal degrees.\",\n \"minimum\": -90,\n \"maximum\": 90\n },\n {\n \"type\": \"number\",\n \"description\": \"Altitude in meters above the WGS 84 ellipsoid.\"\n }\n ],\n \"items\": false,\n \"minItems\": 2,\n \"maxItems\": 3\n },\n \"line-string-coords\": {\n \"type\": \"array\",\n \"description\": \"An ordered list of two or more positions.\",\n \"items\": {\n \"$ref\": \"#/$defs/position\"\n },\n \"minItems\": 2,\n \"maxItems\": 10000\n },\n \"linear-ring\": {\n \"type\": \"array\",\n \"description\": \"A closed ring of four or more positions. The first and last positions must be identical.\",\n \"items\": {\n \"$ref\": \"#/$defs/position\"\n },\n \"minItems\": 4,\n \"maxItems\": 10000\n },\n \"polygon-coords\": {\n \"type\": \"array\",\n \"description\": \"A list of linear rings. The first is the exterior ring; any others are holes.\",\n \"items\": {\n \"$ref\": \"#/$defs/linear-ring\"\n },\n \"minItems\": 1,\n \"maxItems\": 100\n },\n \"bbox\": {\n \"type\": \"array\",\n \"description\": \"A bounding box (RFC 7946, Section 5): 4 values for 2D or 6 values for 3D.\",\n \"items\": {\n \"type\": \"number\"\n },\n \"anyOf\": [\n {\n \"minItems\": 4,\n \"maxItems\": 4\n },\n {\n \"minItems\": 6,\n \"maxItems\": 6\n }\n ],\n \"minItems\": 4,\n \"maxItems\": 6\n },\n \"foreign-member\": {\n \"description\": \"Constrained definition of RFC 7946 Foreign Members.\",\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 2048\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n },\n {\n \"type\": \"array\",\n \"maxItems\": 100,\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n }\n ]\n }\n },\n {\n \"type\": \"object\",\n \"maxProperties\": 20,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 2048\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n ]\n }\n },\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/foreign-member\"\n }\n}"],
12
+ ["llm-output", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/llm-output\",\n \"title\": \"LLM Output\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Store a single interaction with an LLM (a Prompt/Response pair). Captures the input prompt, the resulting output, and the configuration parameters used at that moment.\",\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"string\",\n \"description\": \"The ID or name of the model used (e.g., 'gpt-4o', 'claude-3-sonnet').\",\n \"maxLength\": 1024\n },\n \"prompt\": {\n \"type\": \"string\",\n \"description\": \"The text input provided to the model. For contexts exceeding the character limit, this field should be truncated or a reference to the full storage location.\",\n \"maxLength\": 262144\n },\n \"response_data\": {\n \"description\": \"The output from the model. Non-plaintext output (e.g. JSON) should be serialized. For contexts exceeding the character limit, this field should be truncated or a reference to the full storage location.\",\n \"type\": \"string\",\n \"maxLength\": 524288\n },\n \"language\": {\n \"type\": \"string\",\n \"description\": \"The 3-letter ISO-639-3 language code of the response (e.g., 'eng', 'fra').\",\n \"pattern\": \"^[a-z]{3}$\",\n \"maxLength\": 3\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"A normalized metric evaluating the response (-1.0 to 1.0). Positive values indicate high quality, acceptance, or positive sentiment. Negative values indicate rejection, low quality, or negative sentiment.\",\n \"minimum\": -1,\n \"maximum\": 1\n },\n \"score_explanation\": {\n \"type\": \"string\",\n \"description\": \"Defines the meaning and range of the 'score' field (e.g. 'Reward Model Score' or 'Confidence').\",\n \"maxLength\": 256\n },\n \"generation_params\": {\n \"type\": \"object\",\n \"description\": \"Optional parameters sent in the API request to control the generation.\",\n \"properties\": {\n \"system_prompt\": {\n \"type\": \"string\",\n \"description\": \"An optional system-level instruction that defines the model's persona, style, or constraints. For contexts exceeding the character limit, this field should be truncated or a reference to the full storage location.\",\n \"maxLength\": 262144\n },\n \"temperature\": {\n \"type\": \"number\",\n \"description\": \"Controls randomness (e.g., 0.0 to 2.0).\",\n \"minimum\": 0,\n \"maximum\": 2\n },\n \"top_p\": {\n \"type\": \"number\",\n \"description\": \"Controls nucleus sampling (e.g., 0.0 to 1.0).\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"top_k\": {\n \"type\": \"integer\",\n \"description\": \"Limits sampling to the k most likely tokens.\",\n \"minimum\": 1\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"description\": \"The maximum number of tokens that were allowed to be generated.\",\n \"minimum\": 1\n },\n \"seed\": {\n \"type\": \"integer\",\n \"description\": \"The seed used for sampling for reproducible outputs.\"\n },\n \"stop\": {\n \"description\": \"One or more sequences where the API will stop generating further tokens.\",\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 128\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"maxLength\": 128\n },\n \"maxItems\": 16\n }\n ]\n },\n \"presence_penalty\": {\n \"type\": \"number\",\n \"description\": \"Penalty for new tokens based on whether they appear in the text so far (e.g., -2.0 to 2.0).\",\n \"minimum\": -2,\n \"maximum\": 2\n },\n \"frequency_penalty\": {\n \"type\": \"number\",\n \"description\": \"Penalty for new tokens based on their existing frequency in the text so far (e.g., -2.0 to 2.0).\",\n \"minimum\": -2,\n \"maximum\": 2\n },\n \"response_format\": {\n \"type\": \"object\",\n \"description\": \"Specifies the output format (e.g., 'text', 'json_object' or 'json_schema').\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"description\": \"The type of output format.\",\n \"enum\": [\n \"text\",\n \"json_object\",\n \"json_schema\"\n ]\n }\n },\n \"required\": [\n \"type\"\n ],\n \"additionalProperties\": false\n }\n },\n \"additionalProperties\": false\n },\n \"generation_metadata\": {\n \"type\": \"object\",\n \"description\": \"Optional metadata returned by the API response, used for provenance and logging.\",\n \"properties\": {\n \"response_id\": {\n \"type\": \"string\",\n \"description\": \"The unique identifier for the generation response from the API provider.\",\n \"maxLength\": 128\n },\n \"created\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"maxLength\": 128,\n \"description\": \"The ISO-8601 timestamp of when the response was created.\"\n },\n \"finish_reason\": {\n \"type\": \"string\",\n \"description\": \"The reason the model stopped generating tokens (e.g., 'stop', 'length', 'tool_calls').\",\n \"maxLength\": 128\n },\n \"system_fingerprint\": {\n \"type\": \"string\",\n \"description\": \"An identifier for the backend configuration that served the request, for reproducibility.\",\n \"maxLength\": 128\n },\n \"usage\": {\n \"type\": \"object\",\n \"description\": \"Token usage statistics for the generation request.\",\n \"properties\": {\n \"prompt_tokens\": {\n \"type\": \"integer\",\n \"description\": \"The number of tokens in the input.\",\n \"minimum\": 0\n },\n \"completion_tokens\": {\n \"type\": \"integer\",\n \"description\": \"The number of tokens generated.\",\n \"minimum\": 0\n },\n \"total_tokens\": {\n \"type\": \"integer\",\n \"description\": \"The total number of tokens used.\",\n \"minimum\": 0\n },\n \"cached_prompt_tokens\": {\n \"type\": \"integer\",\n \"description\": \"The number of input tokens served from a prompt cache.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"prompt_tokens\",\n \"completion_tokens\",\n \"total_tokens\"\n ],\n \"additionalProperties\": false\n }\n },\n \"additionalProperties\": false\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this item.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"model\",\n \"response_data\"\n ],\n \"additionalProperties\": false\n}"],
13
+ ["object-detection", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/object-detection\",\n \"title\": \"Object Detection\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Represent objects detected within a source. Supports bounding boxes, polygons, hierarchical relationships, and confidence scores.\",\n \"type\": \"object\",\n \"properties\": {\n \"unit\": {\n \"type\": \"string\",\n \"description\": \"The unit for all coordinate values: 'px' for pixels, 'pt' for typographic points, 'normalized' for values from 0.0 to 1.0, and 'per_mille' for values from 0 to 1000. Required whenever geometric data is present.\",\n \"enum\": [\n \"px\",\n \"pt\",\n \"normalized\",\n \"per_mille\"\n ]\n },\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of this record.\",\n \"maxLength\": 1024\n },\n \"vocabulary_url\": {\n \"type\": \"string\",\n \"description\": \"A URL pointing to a more detailed external vocabulary or ontology.\",\n \"format\": \"uri\",\n \"maxLength\": 2048\n },\n \"vocabulary\": {\n \"type\": \"array\",\n \"description\": \"A list of the possible labels for detected objects. For more than 100 labels, use 'vocabulary_url'.\",\n \"maxItems\": 100,\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"string\",\n \"description\": \"A single valid label from the vocabulary.\",\n \"maxLength\": 128\n }\n },\n \"score_explanation\": {\n \"type\": \"string\",\n \"description\": \"Defines the meaning and range of the 'score' field.\",\n \"maxLength\": 256\n },\n \"objects\": {\n \"type\": \"array\",\n \"description\": \"The detected objects.\",\n \"maxItems\": 100000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single detected object.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"A unique identifier for this object within this record (e.g., UUID4). Required for establishing hierarchies.\",\n \"maxLength\": 128\n },\n \"parent_id\": {\n \"type\": \"string\",\n \"description\": \"The id of the parent object, if this object is nested within another.\",\n \"maxLength\": 128\n },\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The label of the detected object (e.g., 'car', 'face', 'logo'). Must be a member of 'vocabulary' when it is present.\",\n \"maxLength\": 128\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"A normalized score for this detection (-1.0 to 1.0). Positive values [0, 1] represent confidence in the object's presence. Negative values [-1, 0) are reserved for 'hard negatives' (e.g., explicitly marking that an object is not present in this region).\",\n \"minimum\": -1,\n \"maximum\": 1\n },\n \"box\": {\n \"type\": \"object\",\n \"description\": \"A rectangular bounding box defined by its top-left corner (x, y) and its dimensions.\",\n \"properties\": {\n \"x\": {\n \"type\": \"number\",\n \"description\": \"The x-coordinate of the top-left corner.\",\n \"minimum\": 0\n },\n \"y\": {\n \"type\": \"number\",\n \"description\": \"The y-coordinate of the top-left corner.\",\n \"minimum\": 0\n },\n \"width\": {\n \"type\": \"number\",\n \"description\": \"The width of the box.\",\n \"minimum\": 0\n },\n \"height\": {\n \"type\": \"number\",\n \"description\": \"The height of the box.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"x\",\n \"y\",\n \"width\",\n \"height\"\n ],\n \"additionalProperties\": false\n },\n \"polygon\": {\n \"type\": \"array\",\n \"description\": \"An ordered list of vertices defining a non-rectangular boundary.\",\n \"minItems\": 3,\n \"maxItems\": 1000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single vertex, measured from the top-left corner of the page or image.\",\n \"properties\": {\n \"x\": {\n \"type\": \"number\",\n \"description\": \"The x-coordinate of the vertex.\",\n \"minimum\": 0\n },\n \"y\": {\n \"type\": \"number\",\n \"description\": \"The y-coordinate of the vertex.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"x\",\n \"y\"\n ],\n \"additionalProperties\": false\n }\n },\n \"multi_polygon\": {\n \"type\": \"array\",\n \"description\": \"A list of polygons, for a single region that is occluded or fragmented into multiple visible parts.\",\n \"minItems\": 1,\n \"maxItems\": 100,\n \"items\": {\n \"type\": \"array\",\n \"description\": \"An ordered list of vertices defining a non-rectangular boundary.\",\n \"minItems\": 3,\n \"maxItems\": 1000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single vertex, measured from the top-left corner of the page or image.\",\n \"properties\": {\n \"x\": {\n \"type\": \"number\",\n \"description\": \"The x-coordinate of the vertex.\",\n \"minimum\": 0\n },\n \"y\": {\n \"type\": \"number\",\n \"description\": \"The y-coordinate of the vertex.\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"x\",\n \"y\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this item.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"label\"\n ],\n \"oneOf\": [\n {\n \"required\": [\n \"box\"\n ]\n },\n {\n \"required\": [\n \"polygon\"\n ]\n },\n {\n \"required\": [\n \"multi_polygon\"\n ]\n }\n ],\n \"additionalProperties\": false\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this record.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"unit\",\n \"objects\"\n ],\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"unit\": {\n \"const\": \"normalized\"\n }\n },\n \"required\": [\n \"unit\"\n ]\n },\n \"then\": {\n \"properties\": {\n \"objects\": {\n \"items\": {\n \"properties\": {\n \"box\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1\n },\n \"y\": {\n \"maximum\": 1\n },\n \"width\": {\n \"maximum\": 1\n },\n \"height\": {\n \"maximum\": 1\n }\n }\n },\n \"polygon\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1\n },\n \"y\": {\n \"maximum\": 1\n }\n }\n }\n },\n \"multi_polygon\": {\n \"items\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1\n },\n \"y\": {\n \"maximum\": 1\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"unit\": {\n \"const\": \"per_mille\"\n }\n },\n \"required\": [\n \"unit\"\n ]\n },\n \"then\": {\n \"properties\": {\n \"objects\": {\n \"items\": {\n \"properties\": {\n \"box\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1000\n },\n \"y\": {\n \"maximum\": 1000\n },\n \"width\": {\n \"maximum\": 1000\n },\n \"height\": {\n \"maximum\": 1000\n }\n }\n },\n \"polygon\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1000\n },\n \"y\": {\n \"maximum\": 1000\n }\n }\n }\n },\n \"multi_polygon\": {\n \"items\": {\n \"items\": {\n \"properties\": {\n \"x\": {\n \"maximum\": 1000\n },\n \"y\": {\n \"maximum\": 1000\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n ],\n \"additionalProperties\": false\n}"],
14
+ ["ranking", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/ranking\",\n \"title\": \"Ranking\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Represent a ranked list of items related to a query, such as search results, retrieved passages, recommendations or near-duplicate matches.\",\n \"type\": \"object\",\n \"properties\": {\n \"target\": {\n \"type\": \"string\",\n \"description\": \"What the ranking measures (e.g., 'relevance', 'near-duplicate', 'recording-match').\",\n \"maxLength\": 256\n },\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of this ranking.\",\n \"maxLength\": 1024\n },\n \"query\": {\n \"type\": \"string\",\n \"description\": \"The text of the query, if there was one. Omitted when there was no text query (e.g. near-duplicates of a given image, or recommendations for a user).\",\n \"maxLength\": 4096\n },\n \"collection\": {\n \"type\": \"string\",\n \"description\": \"The name of the set the ranked items were drawn from, such as a search index, document collection or product catalogue (e.g., 'lease-agreements').\",\n \"maxLength\": 1024\n },\n \"score_explanation\": {\n \"type\": \"string\",\n \"description\": \"Defines the meaning of the 'score' field.\",\n \"maxLength\": 256\n },\n \"total_candidates\": {\n \"type\": \"integer\",\n \"description\": \"The number of candidates considered before the list was cut down to 'results'. Must not be less than the number of results, or than any result's rank.\",\n \"minimum\": 0\n },\n \"results\": {\n \"type\": \"array\",\n \"description\": \"The ranked items. Can be empty if nothing matched.\",\n \"maxItems\": 10000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single ranked item.\",\n \"properties\": {\n \"rank\": {\n \"type\": \"integer\",\n \"description\": \"The position of this item in the full ranking, where 1 is the best match. Tied items share a rank, and gaps are allowed (e.g. after a tie, or when results are filtered or paginated). The order of the items is given by 'rank', not by their order in the array.\",\n \"minimum\": 1\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"An identifier for the item, such as a document id within 'collection' or a URI that resolves to it. Must be unique within 'results'.\",\n \"maxLength\": 2048\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"A human-readable name for the item.\",\n \"maxLength\": 1024\n },\n \"text\": {\n \"type\": \"string\",\n \"description\": \"An excerpt of the item's text, such as a search snippet or a retrieved passage. May be truncated; 'id' identifies the full item.\",\n \"maxLength\": 4096\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"A normalized score for this item (-1.0 to 1.0). Higher values indicate greater relevance or similarity. Depending on the use case, this may represent a probability of relevance (0 to 1) or a signed similarity such as cosine similarity (-1 to 1). Use score_explanation to clarify.\",\n \"minimum\": -1,\n \"maximum\": 1\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata for this item (e.g. a native score or distance, or the matched offset within a recording). Flat key-value pairs.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"rank\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this ranking.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"results\"\n ],\n \"additionalProperties\": false\n}"],
15
+ ["regression", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/regression\",\n \"title\": \"Regression\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Represent continuous numerical predictions. Supports point estimates, confidence intervals, and time-series forecasting.\",\n \"type\": \"object\",\n \"properties\": {\n \"target\": {\n \"type\": \"string\",\n \"description\": \"The name of or a reference to the variable being predicted (e.g., 'temperature', 'stock_price').\",\n \"maxLength\": 256\n },\n \"unit\": {\n \"type\": \"string\",\n \"description\": \"The unit of measurement.\",\n \"maxLength\": 128\n },\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of this regression.\",\n \"maxLength\": 1024\n },\n \"score_explanation\": {\n \"type\": \"string\",\n \"description\": \"Explanation of the score metric and its semantics (e.g. 'R-squared' or 'Model Confidence').\",\n \"maxLength\": 256\n },\n \"points\": {\n \"type\": \"array\",\n \"description\": \"The regression data points. A single item represents a point estimate; multiple items represent a time series or distribution.\",\n \"minItems\": 1,\n \"maxItems\": 10000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single predicted value.\",\n \"properties\": {\n \"value\": {\n \"description\": \"The predicted or sampled value. Null represents a missing value, such as a gap in a time series.\",\n \"anyOf\": [\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"statistic\": {\n \"type\": \"string\",\n \"description\": \"The statistical nature of this value.\",\n \"enum\": [\n \"mean\",\n \"median\",\n \"mode\",\n \"min\",\n \"max\",\n \"quantile\",\n \"sample\"\n ]\n },\n \"quantile_level\": {\n \"type\": \"number\",\n \"description\": \"The quantile level (e.g., 0.95). Required when statistic is 'quantile', and only allowed then.\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"maxLength\": 128,\n \"description\": \"The specific time this prediction applies to.\"\n },\n \"interval_lower\": {\n \"type\": \"number\",\n \"description\": \"The lower bound of the confidence interval.\"\n },\n \"interval_upper\": {\n \"type\": \"number\",\n \"description\": \"The upper bound of the confidence interval. Must not be less than interval_lower.\"\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"A normalized score for this point (-1.0 to 1.0). Depending on the metric, this may be a probability (0 to 1) or a bipolar metric such as R-squared clipped to [-1, 1]. Use score_explanation to clarify.\",\n \"minimum\": -1,\n \"maximum\": 1\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this point.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"value\"\n ],\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"statistic\": {\n \"const\": \"quantile\"\n }\n },\n \"required\": [\n \"statistic\"\n ]\n },\n \"then\": {\n \"required\": [\n \"quantile_level\"\n ]\n }\n },\n {\n \"if\": {\n \"required\": [\n \"quantile_level\"\n ]\n },\n \"then\": {\n \"properties\": {\n \"statistic\": {\n \"const\": \"quantile\"\n }\n },\n \"required\": [\n \"statistic\"\n ]\n }\n }\n ],\n \"additionalProperties\": false\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this regression.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"points\"\n ],\n \"additionalProperties\": false\n}"],
16
+ ["temporal-segmentation", "{\n \"x-license\": {\n \"id\": \"Apache-2.0\",\n \"notice\": \"Copyright 2025-2026 The OATS Authors\",\n \"url\": \"https://github.com/oatschema/oats/blob/main/LICENSE\"\n },\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://oatschema.org/0.8.0/temporal-segmentation\",\n \"title\": \"Temporal Segmentation\",\n \"x-version\": \"0.8.0\",\n \"description\": \"Represent labelled time intervals within a media source, such as chapters, scenes, shots, speaker turns or detected events. Segments may overlap, may nest, and need not cover the whole source.\",\n \"type\": \"object\",\n \"properties\": {\n \"producer\": {\n \"type\": \"string\",\n \"description\": \"The creator (model, tool or author) of these segments (e.g., 'PySceneDetect', 'pyannote', 'Manual Review').\",\n \"maxLength\": 1024\n },\n \"track_id\": {\n \"type\": \"string\",\n \"description\": \"(Optional) Identifier for the specific audio or video track in the source media. Numeric identifiers are written as strings (e.g., '0').\",\n \"maxLength\": 128\n },\n \"duration\": {\n \"type\": \"number\",\n \"description\": \"The total duration of the source media in seconds. When present, no segment's end_time may exceed it.\",\n \"minimum\": 0\n },\n \"vocabulary\": {\n \"type\": \"array\",\n \"description\": \"A list of the possible segment labels. For more than 100 labels, use 'vocabulary_url'.\",\n \"maxItems\": 100,\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"string\",\n \"description\": \"A single valid label from the vocabulary.\",\n \"maxLength\": 128\n }\n },\n \"vocabulary_url\": {\n \"type\": \"string\",\n \"description\": \"A URL pointing to a more detailed external vocabulary or ontology.\",\n \"format\": \"uri\",\n \"maxLength\": 2048\n },\n \"score_explanation\": {\n \"type\": \"string\",\n \"description\": \"Defines the meaning of the 'score' field.\",\n \"maxLength\": 256\n },\n \"segments\": {\n \"type\": \"array\",\n \"description\": \"The labelled time intervals. Can be empty if no segments were found.\",\n \"maxItems\": 100000,\n \"items\": {\n \"type\": \"object\",\n \"description\": \"A single labelled time interval.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"An identifier for this segment (e.g., 'scene-12'). Must be unique within the record.\",\n \"maxLength\": 128\n },\n \"parent_id\": {\n \"type\": \"string\",\n \"description\": \"The id of the segment that contains this one (e.g., the chapter containing a scene). Must be the id of another segment in the record, and this segment must lie within its parent's interval.\",\n \"maxLength\": 128\n },\n \"group_id\": {\n \"type\": \"string\",\n \"description\": \"An identifier for the entity this segment belongs to. Segments sharing a group_id belong to the same entity (e.g., all turns of speaker 'SPEAKER_00'). Numeric identifiers, such as diarization cluster numbers, are written as strings (e.g., '0').\",\n \"maxLength\": 128\n },\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The category of the segment (e.g., 'chapter', 'scene', 'speaker', 'explosion'). Must be a member of 'vocabulary' when it is present.\",\n \"maxLength\": 128\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"A human-readable name for this segment (e.g., a chapter title).\",\n \"maxLength\": 128\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"A description of what happens in this segment.\",\n \"maxLength\": 1024\n },\n \"start_time\": {\n \"type\": \"number\",\n \"description\": \"Segment start time in seconds from the start of the source.\",\n \"minimum\": 0\n },\n \"end_time\": {\n \"type\": \"number\",\n \"description\": \"Segment end time in seconds from the start of the source. Must not be earlier than start_time; equal times mark an instantaneous event.\",\n \"minimum\": 0\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"The confidence that the label applies to this interval, ranging from 0.0 (uncertain) to 1.0 (certain).\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this segment.\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"label\",\n \"start_time\",\n \"end_time\"\n ],\n \"additionalProperties\": false\n }\n },\n \"attributes\": {\n \"type\": \"object\",\n \"description\": \"Arbitrary metadata relevant to this record (e.g., annotator, source, job ID).\",\n \"maxProperties\": 16,\n \"propertyNames\": {\n \"maxLength\": 128\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"maxLength\": 1024\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n }\n },\n \"required\": [\n \"segments\"\n ],\n \"additionalProperties\": false\n}"],
17
+ ])],
18
+ ]);
@@ -0,0 +1,73 @@
1
+ /** The names of the schemas in {@link SCHEMA_VERSION}. Older bundled versions contain a subset of them. */
2
+ export declare const SCHEMA_NAMES: readonly [
3
+ "audio-transcription",
4
+ "classification",
5
+ "document-extraction",
6
+ "embedding",
7
+ "entity-extraction",
8
+ "generic",
9
+ "geolocation",
10
+ "llm-output",
11
+ "object-detection",
12
+ "ranking",
13
+ "regression",
14
+ "temporal-segmentation"
15
+ ];
16
+ /** The name of an OATS schema, such as `"classification"`. */
17
+ export type SchemaName = (typeof SCHEMA_NAMES)[number];
18
+ /**
19
+ * The newest bundled OATS schema version, used when no version is given.
20
+ *
21
+ * A schema's own version is in its `x-version` keyword.
22
+ */
23
+ export declare const SCHEMA_VERSION = "0.8.0";
24
+ /** A JSON value, as parsed from a schema file. */
25
+ export type JsonValue = string | number | boolean | null | JsonValue[] | {
26
+ [key: string]: JsonValue;
27
+ };
28
+ /** A parsed JSON Schema document. */
29
+ export type Schema = {
30
+ [key: string]: JsonValue;
31
+ };
32
+ /** Thrown when a schema name exists in no bundled version. */
33
+ export declare class UnknownSchemaError extends Error {
34
+ name: string;
35
+ /** The name that was requested. */
36
+ readonly schemaName: unknown;
37
+ constructor(schemaName: unknown);
38
+ }
39
+ /**
40
+ * Thrown when a schema version is not bundled, or does not contain the requested schema.
41
+ * Versions must be exact, such as `"0.8.0"`; `"0.8"` and `"latest"` are not bundled versions.
42
+ */
43
+ export declare class SchemaLookupError extends Error {
44
+ name: string;
45
+ /** The schema name that was requested. */
46
+ readonly schemaName: string;
47
+ /** The schema version that was requested. */
48
+ readonly schemaVersion: unknown;
49
+ constructor(schemaName: string, schemaVersion: unknown, message: string);
50
+ }
51
+ /** Return every bundled schema version, oldest first. */
52
+ export declare function availableVersions(): string[];
53
+ /**
54
+ * Return the schema `name` from schema version `version`, or from {@link SCHEMA_VERSION} if it is omitted.
55
+ *
56
+ * Each call returns a new object, so callers may modify it freely.
57
+ *
58
+ * @param name The schema name, such as `"classification"`.
59
+ * @param version An exact bundled version such as `"0.8.0"`. Partial versions and aliases are not accepted.
60
+ * @throws {UnknownSchemaError} `name` is not a schema in any bundled version.
61
+ * @throws {SchemaLookupError} `version` is not bundled, or does not contain `name`.
62
+ */
63
+ export declare function getSchema(name: SchemaName, version?: string): Schema;
64
+ /**
65
+ * Return the text of the schema `name` from schema version `version` exactly as released, or from
66
+ * {@link SCHEMA_VERSION} if `version` is omitted.
67
+ *
68
+ * @param name The schema name, such as `"classification"`.
69
+ * @param version An exact bundled version such as `"0.8.0"`. Partial versions and aliases are not accepted.
70
+ * @throws {UnknownSchemaError} `name` is not a schema in any bundled version.
71
+ * @throws {SchemaLookupError} `version` is not bundled, or does not contain `name`.
72
+ */
73
+ export declare function getSchemaJson(name: SchemaName, version?: string): string;
package/dist/index.js ADDED
@@ -0,0 +1,104 @@
1
+ // SPDX-FileCopyrightText: 2026 The OATS Authors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /**
4
+ * The OATS (Open Annotation Task Schemas) JSON schemas, bundled for JavaScript and TypeScript.
5
+ *
6
+ * @module
7
+ */
8
+ import { BUNDLED } from "./bundled.js";
9
+ /** The names of the schemas in {@link SCHEMA_VERSION}. Older bundled versions contain a subset of them. */
10
+ export const SCHEMA_NAMES = Object.freeze([
11
+ "audio-transcription",
12
+ "classification",
13
+ "document-extraction",
14
+ "embedding",
15
+ "entity-extraction",
16
+ "generic",
17
+ "geolocation",
18
+ "llm-output",
19
+ "object-detection",
20
+ "ranking",
21
+ "regression",
22
+ "temporal-segmentation",
23
+ ]);
24
+ /**
25
+ * The newest bundled OATS schema version, used when no version is given.
26
+ *
27
+ * A schema's own version is in its `x-version` keyword.
28
+ */
29
+ export const SCHEMA_VERSION = "0.8.0";
30
+ /** Thrown when a schema name exists in no bundled version. */
31
+ export class UnknownSchemaError extends Error {
32
+ name = "UnknownSchemaError";
33
+ /** The name that was requested. */
34
+ schemaName;
35
+ constructor(schemaName) {
36
+ const known = [...new Set([...BUNDLED.values()].flatMap((names) => [...names.keys()]))].sort();
37
+ super(`unknown schema name ${describe(schemaName)}; expected one of ${known.join(", ")}`);
38
+ this.schemaName = schemaName;
39
+ }
40
+ }
41
+ /**
42
+ * Thrown when a schema version is not bundled, or does not contain the requested schema.
43
+ * Versions must be exact, such as `"0.8.0"`; `"0.8"` and `"latest"` are not bundled versions.
44
+ */
45
+ export class SchemaLookupError extends Error {
46
+ name = "SchemaLookupError";
47
+ /** The schema name that was requested. */
48
+ schemaName;
49
+ /** The schema version that was requested. */
50
+ schemaVersion;
51
+ constructor(schemaName, schemaVersion, message) {
52
+ super(message);
53
+ this.schemaName = schemaName;
54
+ this.schemaVersion = schemaVersion;
55
+ }
56
+ }
57
+ function describe(value) {
58
+ return typeof value === "string" ? JSON.stringify(value) : String(value);
59
+ }
60
+ function lookup(name, version) {
61
+ const names = [...BUNDLED.values()];
62
+ if (typeof name !== "string" || !names.some((schemas) => schemas.has(name))) {
63
+ throw new UnknownSchemaError(name);
64
+ }
65
+ const resolved = version === undefined ? SCHEMA_VERSION : version;
66
+ const schemas = typeof resolved === "string" ? BUNDLED.get(resolved) : undefined;
67
+ if (schemas === undefined) {
68
+ throw new SchemaLookupError(name, resolved, `schema version ${describe(resolved)} is not bundled; available: ${[...BUNDLED.keys()].join(", ")}`);
69
+ }
70
+ const text = schemas.get(name);
71
+ if (text === undefined) {
72
+ throw new SchemaLookupError(name, resolved, `schema ${describe(name)} is not in schema version ${resolved}`);
73
+ }
74
+ return text;
75
+ }
76
+ /** Return every bundled schema version, oldest first. */
77
+ export function availableVersions() {
78
+ return [...BUNDLED.keys()];
79
+ }
80
+ /**
81
+ * Return the schema `name` from schema version `version`, or from {@link SCHEMA_VERSION} if it is omitted.
82
+ *
83
+ * Each call returns a new object, so callers may modify it freely.
84
+ *
85
+ * @param name The schema name, such as `"classification"`.
86
+ * @param version An exact bundled version such as `"0.8.0"`. Partial versions and aliases are not accepted.
87
+ * @throws {UnknownSchemaError} `name` is not a schema in any bundled version.
88
+ * @throws {SchemaLookupError} `version` is not bundled, or does not contain `name`.
89
+ */
90
+ export function getSchema(name, version) {
91
+ return JSON.parse(lookup(name, version));
92
+ }
93
+ /**
94
+ * Return the text of the schema `name` from schema version `version` exactly as released, or from
95
+ * {@link SCHEMA_VERSION} if `version` is omitted.
96
+ *
97
+ * @param name The schema name, such as `"classification"`.
98
+ * @param version An exact bundled version such as `"0.8.0"`. Partial versions and aliases are not accepted.
99
+ * @throws {UnknownSchemaError} `name` is not a schema in any bundled version.
100
+ * @throws {SchemaLookupError} `version` is not bundled, or does not contain `name`.
101
+ */
102
+ export function getSchemaJson(name, version) {
103
+ return lookup(name, version);
104
+ }
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
2
  "name": "oatschema",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.1",
4
+ "description": "OATS (Open Annotation Task Schemas) JSON schemas, bundled for JavaScript and TypeScript.",
5
+ "keywords": [
6
+ "oats",
7
+ "json-schema",
8
+ "annotation",
9
+ "schema",
10
+ "machine-learning"
11
+ ],
12
+ "homepage": "https://oatschema.org",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/oatschema/oatschema-js.git"
16
+ },
17
+ "bugs": "https://github.com/oatschema/oatschema-js/issues",
18
+ "license": "Apache-2.0",
19
+ "author": "OATS maintainers <maintainers@oatschema.org>",
20
+ "maintainers": [
21
+ "OATS maintainers <maintainers@oatschema.org>"
22
+ ],
23
+ "type": "module",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "default": "./dist/index.js"
28
+ },
29
+ "./package.json": "./package.json"
30
+ },
31
+ "types": "./dist/index.d.ts",
32
+ "files": [
33
+ "dist/",
34
+ "CHANGELOG.md"
35
+ ],
36
+ "sideEffects": false,
37
+ "engines": {
38
+ "node": ">=22"
39
+ },
40
+ "scripts": {
41
+ "build": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json",
42
+ "typecheck": "tsc -p tsconfig.build.json --noEmit && tsc --noEmit",
43
+ "lint": "biome check .",
44
+ "format": "biome check --write .",
45
+ "test": "npm run build && node --disable-warning=ExperimentalWarning --test 'test/**/*.test.ts'",
46
+ "check": "npm run lint && npm run typecheck && npm test",
47
+ "sync": "node --disable-warning=ExperimentalWarning scripts/sync-schemas.ts",
48
+ "generate": "node --disable-warning=ExperimentalWarning scripts/generate.ts",
49
+ "prepack": "npm run build"
50
+ },
51
+ "devDependencies": {
52
+ "@biomejs/biome": "2.5.15",
53
+ "@types/node": "^22.20.5",
54
+ "typescript": "^7.0.2"
55
+ }
56
+ }