Skip to content

Commit 1c4c8cf

Browse files
committed
chore(meta): vendor oold-schema v1.0.0-rc.3
- 73 rules, up from 66; none retired, no id reused - OOLD-CMP-a05a is now machine_checkable=false, so coverage.rules stops counting a rule no validator can decide - fixtures refreshed from the same tag; examples/ is byte-identical to rc.2, so only index.json records the move
1 parent e24a1d6 commit 1c4c8cf

7 files changed

Lines changed: 1719 additions & 1 deletion

File tree

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
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+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://oo-ld.org/latest/meta/oold-meta-schema.json",
4+
"title": "OO-LD dialect meta-schema",
5+
"$comment": "The $id uses the versioned hosting at oo-ld.org/ (the source keeps the /latest/ placeholder; each released copy is stamped per release). The OO-LD vocabulary is declared optional (false) so that generic JSON-Schema 2020-12 validators still process OO-LD schemas. Two-tier structure: this resource is what a schema's $schema points at, so it carries the DOCUMENT-level obligations (required: $id). The dialect body lives in oold-meta-schema-base.json, which holds $dynamicAnchor: \"meta\"; nested subschemas recurse into the base via the standard $dynamicRef and are therefore NOT required to carry $id - a fragment inside properties or $defs legitimately has none. The UI keyword definitions are included via the oold-ui-meta-schema #keywords anchor so a schema carrying x-oold-ui-* annotations validates in one pass. The @context below is the OO-LD meta-level prefix set against which x-oold-context / x-oold-sssom CURIEs (synonym keys, predicate_id, mapping_set_id) are expanded by OO-LD processors; it is not an instance context.",
6+
"@context": {
7+
"skos": "http://www.w3.org/2004/02/skos/core#",
8+
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
9+
"owl": "http://www.w3.org/2002/07/owl#",
10+
"xsd": "http://www.w3.org/2001/XMLSchema#",
11+
"sssom": "https://w3id.org/sssom/"
12+
},
13+
"$vocabulary": {
14+
"https://json-schema.org/draft/2020-12/vocab/core": true,
15+
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
16+
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
17+
"https://json-schema.org/draft/2020-12/vocab/validation": true,
18+
"https://json-schema.org/draft/2020-12/vocab/meta-data": true,
19+
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
20+
"https://json-schema.org/draft/2020-12/vocab/content": true,
21+
"https://oo-ld.org/latest/vocab/oold": false
22+
},
23+
"$ref": "https://oo-ld.org/latest/meta/oold-meta-schema-base.json",
24+
"required": [
25+
"$id"
26+
]
27+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://oo-ld.org/latest/meta/oold-pattern-lint.schema.json",
4+
"title": "OO-LD round-trip pattern lint",
5+
"description": "SHOULD-level constraints on a schema's @context that keep instances round-trip-safe, checkable by JSON Schema alone. This is distinct from oold-meta-schema.json, which asserts MUST-level well-formedness. It currently enforces that no term coerces a literal to a datatype JSON-LD produces by default from a native JSON value (xsd:string, xsd:boolean, xsd:integer, xsd:double): xsd:string is RDF's default datatype and is elided from plain literals, and the round-trip contract reconstructs boolean/integer/double literals as native JSON values (fromRDF with native types), so in both cases the value carries no @type and a term declaring one is never selected when the value is compacted back from RDF - the property returns under its full IRI and the round-trip is lossy (see the specification, Property value forms). JSON-LD derives the correct RDF datatype from the native JSON type, so these coercions are also redundant. Datatypes JSON-LD does not produce by default (xsd:date, xsd:dateTime, xsd:float, ... - the value carried as a JSON string) keep their @type through the round-trip and coerce fine. CURIEs are matched in their conventional xsd: form and as the full XSD IRI; a term that coerces through a non-standard prefix mapping is beyond what a single JSON Schema can resolve and is left to tooling.",
6+
"type": "object",
7+
"properties": {
8+
"@context": { "$ref": "#/$defs/context" }
9+
},
10+
"$defs": {
11+
"context": {
12+
"oneOf": [
13+
{ "type": "null" },
14+
{ "type": "string" },
15+
{ "type": "array", "items": { "$ref": "#/$defs/context" } },
16+
{ "$ref": "#/$defs/contextObject" }
17+
]
18+
},
19+
"contextObject": {
20+
"type": "object",
21+
"patternProperties": {
22+
"^@": true,
23+
"^[^@]": { "$ref": "#/$defs/termValue" }
24+
},
25+
"additionalProperties": { "$ref": "#/$defs/termValue" }
26+
},
27+
"termValue": {
28+
"oneOf": [
29+
{ "type": "null" },
30+
{ "type": "string" },
31+
{ "$ref": "#/$defs/termDefinition" }
32+
]
33+
},
34+
"termDefinition": {
35+
"type": "object",
36+
"properties": {
37+
"@type": { "$ref": "#/$defs/notNativeJsonDatatype" },
38+
"@context": { "$ref": "#/$defs/context" }
39+
}
40+
},
41+
"notNativeJsonDatatype": {
42+
"not": {
43+
"enum": [
44+
"xsd:string", "http://www.w3.org/2001/XMLSchema#string",
45+
"xsd:boolean", "http://www.w3.org/2001/XMLSchema#boolean",
46+
"xsd:integer", "http://www.w3.org/2001/XMLSchema#integer",
47+
"xsd:double", "http://www.w3.org/2001/XMLSchema#double"
48+
]
49+
}
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)