You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
oold should provide validation, mirroring the CI checks now in OO-LD/schema (currently implemented in JS via scripts/validate.mjs), in Python.
Schema validation - validate that a document is a well-formed OO-LD schema by validating it against the OO-LD dialect meta-schema (meta/oold-meta-schema.json, introduced in OO-LD/schema#41): JSON-Schema 2020-12 conformance plus well-formed x-oold-* keywords (x-oold-range, x-oold-ref, x-oold-multilang-*, x-oold-instance-rdf-type, x-oold-reverse-*, ...).
Instance validation - validate an OO-LD instance against its OO-LD schema, resolving the schema via the spec's Schema Instances rules ($schema -> @context URL -> @type). The schema must permit $schema and @context as instance members (the additionalProperties: false caveat).
Approaches / libraries to consider:
jsonschema (Python) - direct JSON-Schema 2020-12 validation of instances against their schema, and of schemas against the OO-LD meta-schema. The most direct mapping of the JS/ajv CI.
check-json-schema-meta - the tool used in the tutorial; it reads the instance-side $schema, fetches the schema and validates. Consider reusing or aligning with it so the tutorial tooling and oold stay consistent.
Suggested API: oold.validate_schema(...) and oold.validate_instance(...).
ooldshould provide validation, mirroring the CI checks now in OO-LD/schema (currently implemented in JS viascripts/validate.mjs), in Python.Schema validation - validate that a document is a well-formed OO-LD schema by validating it against the OO-LD dialect meta-schema (
meta/oold-meta-schema.json, introduced in OO-LD/schema#41): JSON-Schema 2020-12 conformance plus well-formedx-oold-*keywords (x-oold-range,x-oold-ref,x-oold-multilang-*,x-oold-instance-rdf-type,x-oold-reverse-*, ...).Instance validation - validate an OO-LD instance against its OO-LD schema, resolving the schema via the spec's Schema Instances rules (
$schema->@contextURL ->@type). The schema must permit$schemaand@contextas instance members (theadditionalProperties: falsecaveat).Approaches / libraries to consider:
jsonschema(Python) - direct JSON-Schema 2020-12 validation of instances against their schema, and of schemas against the OO-LD meta-schema. The most direct mapping of the JS/ajv CI.pydantic-ooldalready generates pydantic models (via datamodel-code-generator); instance validation can run by parsing data into the generated model. Fits the code-as-schema / typed-object route and ties into object-graph binding (Add oold-python to the tutorial (object-graph binding examples) oold-tutorial#10).check-json-schema-meta- the tool used in the tutorial; it reads the instance-side$schema, fetches the schema and validates. Consider reusing or aligning with it so the tutorial tooling andooldstay consistent.Suggested API:
oold.validate_schema(...)andoold.validate_instance(...).Relates to OO-LD/schema#41 (meta-schema), OO-LD/schema#23 (CI), OO-LD/schema#34 (instance -> schema linking), OO-LD/oold-tutorial#10.