|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://github.com/moodlehq/wiki-rag/raw/refs/heads/main/wiki_rag/schema.json", |
| 4 | + "title": "Wiki-RAG data files schema", |
| 5 | + "type": "object", |
| 6 | + "required": ["meta", "sites"], |
| 7 | + "unevaluatedProperties": false, |
| 8 | + "properties": { |
| 9 | + "meta": { |
| 10 | + "type": "object", |
| 11 | + "required": ["timestamp", "num_sites"], |
| 12 | + "unevaluatedProperties": false, |
| 13 | + "properties": { |
| 14 | + "timestamp": { "type": "string", "format": "date-time" }, |
| 15 | + "num_sites": { "type": "integer", "minimum": 0 } |
| 16 | + } |
| 17 | + }, |
| 18 | + "sites": { |
| 19 | + "type": "array", |
| 20 | + "items": { "$ref": "#/$defs/site" } |
| 21 | + } |
| 22 | + }, |
| 23 | + |
| 24 | + "$defs": { |
| 25 | + "uuid": { |
| 26 | + "type": "string", |
| 27 | + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" |
| 28 | + }, |
| 29 | + "uuidOrNull": { |
| 30 | + "type": ["string", "null"], |
| 31 | + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" |
| 32 | + }, |
| 33 | + |
| 34 | + "site": { |
| 35 | + "type": "object", |
| 36 | + "required": ["site_url", "num_pages", "pages"], |
| 37 | + "unevaluatedProperties": false, |
| 38 | + "properties": { |
| 39 | + "site_url": { "type": "string", "format": "uri" }, |
| 40 | + "num_pages": { "type": "integer", "minimum": 0 }, |
| 41 | + "pages": { "type": "array", "items": { "$ref": "#/$defs/page" } } |
| 42 | + } |
| 43 | + }, |
| 44 | + |
| 45 | + "page": { |
| 46 | + "type": "object", |
| 47 | + "required": ["id", "title", "sections"], |
| 48 | + "unevaluatedProperties": false, |
| 49 | + "properties": { |
| 50 | + "id": { "type": "integer" }, |
| 51 | + "title": { "type": "string" }, |
| 52 | + "sections": { "type": "array", "items": { "$ref": "#/$defs/section" } }, |
| 53 | + "categories": { "type": "array", "items": { "type": "string" } }, |
| 54 | + "templates": { "type": "array", "items": { "type": "string" } }, |
| 55 | + "internal_links": { "type": "array", "items": { "type": "string" } }, |
| 56 | + "external_links": { "type": "array", "items": { "type": "string" } }, |
| 57 | + "language_links": { "type": "array", "items": { "type": "string" } } |
| 58 | + } |
| 59 | + }, |
| 60 | + |
| 61 | + "section": { |
| 62 | + "type": "object", |
| 63 | + "required": [ |
| 64 | + "id", "anchor", "title", "source", "text", "all_links", "wiki_links", |
| 65 | + "index", "level", "page_id", "doc_id", "doc_title", "doc_hash", |
| 66 | + "parent", "children", "previous", "next", "relations" |
| 67 | + ], |
| 68 | + "unevaluatedProperties": false, |
| 69 | + "properties": { |
| 70 | + "id": { "$ref": "#/$defs/uuid" }, |
| 71 | + "anchor": { "type": "string" }, |
| 72 | + "title": { "type": "string" }, |
| 73 | + "source": { "type": "string", "format": "uri" }, |
| 74 | + "text": { "type": "string" }, |
| 75 | + "all_links": { "type": "array", "items": { "type": "string" } }, |
| 76 | + "wiki_links": { "type": "array", "items": { "type": "string" } }, |
| 77 | + "index": { "type": "integer", "minimum": 0 }, |
| 78 | + "level": { "type": "integer", "minimum": 0 }, |
| 79 | + "page_id": { "type": "integer" }, |
| 80 | + "doc_id": { "$ref": "#/$defs/uuid" }, |
| 81 | + "doc_title": { "type": "string" }, |
| 82 | + "doc_hash": { "$ref": "#/$defs/uuid" }, |
| 83 | + "parent": { "$ref": "#/$defs/uuidOrNull" }, |
| 84 | + "children": { "type": "array", "items": { "$ref": "#/$defs/uuidOrNull" } }, |
| 85 | + "previous": { "type": "array", "items": { "$ref": "#/$defs/uuidOrNull" } }, |
| 86 | + "next": { "type": "array", "items": { "$ref": "#/$defs/uuidOrNull" } }, |
| 87 | + "relations": { "type": "array", "items": { "$ref": "#/$defs/uuidOrNull" } } |
| 88 | + } |
| 89 | + } |
| 90 | + } |
| 91 | +} |
0 commit comments