-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metaschema constraints definition and enforcement #12
Comments
April 8 Update Considerable progress on this in my working branch. An implementation is now nominally feature complete. It works by producing a Schematron to be used alongside the XSD for a Metaschema, which reports errors for constraints violated in data conforming to its model. Testing and bug fixing proceeds. https://github.com/wendellpiez/metaschema/tree/issue39-pipeline-refactor |
April 30 Update After demonstrating the basic idea of Metaschema-based Schematron production for constraints enforcement, including the necessary path mapping (#45), we have been iterating the design, extending to support local extensions of constraints on data objects, defined on ancestors of those objects. At this point there are still two or three questions of design/specification in this feature set, Most lately, I have created a couple of test metaschemas illustrating these issues. @david-waltermire-nist and I will continue to work on this with all deliberate speed. |
August 4 Update This has been stable while we built out other features including bidirectional conversion. Remaining to do: build XSLT to read an XML-oriented Metatron and produce the JSONatron variant (a Schematron that can be run over JSON). Also, testing. |
The Metaschema constraints have been implemented in the Java-based toolchain. The XSLT implementation needs to be brought up to the same level of support. |
WIP on this is in the repository at https://github.com/usnistgov/metaschema/blob/main/toolchains/xslt-M4/schema-gen/make-metaschema-metatron.xsl. It is stable although not fully tested and possibly not fully current. Moving forward then depends on external specs and unit tests for constraints definition and use. This could be done informally against OSCAL but I am not ready to plan that. Advice? Advancing on this depends on how we refactor the implementations and unit tests for Metaschema 'constraint' features. |
…ov#37) * integrated schema generation unit tests with new build scripting * Work in progress on metaschema-related updates towards OSCAL SSP conversion roundtrips. * added required top-level property to all unit-test JSON schema files * Added XSD targets for unit testing * oXygen project file for metaschema testing * Updated project file * Test coverage and planning docs * added unit test for collapse * fixed a bug in the test script causing expected schema files to not be compared. * Addressing Issue usnistgov#11: JSON Schema missing constraint at root * Adding metaschema documentation. usnistgov#16 usnistgov/OSCAL#596 * Added CI/CD files for website. * Added Github issue templates. * Addressing usnistgov#12, supporting collapsibility of fields. * Fixed website build error. * Updating website contents and CI/CD configuration. * Patch to catch up metaschema implementation to latest changes in the OSCAL repo. * fixed broken links in documentation * updated repository documentation to fix broken links * added configuration support to build scripts * Implemented content converter generation in build scripts * Removed references to local files for usnistgov/OSCAL#566 * integrated schema generation unit tests with new build scripting * Now accounting for json-value-key/json-key combination * removed extra files Co-authored-by: Wendell Piez <wapiez@wendellpiez.com>
…snistgov#36) * Work in progress on metaschema-related updates towards OSCAL SSP conversion roundtrips. * added required top-level property to all unit-test JSON schema files * Added XSD targets for unit testing * oXygen project file for metaschema testing * Updated project file * Test coverage and planning docs * added unit test for collapse * fixed a bug in the test script causing expected schema files to not be compared. * Addressing Issue usnistgov#11: JSON Schema missing constraint at root * Adding metaschema documentation. usnistgov#16 usnistgov/OSCAL#596 * Added CI/CD files for website. Added Github issue templates. * Addressing usnistgov#12, supporting collapsibility of fields. * Fixed website build error. * Updating website contents and CI/CD configuration. * Patch to catch up metaschema implementation to latest changes in the OSCAL repo. * fixed broken links in documentation * updated repository documentation to fix broken links * added configuration support to build scripts * Implemented content converter generation in build scripts * Removed references to local files for usnistgov/OSCAL#566 * integrated schema generation unit tests with new build scripting * Now accounting for json-value-key/json-key combination Co-authored-by: David Waltermire <david.waltermire@nist.gov>
* integrated schema generation unit tests with new build scripting * Work in progress on metaschema-related updates towards OSCAL SSP conversion roundtrips. * added required top-level property to all unit-test JSON schema files * Added XSD targets for unit testing * oXygen project file for metaschema testing * Updated project file * Test coverage and planning docs * added unit test for collapse * fixed a bug in the test script causing expected schema files to not be compared. * Addressing Issue usnistgov#11: JSON Schema missing constraint at root * Adding metaschema documentation. usnistgov#16 usnistgov/OSCAL#596 * Added CI/CD files for website. * Added Github issue templates. * Addressing usnistgov#12, supporting collapsibility of fields. * Fixed website build error. * Updating website contents and CI/CD configuration. * Patch to catch up metaschema implementation to latest changes in the OSCAL repo. * fixed broken links in documentation * updated repository documentation to fix broken links * added configuration support to build scripts * Implemented content converter generation in build scripts * Removed references to local files for usnistgov/OSCAL#566 * integrated schema generation unit tests with new build scripting * Now accounting for json-value-key/json-key combination * removed extra files Co-authored-by: Wendell Piez <wapiez@wendellpiez.com>
User Story:
Metaschema needs new features to help developers and potentially users (content developers) to validate arbitrary constraints over their data, sometimes defined locally, frequently over and above the constraints introduced by the models themselves. So, not a new field (for example), but a new rule about values permitted on a field with a given flag.
This bears importantly on customization, as many customizations if not most can take the form of new constraints over generic models (such as
part
andprop
) rather than new models.Goals:
Extend the features of Metaschema to support more and better constraint checking, including node occurrence and value constraints as well as compound and co-occurrence constraints.
We start with customizing
allowed-values
but we go from there. # 2 on the list is probably support for checking referential integrity, for example of internal links, or whether everyinsert
points to a parameter.An implemention will be able to read the constraint definition and produce appropriate XSD and/or Schematron code, for XML, and for JSON, the functional equivalent. (Perhaps another Schematron, or a single "ambidextrous" one.)
Dependencies:
A stable Metaschema. This work is being done in conjunction with usnistgov/metaschema#39.
In its branch there are (rough) design notes exploring a number of features we wish to support: see https://github.com/wendellpiez/metaschema/blob/issue39-pipeline-refactor/toolchains/xslt-proto-v04/definition-notes.md.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: