Skip to content
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

Update XML-JSON conversion script production to current Metaschema model #51

Closed
3 tasks
wendellpiez opened this issue Apr 29, 2020 · 4 comments · Fixed by #214 or #197
Closed
3 tasks

Update XML-JSON conversion script production to current Metaschema model #51

wendellpiez opened this issue Apr 29, 2020 · 4 comments · Fixed by #214 or #197
Assignees
Labels
enhancement New feature or request XSLT Implementation Issue relates to the XSLT implementation of Metaschema.

Comments

@wendellpiez
Copy link
Collaborator

User Story:

Prototype Metaschema (OSCAL Milestone 2) supports automatic production of scripts (XSLT stylesheets) capable of converting between equivalent representations of OSCAL data in XML and JSON. We also need this capability going forward, now taking account of new features such as local definitions. Additionally, there are great opportunities for refactoring for traceability and maintainability.

Since Java tooling being developed by @david-waltermire-nist is also capable of this operation (by parsing both JSON and XML to a common model, then re-serializing into either notation), it may not be a requirement for Milestone 3 (tbd).

This Issue should be tracked by usnistgov/OSCAL#633.

Goals:

New better capabilities for producing XML->JSON and JSON->XML conversion scripts based on Metaschema declarations. Must support the new features including local declarations.

Dependencies:

Stable Metaschema design (#39) is a finish-to-finish dependency for this work item, but only with respect to model definitions, not constraints. So it is independent of usnistgov/metaschema-xslt#12.

See also #49, which would simplify the work (slightly) by removing a datatype.

Acceptance Criteria

  • All website and readme documentation affected by the changes in this issue have been updated. Changes to the website can be made in the docs/content directory of your branch.
  • A Pull Request (PR) is submitted that fully addresses the goals of this User Story. This issue is referenced in the PR.
  • The CI-CD build process runs without any reported errors on the PR. This can be confirmed by reviewing that all checks have passed in the PR.
@wendellpiez wendellpiez added the enhancement New feature or request label Apr 29, 2020
@wendellpiez wendellpiez self-assigned this Apr 29, 2020
@wendellpiez
Copy link
Collaborator Author

wendellpiez commented Apr 29, 2020

April 30 Update

Work is now underway on this: progress is encouraging.

The new implementation will a significant improvement over the OSCAL Milestone 2 version. Instead of deriving, from a single metaschema, both XML->JSON and JSON->XML conversion utilities, we are producing scripts that cast either format into a common "supermodel" instance, which contains all information necessary for serialization to any supported notation. From there, common utility stylesheets will re-serialize the supermodel representation into XML, JSON or potentially other formats in future such as YAML.

Since this supermodel format consolidates all information needed for clean conversion in one place, it is much easier both to produce from a metaschema, with simpler logic than is required for direct conversion. The supermodel itself is a straight-up abstraction from the Metaschema, with five (5) element types capable of representing, in abstracted and annotated form, the full information set in any schema-valid instance -- kind of a Metaschema-based analog to the XSD PSVI (post-schema-validation infoset).

Cf also usnistgov/OSCAL#633

wendellpiez added a commit to wendellpiez/metaschema that referenced this issue Apr 29, 2020
wendellpiez added a commit to wendellpiez/metaschema that referenced this issue Apr 30, 2020
…rator, including XML to supermodel, supermodel to JSON
@wendellpiez
Copy link
Collaborator Author

This is looking good in my feature branch: https://github.com/wendellpiez/metaschema/tree/issue39-pipeline-refactor

wendellpiez added a commit to wendellpiez/metaschema that referenced this issue Jun 11, 2020
wendellpiez added a commit to wendellpiez/metaschema that referenced this issue Jun 11, 2020
…rator, including XML to supermodel, supermodel to JSON
david-waltermire pushed a commit that referenced this issue Sep 17, 2020
david-waltermire pushed a commit that referenced this issue Sep 17, 2020
…cluding XML to supermodel, supermodel to JSON
wendellpiez added a commit to wendellpiez/metaschema that referenced this issue Nov 10, 2020
wendellpiez added a commit to wendellpiez/metaschema that referenced this issue Nov 10, 2020
…rator, including XML to supermodel, supermodel to JSON
david-waltermire pushed a commit that referenced this issue Nov 13, 2020
david-waltermire pushed a commit that referenced this issue Nov 13, 2020
…cluding XML to supermodel, supermodel to JSON
david-waltermire pushed a commit that referenced this issue Dec 21, 2020
david-waltermire pushed a commit that referenced this issue Dec 21, 2020
…cluding XML to supermodel, supermodel to JSON
wendellpiez added a commit that referenced this issue May 26, 2021
david-waltermire pushed a commit that referenced this issue May 27, 2021
* Many adjustments toward correct converter generation, though still broken - start with unit test toolchains/xslt-M4/metapath/metapath-jsonizing.xspec - this is a fail-safe commit

* Now appears to pass testing scenarios (but more testing is coming)

* Committing a version that handles test data correctly (so far) from rebuilt metaschema composition addressing #51 #53 #76
david-waltermire added a commit that referenced this issue Jun 6, 2021
* Rework of docs focusing on JSON docs and model pipeline
* Improvements to composition toolchain
* Fixed a few small bugs in the metaschema-check. Improved performance of the compose pruning using an accumulator.
* Moved edge-case samples into testing directory
* Made shadowing warning a warning
* Initial commit of an Oxygen Metaschema framework.
* Creation of new compose schematron unit tests.
* Cross-linking XML and JSON syntax pages and other improvements to links
* Now building XML and JSON indexes to reference pages, with links to steps
* Reconfigured docs pipeline (XSLT entry points); adding new files including pipeline steps
* Migrating schema generation tools to new/improved composition pipeline
* Addressing usnistgov/OSCAL#902 thanks for finding this bug
* Enhancements to JSON Schema definition (with better performance too)
* Adding support for json-base-uri as a metaschema property
* Updated JSON schema $id; factoring out common docs XSLT
* Fixing IDs in JSON schema per issue usnistgov/OSCAL#933.
* Addressing datatype validation issues: whitespace collapsing; non-empty values; ncname-workalike in JSON Schema - see usnistgov/OSCAL#911  usnistgov/OSCAL#805 also #33 #67 #68
* Improvements to XSD production; fully aligning 'token' datatype across XSD and JSON Schema implementations.
* Updating bidirectional XML/JSON converter generators (#143)
* Committing a version that handles test data correctly (so far) from rebuilt metaschema composition addressing #51 #53 #76
* Now displaying constraints in documentation at point of definition;
* Docs generation revamp Reworked reference and other pages to sketch - #128 and others

Co-authored-by: Wendell Piez <wendell.piez@nist.gov>
@wendellpiez
Copy link
Collaborator Author

Conversion scripts are currently stable (under M4) so this issue can be closed.

@wendellpiez wendellpiez added the closable Issue is n/a or satisfied label Aug 26, 2021
@david-waltermire david-waltermire added this to the Metaschema 0.9.0 milestone Apr 12, 2022
@david-waltermire david-waltermire removed the closable Issue is n/a or satisfied label Apr 12, 2022
@david-waltermire
Copy link
Collaborator

This should be updated based on the changes summarized in #195.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request XSLT Implementation Issue relates to the XSLT implementation of Metaschema.
Projects
None yet
2 participants