|
| 1 | +--- |
| 2 | +title: Schema |
| 3 | +--- |
| 4 | + |
| 5 | +# OXA Schema |
| 6 | + |
| 7 | +The OXA schema defines the structure and types for representing scientific documents as JSON objects. All OXA documents conform to JSON Schema Draft-07, enabling validation and interoperability. |
| 8 | + |
| 9 | +## Schema Overview |
| 10 | + |
| 11 | +Every OXA node follows a common structure: |
| 12 | + |
| 13 | +```yaml |
| 14 | +type: NodeType # Required: The node type identifier |
| 15 | +id: optional-string # Optional: Unique identifier for referencing |
| 16 | +classes: [] # Optional: Styling or semantic classes |
| 17 | +data: {} # Optional: Arbitrary metadata |
| 18 | +children: [] # Optional: Nested content nodes |
| 19 | +``` |
| 20 | +
|
| 21 | +### Common Properties |
| 22 | +
|
| 23 | +| Property | Type | Description | |
| 24 | +| ---------- | ---------------------- | --------------------------------------------------------- | |
| 25 | +| `type` | `string` (Capitalized) | The node type, e.g. `"Paragraph"`, `"Text"`, `"Heading"`. | |
| 26 | +| `id` | `string` | Unique identifier for referencing and linking nodes. | |
| 27 | +| `classes` | `array[string]` | Optional styling or semantic classes. | |
| 28 | +| `data` | `object` | Arbitrary metadata (e.g. attributes, provenance, DOI). | |
| 29 | +| `children` | `array` | Nested content nodes — block or inline types. | |
| 30 | + |
| 31 | +## Node Types |
| 32 | + |
| 33 | +OXA defines several categories of node types: |
| 34 | + |
| 35 | +### Document Node |
| 36 | + |
| 37 | +The root node of every OXA document: |
| 38 | + |
| 39 | +- [Document](#oxa:document) — The root container with metadata, title, and block content |
| 40 | + |
| 41 | +### Block Nodes |
| 42 | + |
| 43 | +Block-level content that forms the document structure: |
| 44 | + |
| 45 | +- [Heading](#oxa:heading) — Section headings with levels (1-6) |
| 46 | +- [Paragraph](#oxa:paragraph) — Text paragraphs |
| 47 | + |
| 48 | +### Inline Nodes |
| 49 | + |
| 50 | +Inline content that appears within block nodes: |
| 51 | + |
| 52 | +- [Text](#oxa:text) — Plain text content |
| 53 | +- [Strong](#oxa:strong) — Strong emphasis (typically bold) |
| 54 | + |
| 55 | +## Accessing the Schema |
| 56 | + |
| 57 | +### Download the Schema |
| 58 | + |
| 59 | +The OXA schema is available as a JSON Schema file: |
| 60 | + |
| 61 | +<https://oxa.dev/v0.1.0/schema.json> |
| 62 | + |
| 63 | +### Schema Versioning |
| 64 | + |
| 65 | +OXA uses semantic versioning for schema releases. The current version is **0.1.0**. When accessing schemas programmatically, always specify the version: |
| 66 | + |
| 67 | +```bash |
| 68 | +# Download specific version |
| 69 | +curl https://oxa.dev/v0.1.0/schema.json > schema.json |
| 70 | +``` |
| 71 | + |
| 72 | +## Design Principles |
| 73 | + |
| 74 | +The OXA schema follows these design principles: |
| 75 | + |
| 76 | +- **Open by design:** JSON Schema–based and CC0-licensed for reuse and extension |
| 77 | +- **Composable:** Each node is self-contained, typed, and can be nested or reused |
| 78 | +- **Interoperable:** Compatible with MyST Markdown, Stencila, Quarto, and similar formats |
| 79 | +- **Extensible:** Add new node types while preserving schema validation |
| 80 | +- **Typed & linked:** Everything has a clear `type`, optional `id`, and structured `data` field |
| 81 | +- **Modular:** Documents and components can link across projects |
| 82 | +- **Computational:** Built-in support for executable and interactive research components |
| 83 | + |
| 84 | +## Related Resources |
| 85 | + |
| 86 | +- [Get Started Guide](./install.md) — Installation and quick start |
| 87 | +- [Schema Reference](./schema/index.md) — Detailed node type documentation |
| 88 | +- [OXA Repository](https://github.com/oxa-dev/oxa) — Source code and examples |
0 commit comments