|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://oo-ld.org/latest/meta/oold-meta-schema-base.json", |
| 4 | + "$dynamicAnchor": "meta", |
| 5 | + "title": "OO-LD dialect meta-schema (body)", |
| 6 | + "$comment": "The dialect body: the standard 2020-12 vocabularies plus the x-oold-* keyword syntax. It carries $dynamicAnchor: \"meta\", so nested subschemas (properties, $defs, x-oold-range, ...) recurse into THIS resource and are validated without the document-level obligations. oold-meta-schema.json wraps it and adds those root-only requirements; see that file.", |
| 7 | + "allOf": [ |
| 8 | + { |
| 9 | + "$ref": "https://json-schema.org/draft/2020-12/schema" |
| 10 | + }, |
| 11 | + { |
| 12 | + "$ref": "https://oo-ld.org/latest/meta/oold-ui-meta-schema.json#keywords" |
| 13 | + } |
| 14 | + ], |
| 15 | + "properties": { |
| 16 | + "@context": { |
| 17 | + "description": "JSON-LD context for instances of this schema. The schema is consumed as a remote JSON-LD context; this entry is ignored by JSON-Schema validators. Only the outer shape is checked here - a context definition is a map, an IRI reference to a remote context, an array combining either, or null (JSON-LD 1.1, Context Definitions). Whether the term definitions inside are well-formed is decided by a JSON-LD processor, not by JSON Schema.", |
| 18 | + "anyOf": [ |
| 19 | + { |
| 20 | + "type": "object" |
| 21 | + }, |
| 22 | + { |
| 23 | + "type": "string", |
| 24 | + "format": "iri-reference" |
| 25 | + }, |
| 26 | + { |
| 27 | + "type": "array", |
| 28 | + "items": { |
| 29 | + "anyOf": [ |
| 30 | + { |
| 31 | + "type": "object" |
| 32 | + }, |
| 33 | + { |
| 34 | + "type": "string", |
| 35 | + "format": "iri-reference" |
| 36 | + }, |
| 37 | + { |
| 38 | + "type": "null" |
| 39 | + } |
| 40 | + ] |
| 41 | + } |
| 42 | + }, |
| 43 | + { |
| 44 | + "type": "null" |
| 45 | + } |
| 46 | + ] |
| 47 | + }, |
| 48 | + "x-oold-context": { |
| 49 | + "description": "Extended term mappings (synonyms): an object keyed by term (a property, class, or value term), each holding a dict keyed by synonym IRI whose value is a JSON-LD term-definition fragment plus an optional strippable x-oold-sssom block. OO-LD tooling reads only two x-oold-sssom slots - predicate_id (a SKOS mapping predicate) and mapping_set_id (for profile-based selection); all other slots ride along and round-trip to SSSOM. Supports override under composition (most-derived-wins; null removes) and namespace/mapping-set selection. Promoted into @context by OO-LD-aware tooling; see the 'Term mappings and synonyms' section.", |
| 50 | + "type": "object", |
| 51 | + "additionalProperties": { |
| 52 | + "type": "object", |
| 53 | + "additionalProperties": { |
| 54 | + "type": [ |
| 55 | + "object", |
| 56 | + "null" |
| 57 | + ], |
| 58 | + "description": "A JSON-LD term-definition fragment (@id, @type, @container, ...), promotable verbatim into @context, plus an optional x-oold-sssom block. null removes an inherited mapping under composition.", |
| 59 | + "properties": { |
| 60 | + "x-oold-sssom": { |
| 61 | + "type": "object", |
| 62 | + "description": "SSSOM mapping metadata (https://w3id.org/sssom/). OO-LD interprets predicate_id and mapping_set_id; all other SSSOM slots are preserved verbatim and round-trip to a SSSOM mapping set.", |
| 63 | + "properties": { |
| 64 | + "predicate_id": { |
| 65 | + "description": "SKOS mapping predicate from the term's primary IRI (subject) to this synonym IRI (object); default skos:exactMatch when absent. Compared by expansion to an absolute IRI. Only exactMatch entries are co-emitted by default.", |
| 66 | + "type": "string", |
| 67 | + "default": "skos:exactMatch", |
| 68 | + "examples": [ |
| 69 | + "skos:exactMatch", |
| 70 | + "skos:closeMatch", |
| 71 | + "skos:broadMatch", |
| 72 | + "skos:narrowMatch", |
| 73 | + "skos:relatedMatch" |
| 74 | + ] |
| 75 | + }, |
| 76 | + "mapping_set_id": { |
| 77 | + "description": "The SSSOM mapping set(s) this entry belongs to, for profile-based selection. SSSOM defines mapping_set_id at set level; OO-LD records it inline per entry and an entry MAY belong to several sets.", |
| 78 | + "oneOf": [ |
| 79 | + { |
| 80 | + "type": "string", |
| 81 | + "format": "iri-reference" |
| 82 | + }, |
| 83 | + { |
| 84 | + "type": "array", |
| 85 | + "items": { |
| 86 | + "type": "string", |
| 87 | + "format": "iri-reference" |
| 88 | + } |
| 89 | + } |
| 90 | + ] |
| 91 | + } |
| 92 | + } |
| 93 | + } |
| 94 | + } |
| 95 | + } |
| 96 | + }, |
| 97 | + "examples": [ |
| 98 | + { |
| 99 | + "name": { |
| 100 | + "skos:prefLabel": { |
| 101 | + "x-oold-sssom": { |
| 102 | + "predicate_id": "skos:exactMatch", |
| 103 | + "confidence": 0.95 |
| 104 | + } |
| 105 | + } |
| 106 | + } |
| 107 | + } |
| 108 | + ] |
| 109 | + }, |
| 110 | + "x-oold-sssom": { |
| 111 | + "description": "Schema-level ontology correspondences: an SSSOM mapping set whose subject is this schema, keyed by the object IRI of a resolvable resource, each value carrying SSSOM slots (predicate_id default skos:exactMatch, mapping_set_id, ...). The schema-level counterpart of the per-term x-oold-sssom used inside x-oold-context; it describes the schema itself, not its instances. See the 'Ontology correspondence' section.", |
| 112 | + "type": "object", |
| 113 | + "additionalProperties": { |
| 114 | + "type": "object", |
| 115 | + "properties": { |
| 116 | + "predicate_id": { |
| 117 | + "type": "string", |
| 118 | + "default": "skos:exactMatch", |
| 119 | + "examples": [ |
| 120 | + "skos:exactMatch", |
| 121 | + "skos:closeMatch" |
| 122 | + ] |
| 123 | + }, |
| 124 | + "mapping_set_id": { |
| 125 | + "oneOf": [ |
| 126 | + { |
| 127 | + "type": "string", |
| 128 | + "format": "iri-reference" |
| 129 | + }, |
| 130 | + { |
| 131 | + "type": "array", |
| 132 | + "items": { |
| 133 | + "type": "string", |
| 134 | + "format": "iri-reference" |
| 135 | + } |
| 136 | + } |
| 137 | + ] |
| 138 | + } |
| 139 | + } |
| 140 | + }, |
| 141 | + "examples": [ |
| 142 | + { |
| 143 | + "https://schema.org/Person": { |
| 144 | + "predicate_id": "skos:exactMatch" |
| 145 | + } |
| 146 | + } |
| 147 | + ] |
| 148 | + }, |
| 149 | + "x-oold-uuid": { |
| 150 | + "description": "Stable UUID identifying this schema across versions and locations.", |
| 151 | + "type": "string", |
| 152 | + "format": "uuid" |
| 153 | + }, |
| 154 | + "x-oold-version": { |
| 155 | + "description": "Semantic version of this schema.", |
| 156 | + "type": "string" |
| 157 | + }, |
| 158 | + "x-oold-prior-version": { |
| 159 | + "description": "Identifier or version of the immediately preceding schema version.", |
| 160 | + "type": "string" |
| 161 | + }, |
| 162 | + "x-oold-backward-compatible-with": { |
| 163 | + "description": "URI of a prior schema version this schema is backward-compatible with.", |
| 164 | + "type": "string", |
| 165 | + "format": "uri-reference" |
| 166 | + }, |
| 167 | + "x-oold-incompatible-with": { |
| 168 | + "description": "URI of a prior schema version this schema is NOT compatible with.", |
| 169 | + "type": "string", |
| 170 | + "format": "uri-reference" |
| 171 | + }, |
| 172 | + "x-oold-instance-rdf-type": { |
| 173 | + "description": "The rdf:type(s) carried by instances of this schema, as a list of IRIs (e.g. [\"schema:Person\"]). OO-LD tooling materializes these as @type when exporting an instance to JSON-LD / RDF.", |
| 174 | + "type": "array", |
| 175 | + "items": { |
| 176 | + "type": "string" |
| 177 | + } |
| 178 | + }, |
| 179 | + "x-oold-ref": { |
| 180 | + "description": "Reference to another OO-LD schema. Use x-oold-ref (not the standard $ref) for references that appear inside OO-LD custom keywords such as x-oold-range: there a plain $ref would be eagerly - and, for cyclic schema graphs, dangerously - dereferenced by generic JSON-Schema bundlers (the behaviour is undefined per Core section 9.4.2). Keep using the standard $ref for ordinary schema composition (allOf, properties, $defs), which bundlers are expected to resolve. x-oold-ref is resolved only by OO-LD-aware tools, lazily and with cycle handling.", |
| 181 | + "type": "string", |
| 182 | + "format": "uri-reference" |
| 183 | + }, |
| 184 | + "x-oold-range": { |
| 185 | + "description": "Type constraint on the target of an IRI-valued property: an IRI string, an array of IRIs, or an OO-LD subschema (using x-oold-ref for references). See the 'Range of properties' section.", |
| 186 | + "anyOf": [ |
| 187 | + { |
| 188 | + "type": "string" |
| 189 | + }, |
| 190 | + { |
| 191 | + "type": "array", |
| 192 | + "items": { |
| 193 | + "type": "string" |
| 194 | + } |
| 195 | + }, |
| 196 | + { |
| 197 | + "type": "object", |
| 198 | + "$comment": "OO-LD subschema form; references inside it use x-oold-ref. The reverse-property keywords (x-oold-reverse-*) are intentionally not validated within a range subschema for now." |
| 199 | + } |
| 200 | + ] |
| 201 | + }, |
| 202 | + "x-oold-multilang-title": { |
| 203 | + "description": "Language map of translated `title` values keyed by BCP-47 language code.", |
| 204 | + "type": "object", |
| 205 | + "additionalProperties": { |
| 206 | + "type": "string" |
| 207 | + } |
| 208 | + }, |
| 209 | + "x-oold-multilang-description": { |
| 210 | + "description": "Language map of translated `description` values keyed by BCP-47 language code.", |
| 211 | + "type": "object", |
| 212 | + "additionalProperties": { |
| 213 | + "type": "string" |
| 214 | + } |
| 215 | + }, |
| 216 | + "x-oold-reverse-properties": { |
| 217 | + "description": "Properties stored on the related object but editable from this side, mapped via JSON-LD @reverse.", |
| 218 | + "type": "object" |
| 219 | + }, |
| 220 | + "x-oold-reverse-required": { |
| 221 | + "description": "Names of reverse properties that are required.", |
| 222 | + "type": "array", |
| 223 | + "items": { |
| 224 | + "type": "string" |
| 225 | + } |
| 226 | + }, |
| 227 | + "x-enum-varnames": { |
| 228 | + "description": "Identifier-safe code names aligned positionally with `enum`, for code generation. For `enum: [\"m\", \"s\"]` the value `[\"metre\", \"second\"]` names each option (so a generator can emit `Unit.metre` instead of `Unit.m`). An established vendor extension (OpenAPI Generator; NSwag uses the camelCase `x-enumNames`). Kept as-is; distinct from the human labels in `x-oold-ui-enum-titles`.", |
| 229 | + "type": "array", |
| 230 | + "items": { "type": "string" }, |
| 231 | + "examples": [["metre", "second"]] |
| 232 | + }, |
| 233 | + "x-enum-descriptions": { |
| 234 | + "description": "Per-value descriptions aligned positionally with `enum`, the established companion of `x-enum-varnames`. For `enum: [\"m\", \"s\"]`: `[\"SI base unit of length\", \"SI base unit of time\"]`.", |
| 235 | + "type": "array", |
| 236 | + "items": { "type": "string" }, |
| 237 | + "examples": [["SI base unit of length", "SI base unit of time"]] |
| 238 | + }, |
| 239 | + "x-oold-reverse-default-properties": { |
| 240 | + "description": "Deprecated. Names of reverse properties shown by default in generated user interfaces. Like the object-level defaultProperties array this is extend-only under composition; prefer a per-reverse-property x-oold-ui-default-property boolean, which is overridable.", |
| 241 | + "deprecated": true, |
| 242 | + "type": "array", |
| 243 | + "items": { |
| 244 | + "type": "string" |
| 245 | + } |
| 246 | + } |
| 247 | + } |
| 248 | +} |
0 commit comments