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

Producing the JSON samples from XML via metaschema conversions #241

Closed
3 tasks done
wendellpiez opened this issue Oct 1, 2018 · 5 comments
Closed
3 tasks done

Producing the JSON samples from XML via metaschema conversions #241

wendellpiez opened this issue Oct 1, 2018 · 5 comments
Assignees
Labels
Discussion Needed This issues needs to be reviewed by the OSCAL development team. Scope: Content Development of OSCAL content and examples. Scope: Website Issues targeted at the OSCAL project website. User Story

Comments

@wendellpiez
Copy link
Contributor

wendellpiez commented Oct 1, 2018

User Story:

We still do not have a complete and comprehensive spec for the XML<->JSON mapping (which is subject to finalization of the metaschema and OSCAL declarations models), but we have demo code that shows such conversions live via scripts produced from a metaschema; these can presumably be applied to make equivalent JSON from any (valid) XML we make or acquire.

To promote consistency and comprehensibility, JSON samples in the repository should be produced by these conversion scripts not by other means.

Goals:

Place the metaschema-supported XML-JSON conversion technology "under load". Produce consistent JSON examples easily. Avoid having to maintain two sets of examples in parallel by hand.

Dependencies:

  • Determine scope of coverage for samples conversion (maybe start small)
  • Test XSLTs and shake out the results of the conversions themselves and make sure they hang together
  • Agree on acceptable stack/tools dependencies (Java/SaxonHE from command line, i.e. same as metaschema build?)

Acceptance Criteria

Demonstrate that we can produce the JSON examples via automated means that can be (a) distributed and shared to support this task and (b) capable of being used under CI.

Integrating this capability fully under CI is not an acceptance criterion.

@wendellpiez
Copy link
Contributor Author

wendellpiez commented Oct 1, 2018

NB by "JSON examples" here we mean not only the examples given in metaschema docs (see #242) but all the provided JSON variants of published catalogs and profiles (in the content directory). Ultimately this script may run broadly over subdirectories of content.

Also - an XSLT 3.0 could do this instead of a shell script, picking up sets of XML and dynamically applying conversions to them per detected type.

@david-waltermire david-waltermire added User Story Discussion Needed This issues needs to be reviewed by the OSCAL development team. Scope: Content Development of OSCAL content and examples. Scope: Website Issues targeted at the OSCAL project website. labels May 8, 2019
@david-waltermire david-waltermire added this to the OSCAL 1.0 M1 milestone May 29, 2019
@wendellpiez
Copy link
Contributor Author

We are now producing JSON successfully by automated conversion inside and outside CI/CD. What is missing is the specification for how Metaschema constructs map into XML and JSON. This will also be a basis for more formal work (see #239, #388).

This spec can be in markdown to start. (It is tempting to make a metaschema for the Metaschema but the models will not go: it would be only a shell for documentation.) The ToC should also be compared to query returns from the Metaschema XSD to ensure comprehensiveness.

However, this documentation is not listed as an Acceptance Criterion for this Issue, which is now being met. I suggest we either edit the statement of work or close this Issue and open one for writing a specification. (Unless there are also other work items here: @david-waltermire-nist any thoughts?)

@wendellpiez
Copy link
Contributor Author

A new issue #398 describes a requirement for mapping paths in conversion between XML and JSON. The mechanism we build needs to be written up with the work here.

@wendellpiez
Copy link
Contributor Author

@david-waltermire-nist @anweiss you might be in the best position to assess whether:

  1. JSON samples are being successfully produced in CI/CD?
  2. Can we close this Issue in favor of other issues focusing on requirements?

Once I am also comfortable running the build scripts I could also vouch for this.

@david-waltermire
Copy link
Contributor

This has been completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Needed This issues needs to be reviewed by the OSCAL development team. Scope: Content Development of OSCAL content and examples. Scope: Website Issues targeted at the OSCAL project website. User Story
Projects
None yet
Development

No branches or pull requests

2 participants