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

Change how cardinalities are specified in the Metaschema #441

Closed
10 tasks
david-waltermire opened this issue Jun 19, 2019 · 3 comments
Closed
10 tasks

Change how cardinalities are specified in the Metaschema #441

david-waltermire opened this issue Jun 19, 2019 · 3 comments
Assignees
Labels
enhancement Scope: Metaschema Issues targeted at the metaschema pipeline Scope: Modeling Issues targeted at development of OSCAL formats User Story

Comments

@david-waltermire
Copy link
Contributor

User Story:

As an OSCAL model developer, I need to be able to define cardinalities in the Metaschema for assembly and field elements.

Goals:

The current Metaschema allows for the cardinality of assembly and field elements to be defined using two capabilities. The first is by making the assembly and field plural and the second is by using the @required="yes" attribute. These two features result in the following:

Singular Plural
required="yes" 1-1 1-many
required="no" 0-1 0-many

This approach differs from how cardinalities are defined in the XML and JSON schema languages.

To be more consistant the following changes need to be made:

  • Minimum occurance needs to be specified using @min-occurs allowing a non-negative number value to be provided. This will replace the @required attribute. The default value for @min-occurs if not provided will be "0".

    For example: @min-occurs="0" or @min-occurs="1".

  • Maximum occurance needs to be specified using @max-occurs allowing a positive number value or the constant value unbounded to be provided. This will allow for a set upper bound using a positive number, or any number of occurances using unbounded. This will replace the use of assemblies and flags. This approach adds the ability to set an actual upper bound, which is not currently supported in the Metaschema. The default value for @max-occurs if not provided will be "1".

    For example: @max-occurs="1", @max-occurs="5", or @max-occurs="unbounded".

  • Generated XML and JSON schema need to be updated to support these new constructs.

    XML Schema uses the same constructs.

    JSON Schema uses similar constructs as follows:

    {
      "type": "array",
      "minItems": 2,
      "maxItems": 3
    }
    

    This must also work with the singlton/array optomization we are using in the generated schemas.

    • When @max-occurs is 1, the resulting schema must assume that only a singlton value will be provided. Otherwise, the schema will allow an array or a singleton.
    • When @min-occurs is 0 or 1, the resulting schema must allow for either a singleton or an array to be provided. If the @min-occurs is greater than 1, then the schema will allow only an array.

Dependencies:

None.

Acceptance Criteria

  • All generated XML and JSON schema are updated to reflect these changes. Content instances are checked by the CI/CD workflow.
  • XML and JSON documentation generated by the CI/CD workflow correctly represents the correct cardinalities.
  • The Metaschema definitions are updated in a way that result in no changes to associated content.
  • Documentation on the use of Metaschema is updated to fully document use of the @min-occurs and max-occurs features.
  • A single PR is approved that contains the above changes.
@david-waltermire david-waltermire added Scope: Modeling Issues targeted at development of OSCAL formats Scope: Metaschema Issues targeted at the metaschema pipeline labels Jun 20, 2019
wendellpiez added a commit to wendellpiez/OSCAL that referenced this issue Jun 26, 2019
@iMichaela
Copy link
Contributor

7/11/2019

This issue and the related ones (noted in #435 ) for the metaschema need to be reviewed together and unitested. However, more unit tests need to be created for the other features.

wendellpiez added a commit to wendellpiez/OSCAL that referenced this issue Jul 18, 2019
@david-waltermire
Copy link
Contributor Author

This will be closed once PR #464 is pulled.

david-waltermire pushed a commit to david-waltermire/OSCAL that referenced this issue Aug 16, 2019
david-waltermire pushed a commit to david-waltermire/OSCAL that referenced this issue Aug 16, 2019
david-waltermire added a commit that referenced this issue Aug 22, 2019
* Supporting enumerated value lists on flags in XSD and JSON Schema #437
* Metaschema improvements and remodeling flags support (local definitions; moving w/in the model; valid values)
* More Metaschema syntax remodeling: now using max-occurs and min-occurs for cardinality indicators #441
* Updating schemas to current model (transitional); updated docs in resulting XSD per #448; some updates to markdown documentation
* Small updates to authoring CSS.
* Added design notes on JSON schema bindings.
* Including an initial set of unit tests for group-by, some data types, etc.
* Updated to new design (#436): Metaschema schema, Schematron, metaschema update XSLT - will break the build for now
* Work on datatyping #436 including support in XML and JSON Schema
* Addressed #451: parameter insertion syntax in Markdown
* Schema documentation improvements #423 #424 #428
* Addressed feature request #438
* Improving handling of JSON 'key' and 'value-key' settings in docs #428
* Now producing XML and JSON model maps from metaschemas.
* Now escaping {{ for Jekyll
* Updated component metaschema based on design notes
* Fixed schematron assertions to properly work with @ref.
* Refactoring of component and SSP metachema.
* Fixed website side navigation. Added component and SSP metaschema to site generation process.
* Addressed comments in issue #445
* Added site content generation to runall.sh
* Started documenting model changes in release notes. More work is still needed to complete this.
david-waltermire added a commit to david-waltermire/OSCAL that referenced this issue Aug 26, 2019
* Supporting enumerated value lists on flags in XSD and JSON Schema usnistgov#437
* Metaschema improvements and remodeling flags support (local definitions; moving w/in the model; valid values)
* More Metaschema syntax remodeling: now using max-occurs and min-occurs for cardinality indicators usnistgov#441
* Updating schemas to current model (transitional); updated docs in resulting XSD per usnistgov#448; some updates to markdown documentation
* Small updates to authoring CSS.
* Added design notes on JSON schema bindings.
* Including an initial set of unit tests for group-by, some data types, etc.
* Updated to new design (usnistgov#436): Metaschema schema, Schematron, metaschema update XSLT - will break the build for now
* Work on datatyping usnistgov#436 including support in XML and JSON Schema
* Addressed usnistgov#451: parameter insertion syntax in Markdown
* Schema documentation improvements usnistgov#423 usnistgov#424 usnistgov#428
* Addressed feature request usnistgov#438
* Improving handling of JSON 'key' and 'value-key' settings in docs usnistgov#428
* Now producing XML and JSON model maps from metaschemas.
* Now escaping {{ for Jekyll
* Updated component metaschema based on design notes
* Fixed schematron assertions to properly work with @ref.
* Refactoring of component and SSP metachema.
* Fixed website side navigation. Added component and SSP metaschema to site generation process.
* Addressed comments in issue usnistgov#445
* Added site content generation to runall.sh
* Started documenting model changes in release notes. More work is still needed to complete this.
@david-waltermire
Copy link
Contributor Author

This has been completed in PR #464.

bradh pushed a commit to bradh/OSCAL that referenced this issue Dec 4, 2019
* Supporting enumerated value lists on flags in XSD and JSON Schema usnistgov#437
* Metaschema improvements and remodeling flags support (local definitions; moving w/in the model; valid values)
* More Metaschema syntax remodeling: now using max-occurs and min-occurs for cardinality indicators usnistgov#441
* Updating schemas to current model (transitional); updated docs in resulting XSD per usnistgov#448; some updates to markdown documentation
* Small updates to authoring CSS.
* Added design notes on JSON schema bindings.
* Including an initial set of unit tests for group-by, some data types, etc.
* Updated to new design (usnistgov#436): Metaschema schema, Schematron, metaschema update XSLT - will break the build for now
* Work on datatyping usnistgov#436 including support in XML and JSON Schema
* Addressed usnistgov#451: parameter insertion syntax in Markdown
* Schema documentation improvements usnistgov#423 usnistgov#424 usnistgov#428
* Addressed feature request usnistgov#438
* Improving handling of JSON 'key' and 'value-key' settings in docs usnistgov#428
* Now producing XML and JSON model maps from metaschemas.
* Now escaping {{ for Jekyll
* Updated component metaschema based on design notes
* Fixed schematron assertions to properly work with @ref.
* Refactoring of component and SSP metachema.
* Fixed website side navigation. Added component and SSP metaschema to site generation process.
* Addressed comments in issue usnistgov#445
* Added site content generation to runall.sh
* Started documenting model changes in release notes. More work is still needed to complete this.
aj-stein-nist pushed a commit to aj-stein-nist/OSCAL-forked that referenced this issue Jan 25, 2023
* Supporting enumerated value lists on flags in XSD and JSON Schema usnistgov#437
* Metaschema improvements and remodeling flags support (local definitions; moving w/in the model; valid values)
* More Metaschema syntax remodeling: now using max-occurs and min-occurs for cardinality indicators usnistgov#441
* Updating schemas to current model (transitional); updated docs in resulting XSD per usnistgov#448; some updates to markdown documentation
* Small updates to authoring CSS.
* Added design notes on JSON schema bindings.
* Including an initial set of unit tests for group-by, some data types, etc.
* Updated to new design (usnistgov#436): Metaschema schema, Schematron, metaschema update XSLT - will break the build for now
* Work on datatyping usnistgov#436 including support in XML and JSON Schema
* Addressed usnistgov#451: parameter insertion syntax in Markdown
* Schema documentation improvements usnistgov#423 usnistgov#424 usnistgov#428
* Addressed feature request usnistgov#438
* Improving handling of JSON 'key' and 'value-key' settings in docs usnistgov#428
* Now producing XML and JSON model maps from metaschemas.
* Now escaping {{ for Jekyll
* Updated component metaschema based on design notes
* Fixed schematron assertions to properly work with @ref.
* Refactoring of component and SSP metachema.
* Fixed website side navigation. Added component and SSP metaschema to site generation process.
* Addressed comments in issue usnistgov#445
* Added site content generation to runall.sh
* Started documenting model changes in release notes. More work is still needed to complete this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Scope: Metaschema Issues targeted at the metaschema pipeline Scope: Modeling Issues targeted at development of OSCAL formats User Story
Projects
None yet
Development

No branches or pull requests

3 participants