diff --git a/toolchains/xslt-M4/schema-gen/metaschema-v090-datatypes.json b/schema/json/metaschema-datatypes.json similarity index 91% rename from toolchains/xslt-M4/schema-gen/metaschema-v090-datatypes.json rename to schema/json/metaschema-datatypes.json index b82505d6e..180f86333 100644 --- a/toolchains/xslt-M4/schema-gen/metaschema-v090-datatypes.json +++ b/schema/json/metaschema-datatypes.json @@ -44,8 +44,10 @@ "pattern": "^.+@.+$" }, "HostnameDatatype": { - "$ref": "#/definitions/StringDatatype", - "format": "idn-hostname" + "allOf": [ + {"$ref": "#/definitions/StringDatatype"}, + {"format": "idn-hostname"} + ] }, "IntegerDatatype": { "type": "integer" @@ -68,12 +70,18 @@ "type": "string" }, "NonNegativeIntegerDatatype": { - "$ref": "#/definitions/IntegerDatatype", - "minimum": 0 + "allOf": [ + {"$ref": "#/definitions/IntegerDatatype"}, + {"minimum": 0, + "type": "number"} + ] }, "PositiveIntegerDatatype": { - "$ref": "#/definitions/IntegerDatatype", - "minimum": 1 + "allOf": [ + {"$ref": "#/definitions/IntegerDatatype"}, + {"minimum": 1, + "type": "number"} + ] }, "StringDatatype": { "type": "string", diff --git a/schema/xml/metaschema-datatypes.xsd b/schema/xml/metaschema-datatypes.xsd new file mode 100644 index 000000000..a1f8e099a --- /dev/null +++ b/schema/xml/metaschema-datatypes.xsd @@ -0,0 +1,241 @@ + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + + A host name + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + A string token following the rules of XML "no + colon" names, with no whitespace. (XML names are single alphabetic + characters followed by alphanumeric characters, periods, underscores or dashes.) + + + + + + + + A single token may not contain whitespace. + + + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + + diff --git a/schema/xml/metaschema-markup-line.xsd b/schema/xml/metaschema-markup-line.xsd new file mode 100644 index 000000000..7d8d48bd2 --- /dev/null +++ b/schema/xml/metaschema-markup-line.xsd @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/toolchains/xslt-M4/schema-gen/oscal-prose-module.xsd b/schema/xml/metaschema-markup-multiline.xsd similarity index 50% rename from toolchains/xslt-M4/schema-gen/oscal-prose-module.xsd rename to schema/xml/metaschema-markup-multiline.xsd index 555ab46fc..559a3915f 100644 --- a/toolchains/xslt-M4/schema-gen/oscal-prose-module.xsd +++ b/schema/xml/metaschema-markup-multiline.xsd @@ -1,14 +1,10 @@ + + - - - - - - - - + + @@ -103,77 +99,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - An insert can be used to identify a placeholder for dynamically inserting text related to a specific object, which is referenced by the object's identifier using an id-ref. This insert mechanism allows the selection of which text value from the object to dynamically include based on the application's display requirements. - - - - The type of object to include from (e.g., parameter, control, component, role, etc.) - - - - - The identity of the object to insert a value for. The identity will be selected from the index of objects of the specified type. The specific value to include is based on the application's display requirements, which will likely use a specific data element associated with the type (e.g., title, identifier, value, etc.) that is appropriate for the application. - - - - - - diff --git a/schema/xml/metaschema-prose-base.xsd b/schema/xml/metaschema-prose-base.xsd new file mode 100644 index 000000000..320daac4b --- /dev/null +++ b/schema/xml/metaschema-prose-base.xsd @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An insert can be used to identify a placeholder for dynamically inserting text related to a specific object, which is referenced by the object's identifier using an id-ref. This insert mechanism allows the selection of which text value from the object to dynamically include based on the application's display requirements. + + + + The type of object to include from (e.g., parameter, control, component, role, etc.) + + + + + The identity of the object to insert a value for. The identity will be selected from the index of objects of the specified type. The specific value to include is based on the application's display requirements, which will likely use a specific data element associated with the type (e.g., title, identifier, value, etc.) that is appropriate for the application. + + + + + + + diff --git a/schema/xml/metaschema-prose-module.xsd b/schema/xml/metaschema-prose-module.xsd new file mode 100644 index 000000000..e653c0537 --- /dev/null +++ b/schema/xml/metaschema-prose-module.xsd @@ -0,0 +1,5 @@ + + + + + diff --git a/toolchains/xslt-M4/validate/metaschema.xsd b/schema/xml/metaschema.xsd similarity index 66% rename from toolchains/xslt-M4/validate/metaschema.xsd rename to schema/xml/metaschema.xsd index 0ee574e4a..d6dc6bc06 100644 --- a/toolchains/xslt-M4/validate/metaschema.xsd +++ b/schema/xml/metaschema.xsd @@ -4,30 +4,62 @@ xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0" targetNamespace="http://csrc.nist.gov/ns/oscal/metaschema/1.0"> - + This prose module provides support for line and multiline markup. + + + This datatypes module provides support for all other built-in Metaschema data types. + + + - Root element of an OSCAL Metaschema metaschema. Defines a family of data - structures. + Root element of an OSCAL Metaschema definition. Defines a family of data + structures representing a model. - - - - - - + + + The name of the information model represented by this Metaschema definition. + + + + + + + The namespace for the collection of Metaschema models this Metaschema definition + belongs to. Also the XML namespace governing the names of elements in XML documents, which + expect to be conformant to the schemas expressed by this metaschema. By using this + namespace, documents and document fragments used in mixed-format environments may be + distinguished from neighbor XML formats using other namespaces. This value is not reflected in + OSCAL JSON. + + + + + + + + To import a set of Metaschema definitions from an out-of-line resource, supporting reuse of common information structures. + + + + + A relative or absolute URI for retrieving an out-of-line Metaschema definition. + + + + + - @@ -41,7 +73,6 @@ - @@ -55,15 +86,94 @@ ---> +--> + + + + + Root element of an OSCAL Metaschema external constraints definition. Defines rules to be applied to an existing set of Metaschema models. + + + + + + The name of this constraint set. + + + + + The version of this constraint set. + + + + + + To import a set of Metaschema constraints from an out-of-line resource, supporting composition of constraint sets. + + + + + A relative or absolute URI for retrieving an out-of-line Metaschema definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + The type of all definition and instance names. + + + + An element with structured element content in XML; in JSON, an object with @@ -72,36 +182,35 @@ - - + + - + - + - - + + - + - - - + + - + - + @@ -109,35 +218,24 @@ - - + + - - + - Used inside a field definition, designates - a flag to be used as a label (key) to be used for the field value in the JSON on - the field being defined. When a flag-name is provided, indicates that the value of the field - is to be labeled in the JSON with the value of the flag. + Used inside a field definition, designates a name (key) for the property in JSON containing the field's value. Use of a 'json-value-key' is mutually exclusive with a 'json-value-key-flag'. - - + + + - Used inside a field definition, designates - a flag to be used as a label (key) to be used for the field value in the JSON on - the field being defined. When a flag-name is provided, indicates that the value of the field - is to be labeled in the JSON with the value of the flag. + Used inside a field definition, designates a flag whose value is to be used as the name (key) for the property in JSON containing the field's value. Use of a 'json-value-key-flag' is mutally exclusive with a 'json-value-key'. - - - - + + @@ -147,24 +245,22 @@ - - + + - - + + - - + + - - + + - @@ -176,17 +272,16 @@ - + - - + + - + - @@ -197,24 +292,23 @@ - - + + - + - + - - + + - + - @@ -226,23 +320,23 @@ - - + + - + - + - - + + - + - + A field with assigned datatype 'markup-multiline' may be designated for representation with or without a containing (wrapper) element @@ -250,7 +344,6 @@ - @@ -260,144 +353,128 @@ - - + + - + - + - - + A formal name for the data construct, to be presented in documentation. It is permissible for a formal name to provide nothing but an expanson of what is already given by a tag (for example, this element could have formal name "Formal name") but it should at the very least confirm the intended semantics for the user, not confuse them. - - - - - The XML namespace governing the names of elements in XML documents, which - expect to be conformant to the schemas expressed by this metaschema. By using this - namespace, documents and document fragments used in mixed-format environments may be - distinguished from neighbor XML formats using other namespaces. NB this is only for the - convenience of XML users; this value is not reflected in OSCAL JSON, and OSCAL applications - should not rely on namespaces alone to disambiguate or resolve semantics. - - + + - + The JSON Base URI is nominal base URI assigned to a JSON Schema instance expressing the model defined by this metaschema. - + + - + A short description of the data construct, to be inserted into documentation. Unlike 'formal-name' this should not simply repeat what is readily discernible from a tag (element name or JSON label), but say a little more about it. - + + + + - + Any explanatory or helpful information to be provided in the - documentation of an assembly, field or flag. - - - - - - - Mark as 'XML' for XML-only or 'JSON' for JSON-only remarks. - - - - - - - - - - The name of the information model to be represented by derived schemas. + documentation of an assembly, field or flag. - + + + + + Mark as 'XML' for XML-only or 'JSON' for JSON-only remarks. + + + + + + The remark applies to only XML representations. + + + + + The remark applies to only JSON and YAML representations. + + + + + + + + - + - The version of the information model to be represented by derived schemas. + A version string used to distinguish between multiple revisions of the same resource. - + + - + A short (code) name to be used for the metaschema, for example as a constituent of names assigned to derived artifacts such as schemas and conversion utilities. - - - - - To import a set of declarations from an out-of-line schema, supporting reuse of common information structures. - - - - - A relative or absolute URI for retrieving an out-of-line metaschema module. - - - - + + - + Referencing an assembly definition to include an assembly or assemblies of a given type in a model. - - - - - - - - - - - - + + + + + + + + + + - + Referencing a field definition to include a field or fields of a given type in a model. - - - - - - - - - - - A field with assigned datatype 'markup-multiline' may be designated for representation with or without a containing (wrapper) element - in XML. - - - - - - + + + + + + + + + + + A field with assigned datatype 'markup-multiline' may be designated for representation with or without a containing (wrapper) element + in XML. + + + + - + Any paragraph or block contents of a markup-multiline field will be represented with a containing (wrapper) element in the XML. @@ -412,7 +489,7 @@ - + Minimum occurrence of assemblies or fields within a valid model. The default value is 0, for an optional occurrence. @@ -425,9 +502,9 @@ - + - + @@ -436,21 +513,20 @@ - - + - + - + - + A violation of the constraint represents a serious fault in the content @@ -485,35 +561,58 @@ - + - + The given enumerated value or values are inclusive of other values ('yes') or not ('no', the default) + + + Determines if the given enumerated value or values within a namespace may be extended by other allowed value constraints. + + - + + + + + Can be extended by constraints within the same model. + + + + + Can be extended by external constraints. + + + + + Cannot be extended. + + + + + + An enumerated value for a flag or field. The value is indicated by the 'value' attribute while the element contents describe the intended semantics for documentation. - - - - - - A value recognized for a flag or field. - - - - - - - + + + + + A value recognized for a flag or field. + + + + + + @@ -521,30 +620,26 @@ - - - - - - - - - - - - + + + + + + + + + + A regex subset that is conformant to both https://www.w3.org/TR/xmlschema11-2/#regexes and https://www.ecma-international.org/ecma-262/11.0/index.html#sec-patterns. - + - - - + @@ -622,9 +717,8 @@ Checks that the specified test returns true in this evaluation context. - - + @@ -662,7 +756,7 @@ - + @@ -724,7 +818,7 @@ - + Specifies the name of the index, a reference to an index, or the name of a uniqueness constraint. @@ -760,7 +854,7 @@ Specifies the value objects to be included in the index constraint, or the object that contains a reference to an item in an index. If the value is ".", then the key is targeting the current metaschema object. - + Specifies the name of the index, a reference to an index, or the name of a uniqueness constraint. @@ -773,7 +867,7 @@ - + @@ -838,14 +932,14 @@ used. - + Minimum occurrence of assemblies or fields within the set of objects identified by the target. This value cannot be less than the corresponding value defined on the target. - + Maximum occurrence of assemblies or fields within the set of objects identified by the target. This value must be less than the corresponding @@ -881,7 +975,7 @@ - + @@ -891,78 +985,69 @@ - + - - + Within a model, indicates that only one of a set of fields or assemblies, referenced in the choice, may occur in valid instances. - - - - - - - - - + + + + + + + - + Within a model, a foreign element may be permitted here.. - + - - - - - - - - - - - - - + + + + + + + + + + + - + In the XML, produces an attribute with the given name, whose value is used as a key value (aka object property name) in the JSON, enabling objects to be 'lifted' out of arrays when such values are distinct. Implies that siblings will never share values. Overloading with datatype 'ID' and naming the key 'id' is legitimate and useful. Even without ID validation, uniqueness of these values among siblings is validable. - - - - - + + + - + When a given referenced field or assembly must be wrapped in an outer grouping, these settings apply, including a name for the group, and how to express the grouping in the respective formats. Not necessary when a field or assembly has max-occurs='1' - - - - - - How to represent a grouping in JSON - - - - - Whether to represent a grouping explicitly in XML - - - - + + + + + How to represent a grouping in JSON + + + + + Whether to represent a grouping explicitly in XML + + + - + Always use an array @@ -981,7 +1066,7 @@ - + Use a wrapper element @@ -996,44 +1081,49 @@ - + + - - - A string with no leading or trailing whitespace. - - - - - - - - - - - - - + + - - + + + + + + + + + + + + A string with no leading or trailing whitespace. + + - + + + + + + + + - + @@ -1043,15 +1133,15 @@ - - + + - + This definition is only available in the context of the current metaschema. @@ -1064,10 +1154,4 @@ - - - - - - diff --git a/support/json/json-schema.json b/support/json/json-schema.json new file mode 100644 index 000000000..fb92c7f75 --- /dev/null +++ b/support/json/json-schema.json @@ -0,0 +1,172 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true +} diff --git a/support/oxygen/frameworks/metaschema/metaschema.framework b/support/oxygen/frameworks/metaschema/metaschema.framework index bb9d5a1e0..c7f44a908 100644 --- a/support/oxygen/frameworks/metaschema/metaschema.framework +++ b/support/oxygen/frameworks/metaschema/metaschema.framework @@ -20,7 +20,7 @@ 2 - ${framework}/../../../../toolchains/xslt-M4/validate/metaschema.xsd + ${framework}/../../../../schema/xml/metaschema.xsd @@ -786,7 +786,7 @@ 2 - ${framework}/../../../../toolchains/xslt-M4/validate/metaschema.xsd + ${framework}/../../../../schema/xml/metaschema.xsd diff --git a/test-suite/docs-models/models_metaschema.xml b/test-suite/docs-models/models_metaschema.xml index fff9075b5..755650f0f 100644 --- a/test-suite/docs-models/models_metaschema.xml +++ b/test-suite/docs-models/models_metaschema.xml @@ -1,13 +1,11 @@ - + - + NIST Metaschema Everything 1.0 test-model - http://csrc.nist.gov/metaschema/ns/everything + http://csrc.nist.gov/ns/metaschema/everything http://csrc.nist.gov/metaschema/ns/everything @@ -142,7 +140,7 @@ - + Lexically constrainted field field field-base64 @@ -180,7 +178,7 @@ Keyed field field field-by-key - + @@ -194,7 +192,7 @@ Dynamic value key field field field-dynamic-value-key - + COLOR @@ -311,7 +309,7 @@ Keyed assembly assembly assembly-by-key - + diff --git a/test-suite/docs-models/shadow-imported_metaschema.xml b/test-suite/docs-models/shadow-imported_metaschema.xml deleted file mode 100644 index 7aeeebd49..000000000 --- a/test-suite/docs-models/shadow-imported_metaschema.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Imported Metaschema - 1.0 - imported - http://csrc.nist.gov/ns/oscal/1.0 - - - Assembly that includes global and local flags - This assembly references a global flag that is shadowed by a global flag defined in the importing metaschema. - - -

This reference should be to the globally scoped flag "global-flag" from the imported metaschema.

-
-
-
- - - Global Flag - Imported Metaschema - A flag from the importing metaschema. It's scope is global and it's shadowed by the definition with the same name in the importing metaschema. - -
\ No newline at end of file diff --git a/test-suite/docs-models/shadow-importing_metaschema.xml b/test-suite/docs-models/shadow-importing_metaschema.xml deleted file mode 100644 index bbf11845d..000000000 --- a/test-suite/docs-models/shadow-importing_metaschema.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - Importing Metaschema - 1.0 - importing - http://csrc.nist.gov/ns/oscal/1.0 - - - - - Assembly that global flags - This assembly references a global flag that shadows a global flag defined in an imported metaschema. - including-flags - - -

This reference should be to the globally scoped flag "global-flag" from the importing metaschema. This definition is taking precedence over the other definition imported (with the same name).

-
-
- - - -

This is the imported "imported-flags" assembly.

-
-
-
-
- - - Global Flag - Importing Metaschema - A flag from the importing metaschema. It's scope is global. This should be marked as a shadowing of another imported flag. - -
\ No newline at end of file diff --git a/test-suite/metaschema-xspec/.gitignore b/test-suite/metaschema-xspec/.gitignore new file mode 100644 index 000000000..307f5d2c8 --- /dev/null +++ b/test-suite/metaschema-xspec/.gitignore @@ -0,0 +1,6 @@ + +# test run outputs +current/ + +# XSpec outputs +*-result.html diff --git a/test-suite/metaschema-xspec/composition/expected/jsonnaming_metaschema-composed.xml b/test-suite/metaschema-xspec/composition/expected/jsonnaming_metaschema-composed.xml new file mode 100644 index 000000000..c40d1fca1 --- /dev/null +++ b/test-suite/metaschema-xspec/composition/expected/jsonnaming_metaschema-composed.xml @@ -0,0 +1,202 @@ + + + Seeing assembly#jsonnaming:box, assembly#jsonnaming:envelope, field#jsonnaming:page, flag#jsonnaming:no, field#jsonnaming:button, flag#jsonnaming:color, field#jsonnaming:scrap + JSON Naming Tests + 1.0 + jsonnaming + http://csrc.nist.gov/metaschema/ns/nested + http://csrc.nist.gov/metaschema/ns/nested + +

Exercises features wrt naming JSON properties on fields static value key assignment dynamic value key assignment

+
+ + PAGE + PAGE + + + + Number + A number, not a negation. + + + Color + A color or pattern. + + + BUTTON + BUTTON + + + + SCRAP + SCRAPS + stuff + + + Fabric + Scrap of what + + + + ENVELOPE + ENVELOPE + + + + + + + + + + + + + + BOX + BOX + BOX + + + + + + +
diff --git a/test-suite/metaschema-xspec/composition/expected/nestedmessy_metaschema-composed.xml b/test-suite/metaschema-xspec/composition/expected/nestedmessy_metaschema-composed.xml index 5453287a2..75c1cbb1b 100644 --- a/test-suite/metaschema-xspec/composition/expected/nestedmessy_metaschema-composed.xml +++ b/test-suite/metaschema-xspec/composition/expected/nestedmessy_metaschema-composed.xml @@ -1,7 +1,8 @@ + + _base-uri="file:/C:/Users/wap1/Documents/usnistgov/metaschema/test-suite/metaschema-xspec/composition/input/nestedmessy_metaschema.xml"> Seeing assembly#nestedmessy:box, assembly#nestedmessy:envelope, field#nestedmessy:page, flag#nestedmessy:no, assembly#nestedmessy:folder Nested Reference Test 1.0 @@ -19,7 +20,7 @@ scope="global" name="page" module="nestedmessy" - _base-uri="..." + _base-uri="file:/C:/Users/wap1/Documents/usnistgov/metaschema/test-suite/metaschema-xspec/composition/input/nestedmessy_metaschema.xml" _key-name="nestedmessy:page"> PAGE PAGE @@ -41,30 +42,36 @@ scope="global" name="no" module="nestedmessy" - _base-uri="..." - _key-name="nestedmessy:no"/> + _base-uri="file:/C:/Users/wap1/Documents/usnistgov/metaschema/test-suite/metaschema-xspec/composition/input/nestedmessy_metaschema.xml" + _key-name="nestedmessy:no"> + Number + A number, not a negation. +
REMOVING unused field definition for 'unused-field' from nestedmessy. ENVELOPE ENVELOPE + _in-json-name="pages"> + + BOX @@ -80,27 +87,33 @@ BOX + _in-json-name="envelopes"> + + + _in-json-name="folders"> + + FOLDER FOLDER + _in-json-name="envelopes"> + + + _in-json-name="folders"> + + + _in-json-name="pages"> + +
diff --git a/test-suite/metaschema-xspec/composition/input/jsonnaming_metaschema.xml b/test-suite/metaschema-xspec/composition/input/jsonnaming_metaschema.xml new file mode 100644 index 000000000..e23e967eb --- /dev/null +++ b/test-suite/metaschema-xspec/composition/input/jsonnaming_metaschema.xml @@ -0,0 +1,78 @@ + + + + + JSON Naming Tests + 1.0 + jsonnaming + http://csrc.nist.gov/metaschema/ns/nested + http://csrc.nist.gov/metaschema/ns/nested + + +

Exercises features wrt naming JSON properties on fields + static value key assignment + dynamic value key assignment

+
+ + + PAGE + PAGE + + + + + Number + A number, not a negation. + + + + Color + A color or pattern. + + + + BUTTON + BUTTON + + + + + SCRAP + SCRAPS + + stuff + + + Fabric + Scrap of what + + + + + ENVELOPE + ENVELOPE + + + + + + + + + + + + + + + BOX + BOX + BOX + + + + + + + +
diff --git a/test-suite/metaschema-xspec/composition/input/nestedmessy_metaschema.xml b/test-suite/metaschema-xspec/composition/input/nestedmessy_metaschema.xml index bb4122a60..161852435 100644 --- a/test-suite/metaschema-xspec/composition/input/nestedmessy_metaschema.xml +++ b/test-suite/metaschema-xspec/composition/input/nestedmessy_metaschema.xml @@ -26,7 +26,10 @@ - + + Number + A number, not a negation. + Unused field @@ -37,7 +40,9 @@ ENVELOPE ENVELOPE - + + + @@ -47,8 +52,12 @@ BOX BOX - - + + + + + + @@ -56,9 +65,14 @@ FOLDER FOLDER - - - + + + + + + + +
diff --git a/test-suite/metaschema-xspec/composition/input/pruning001.xml b/test-suite/metaschema-xspec/composition/input/pruning001.xml index f70fe0014..06647e13b 100644 --- a/test-suite/metaschema-xspec/composition/input/pruning001.xml +++ b/test-suite/metaschema-xspec/composition/input/pruning001.xml @@ -1,6 +1,11 @@ + Prune Test Metaschema + 0.1 + pruning001 + http://csrc.nist.gov/ns/oscal/metaschema/ + http://csrc.nist.gov/ns/oscal/metaschema/ BOX Just a box, no relationship to anything else. diff --git a/test-suite/metaschema-xspec/composition/input/pruning002.xml b/test-suite/metaschema-xspec/composition/input/pruning002.xml index 4139800cd..f3d46b67c 100644 --- a/test-suite/metaschema-xspec/composition/input/pruning002.xml +++ b/test-suite/metaschema-xspec/composition/input/pruning002.xml @@ -1,6 +1,12 @@ + Prune Test Metaschema + 0.1 + pruning002 + http://csrc.nist.gov/ns/oscal/metaschema/ + http://csrc.nist.gov/ns/oscal/metaschema/ + BOX Just a box, no relationship to anything else. diff --git a/test-suite/metaschema-xspec/composition/input/pruning003.xml b/test-suite/metaschema-xspec/composition/input/pruning003.xml index ead94eedf..21ff37c79 100644 --- a/test-suite/metaschema-xspec/composition/input/pruning003.xml +++ b/test-suite/metaschema-xspec/composition/input/pruning003.xml @@ -1,6 +1,12 @@ + Prune Test Metaschema + 0.1 + pruning003 + http://csrc.nist.gov/ns/oscal/metaschema/ + http://csrc.nist.gov/ns/oscal/metaschema/ + BOX Just a box, no relationship to anything else. diff --git a/test-suite/metaschema-xspec/composition/input/pruning004.xml b/test-suite/metaschema-xspec/composition/input/pruning004.xml new file mode 100644 index 000000000..66e3a95e6 --- /dev/null +++ b/test-suite/metaschema-xspec/composition/input/pruning004.xml @@ -0,0 +1,30 @@ + + + Prune Test Metaschema + 0.1 + pruning004 + http://csrc.nist.gov/ns/oscal/metaschema/ + http://csrc.nist.gov/ns/oscal/metaschema/ + + + BOX + Just a box, no relationship to anything else. + BOX + + + + + Folder + One or more folders belong in a box. + + + + + + + + Folder + One or more folders belong in a box. + + diff --git a/test-suite/metaschema-xspec/composition/metaschema-composition.xspec b/test-suite/metaschema-xspec/composition/metaschema-composition.xspec index e68f98144..24ea8ec13 100644 --- a/test-suite/metaschema-xspec/composition/metaschema-composition.xspec +++ b/test-suite/metaschema-xspec/composition/metaschema-composition.xspec @@ -17,4 +17,13 @@ test="m:scrub($x:result)" select="m:scrub($ov:expected-output)"/> + + + + + + + diff --git a/test-suite/metaschema-xspec/schematron/included_metaschema.xml b/test-suite/metaschema-xspec/schematron/included_metaschema.xml index 77c6144ed..5c9c802e8 100644 --- a/test-suite/metaschema-xspec/schematron/included_metaschema.xml +++ b/test-suite/metaschema-xspec/schematron/included_metaschema.xml @@ -1,15 +1,12 @@ - - + + Included Metaschema 1.0 included http://csrc.nist.gov/ns/oscal/1.0 http://csrc.nist.gov/ns/oscal/1.0 - Assembly that includes global and local flags This assembly includes a flag defined in this included metaschema module. diff --git a/test-suite/metaschema-xspec/schematron/including_metaschema.xml b/test-suite/metaschema-xspec/schematron/including_metaschema.xml index 954692550..cd393af72 100644 --- a/test-suite/metaschema-xspec/schematron/including_metaschema.xml +++ b/test-suite/metaschema-xspec/schematron/including_metaschema.xml @@ -1,15 +1,13 @@ - - + + Including Metaschema 1.0 including http://csrc.nist.gov/ns/oscal/1.0 http://csrc.nist.gov/ns/oscal/1.0 - + diff --git a/test-suite/metaschema-xspec/schematron/problem01-module_metaschema.xml b/test-suite/metaschema-xspec/schematron/problem01-module_metaschema.xml index 4d484c289..50776f8f1 100644 --- a/test-suite/metaschema-xspec/schematron/problem01-module_metaschema.xml +++ b/test-suite/metaschema-xspec/schematron/problem01-module_metaschema.xml @@ -1,17 +1,13 @@ - + - + OSCAL TEST Format 0.0 oscal-test http://csrc.nist.gov/ns/metaschema/test - http://csrc.nist.gov/ns/oscal/1.0 - + http://csrc.nist.gov/ns/metaschema/test

For exercising Metaschema semantics with respect to modular assembly and composition.

diff --git a/test-suite/metaschema-xspec/schematron/scope-local-imported_metaschema.xml b/test-suite/metaschema-xspec/schematron/scope-local-imported_metaschema.xml index 70caf3b71..6cb3df575 100644 --- a/test-suite/metaschema-xspec/schematron/scope-local-imported_metaschema.xml +++ b/test-suite/metaschema-xspec/schematron/scope-local-imported_metaschema.xml @@ -1,8 +1,6 @@ - - + + Imported Metaschema 1.0 diff --git a/test-suite/metaschema-xspec/schematron/scope-local-importing_metaschema.xml b/test-suite/metaschema-xspec/schematron/scope-local-importing_metaschema.xml index b7d17f819..e31b12072 100644 --- a/test-suite/metaschema-xspec/schematron/scope-local-importing_metaschema.xml +++ b/test-suite/metaschema-xspec/schematron/scope-local-importing_metaschema.xml @@ -1,8 +1,6 @@ - - + + Importing Metaschema 1.0 diff --git a/test-suite/oscal/v1.0.0/examples/computer-build_metaschema.xml b/test-suite/oscal/v1.0.0/examples/computer-build_metaschema.xml deleted file mode 100644 index 41416466d..000000000 --- a/test-suite/oscal/v1.0.0/examples/computer-build_metaschema.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - Computer Build - 1.0 - computer-build - http://csrc.nist.gov/ns/computer-build/1.0 - http://csrc.nist.gov/ns/computer-build/1.0 - - - Computer Build - A description of the components used to build a computer. - - Computer Build Identifier - A unique id for a given build - - - - - - - - - - Computer Component - A description of a component used to build a computer. - - Computer Component Identifier - A unique id for a given component - - - - - - - - - - Component Name - A name of a component used to build a computer. - - - - Description - A description of a component used in a computer build. - - - - Model - The model code of a computer component. - - diff --git a/test-suite/oscal/v1.0.0/oscal_assessment-common_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_assessment-common_metaschema.xml deleted file mode 100644 index a2be9f79e..000000000 --- a/test-suite/oscal/v1.0.0/oscal_assessment-common_metaschema.xml +++ /dev/null @@ -1,1707 +0,0 @@ - - - OSCAL Assessment Layer Format -- Common Modules - 1.0.0 - oscal-assessment-common - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - -

This contains all modules common to the assessment plan, assessment results, and POAM models.

-

The root of the OSCAL Assessment Plan format is assessment-plan.

-

The root of the OSCAL Assessment Results format is assessment-results.

-

The root of the OSCAL Plan of Action and Milestones (POA&M) format is plan-of-action-and-milestones.

-
- - - - - - - Import System Security Plan - Used by the assessment plan and POA&M to import information about the system. - - System Security Plan Reference - >A resolvable URL reference to the system security plan for the system being assessed. - -

The value of the href can be an internet resource, or a local reference using a fragment e.g. #fragment that points to a back-matter resource in the same document.

-

If a local reference using a fragment is used, this will be indicated by a fragment "#" followed by an identifier which references an identified resource in the document's back-matter or another object that is within the scope of the containing OSCAL document.

-

If an internet resource is used, the href value will be an absolute or relative URI pointing to the location of the referenced resource. A relative URI will be resolved relative to the location of the document containing the link.

-
-
- - - - -
- - - - - - Assessment-Specific Control Objective - A local definition of a control objective for this assessment. Uses catalog syntax for control objective and assessment actions. - - -

The specified control-id must be a valid value within the baseline identified by the target system's SSP via the import-profile statement.

-
-
- - - Objective Description - A human-readable description of this control objective. - - - - - - - - - - - - - - - - - - - - - - -
- - Assessment Method - A local definition of a control objective. Uses catalog syntax for control objective and assessment activities. - - Assessment Method Universally Unique Identifier - Uniquely identifies this defined assessment method. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. A UUID should be consistently used for a given assessment method across revisions of the document. - - - - Assessment Method Description - A human-readable description of this assessment method. - - - - - - - - - - - - - - - - - Activity - Identifies an assessment or related process that can be performed. In the assessment plan, this is an intended activity which may be associated with an assessment task. In the assessment results, this an activity that was actually performed as part of an assessment. - - Assessment Activity Universally Unique Identifier - Uniquely identifies this assessment activity. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. A UUID should be consistently used for a given included activity across revisions of the document. - - - - Included Activity Title - The title for this included activity. - - - Included Activity Description - A human-readable description of this included activity. - - - - - - - - - Step - Identifies an individual step in a series of steps related to an activity, such as an assessment test or examination procedure. - - - Step Universally Unique Identifier - Uniquely identifies a step. This UUID may be referenced elsewhere in an OSCAL document when referring to this step. A UUID should be consistently used for a given test step across revisions of the document. - - - - Step Title - The title for this step. - - - Step Description - A human-readable description of this step. - - - - - - - - - -

This can be optionally used to define the set of controls and control objectives that are assessed by this step.

-
-
- - - -

Identifies the roles, and optionally the parties, associated with this step that is part of an assessment activity.

-
-
- -
- - - - -

Since multiple party-uuid entries can be provided, each role-id must be referenced only once.

-
-
-
-
- - related-controls - -

This can be optionally used to define the set of controls and control objectives that are assessed or remediated by this activity.

-
-
- - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
- -
- - - - The assessment method to use. This typically appears on parts with the name "assessment". - - - - The process of holding discussions with individuals or groups of individuals within an organization to once again, facilitate assessor understanding, achieve clarification, or obtain evidence. - The process of reviewing, inspecting, observing, studying, or analyzing one or more assessment objects (i.e., specifications, mechanisms, or activities). - The process of exercising one or more assessment objects (i.e., activities or mechanisms) under specified conditions to compare actual with expected behavior. - - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- - - Task - Represents a scheduled event or milestone, which may be associated with a series of assessment actions. - - Task Universally Unique Identifier - Uniquely identifies this assessment task. - - - Task Type - The type of task. - - - The task represents a planned milestone. - The task represents a specific assessment action to be performed. - - - - - - - Task Title - The title for this task. - - - Task Description - A human-readable description of this task. - - - - - - - - - Event Timing - The timing under which the task is intended to occur. - - - - On Date Condition - The task is intended to occur on the specified date. - - On Date Condition - The task must occur on the specified date. - - - - On Date Range Condition - The task is intended to occur within the specified date range. - - Start Date Condition - The task must occur on or after the specified date. - - - End Date Condition - The task must occur on or before the specified date. - - - - Frequency Condition - The task is intended to occur at the specified frequency. - - Period - The task must occur after the specified period has elapsed. - - - Time Unit - The unit of time for the period. - - - The period is specified in seconds. - The period is specified in minutes. - The period is specified in hours. - The period is specified in days. - The period is specified in calendar months. - The period is specified in calendar years. - - - - - - - - - Task Dependency - Used to indicate that a task is dependent on another task. - - - Task Universally Unique Identifier Reference - References a unique task by UUID. - - - - - - - - - - - Associated Activity - Identifies an individual activity to be performed as part of a task. - - - Activity Universally Unique Identifier Reference - References an activity defined in the list of activities. - - - - - - - - - - - -

Identifies the person or organization responsible for performing a specific role defined by the activity.

-
-
- - subject - - - -
- - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- - subject - - -

The assessment subjects that the activity was performed against.

-
-
- - - -

Identifies the person or organization responsible for performing a specific role related to the task.

-
-
- -
-
- - - - - - - Reviewed Controls and Control Objectives - Identifies the controls being assessed and their control objectives. - - - Control Objective Description - A human-readable description of control objectives. - - - - - - - - - - Assessed Controls - Identifies the controls being assessed. In the assessment plan, these are the planned controls. In the assessment results, these are the actual controls, and reflects any changes from the plan. - - - - Assessed Controls Description - A human-readable description of in-scope controls specified for assessment. - - - - - - - - - - All - A key word to indicate all. - - - include-control - - -

Used to select a control for inclusion by the control's identifier. Specific control statements can be selected by their statement identifier.

-
-
-
- - exclude-control - - -

Used to select a control for exclusion by the control's identifier. Specific control statements can be excluded by their statement identifier.

-
-
- -
- -

The include-all, specifies all control identified in the baseline are included in the scope if this assessment, as specified by the include-profile statement within the linked SSP.

-

Any control specified within exclude-controls must first be within a range of explicitly included controls, via include-controls or include-all.

-
-
- - - Referenced Control Objectives - Identifies the control objectives of the assessment. In the assessment plan, these are the planned objectives. In the assessment results, these are the assessed objectives, and reflects any changes from the plan. - - - - Control Objectives Description - A human-readable description of this collection of control objectives. - - - - - - - - - - All - A key word to indicate all. - - - include-objective - - -

Used to select a control objective for inclusion by the control objective's identifier.

-
-
-
- - exclude-objective - - -

Used to select a control objective for exclusion by the control objective's identifier.

-
-
- -
- -

The include-all field, specifies all control objectives for any in-scope control. In-scope controls are defined in the control-selection.

-

Any control objective specified within exclude-controls must first be within a range of explicitly included control objectives, via include-objectives or include-all.

-
-
- -
- -

In the context of an assessment plan, this construct is used to identify the controls and control objectives that are to be assessed. In the context of an assessment result, this construct is used to identify the actual controls and objectives that were assessed, reflecting any changes from the plan.

-

When resolving the selection of controls and control objectives, the following processing will occur:

-

1. Controls will be resolved by creating a set of controls based on the control-selections by first handling the includes, and then removing any excluded controls.

-

2. The set of control objectives will be resolved from the set of controls that was generated in the previous step. The set of control objectives is based on the control-objective-selection by first handling the includes, and then removing any excluded control objectives.

-
-
- - - Select Control - Used to select a control for inclusion/exclusion based on one or more control identifiers. A set of statement identifiers can be used to target the inclusion/exclusion to only specific control statements providing more granularity over the specific statements that are within the asessment scope. - - - - Include Specific Statements - Used to constrain the selection to only specificity identified statements. - - - - - - - Select Objective - Used to select a control objective for inclusion/exclusion based on the control objective's identifier. - - - - - - Assessment Subject Placeholder - Used when the assessment subjects will be determined as part of one or more other assessment activities. These assessment subjects will be recorded in the assessment results in the assessment log. - - Assessment Subject Placeholder Universally Unique Identifier - Uniquely identifies a set of assessment subjects that will be identified by a task or an activity that is part of a task. - - - - Assessment Subject Placeholder Description - A human-readable description of intent of this assessment subject placeholder. - - - Assessment Subject Source - Assessment subjects will be identified while conducting the referenced activity-instance. - - - Task Universally Unique Identifier - Uniquely identifies an assessment activity to be performed as part of the event. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. A UUID should be consistently used for this schedule across revisions of the document. - - - - - - - - - - - - - - Subject of Assessment - Identifies system elements being assessed, such as components, inventory items, and locations. In the assessment plan, this identifies a planned assessment subject. In the assessment results this is an actual assessment subject, and reflects any changes from the plan. exactly what will be the focus of this assessment. Any subjects not identified in this way are out-of-scope. - - Subject Type - Indicates the type of assessment subject, such as a component, inventory, item, location, or party represented by this selection statement. - - - The referenced assessment subject is a component defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. - The referenced assessment subject is a inventory item defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. - The referenced assessment subject is a location defined in the metadata of the SSP, Assessment Plan, or Assessment Results. - The referenced assessment subject is a person or team to interview, who is defined as a party in the metadata of the SSP, Assessment Plan, or Assessment Results. - The referenced assessment subject is a user defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. - - - - - - Include Subjects Description - A human-readable description of the collection of subjects being included in this assessment. - - - - - - - - - - All - A key word to indicate all. - - - include-subject - - - - - exclude-subject - - - - - -

Processing of an include/exclude pair starts with processing the include, then removing matching entries in the exclude.

-
-
- - - Select Assessment Subject - Identifies a set of assessment subjects to include/exclude by UUID. - - - type - - - - - - - - - - - - - - Subject Universally Unique Identifier Reference - A pointer to a component, inventory-item, location, party, user, or resource using it's UUID. - - - - Subject Universally Unique Identifier Reference Type - Used to indicate the type of object pointed to by the uuid-ref within a subject. - - - Component - Inventory Item - Location - Interview Party - User - Resource or Artifact - - - - - - Identifies the Subject - A pointer to a resource based on its universally unique identifier (UUID). Use type to indicate whether the identified resource is a component, inventory item, location, user, or something else. - - - type - - - - - Subject Reference Title - The title or name for the referenced subject. - - - - - - - - - - -

The subject reference UUID could point to an item defined in the SSP, AP, or AR.

-

Tools should check look for the ID in every file imported directly or indirectly.

-
-
- - - - Assessment Assets - Identifies the assets used to perform this assessment, such as the assessment team, scanning tools, and assumptions. - - - component - - -

Used to add any components for tools used during the assessment. These are represented here to avoid mixing with system components.

-

The technology tools used by the assessor to perform the assessment, such as vulnerability scanners. In the assessment plan these are the intended tools. In the assessment results, these are the actual tools used, including any differences from the assessment plan.

-
-
- - Assessment Platform - Used to represent the toolset used to perform aspects of the assessment. - - - Assessment Platform Universally Unique Identifier - Uniquely identifies this assessment Platform. - - - - Assessment Platform Title - The title or name for the assessment platform. - - - - - - - - - Uses Component - The set of components that are used by the assessment platform. - - - Component Universally Unique Identifier Reference - A reference to a component that is implemented as part of an inventory item. - - - - - - - - - - - - - - - - - -

Since responsible-party associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- -
-
-
- - - - -

Since multiple assessment component entries can be provided, each component must have a unique uuid.

-
-
-
-
- - - - Objective Status - Captures an assessor's conclusions regarding the degree to which an objective is satisfied. - - Finding Target Type - Identifies the type of the target. - - - A reference to a control statement identifier within a control. - A reference to a control objective identifier within a control. - - - -

The target will always be a reference to: 1) a control statement, or 2) a control objective. In the former case, there is always a single top-level statement within a control. Thus, if the entire control is targeted, this statement identifier can be used.

-
-
- - Finding Target Identifier Reference - Identifies the specific target qualified by the type. - - - - Objective Status Title - The title for this objective status. - - - Objective Status Description - A human-readable description of the assessor's conclusions regarding the degree to which an objective is satisfied. - - - - - - - - - Objective Status - A determination of if the objective is satisfied or not within a given system. - - Objective Status State - An indication as to whether the objective is satisfied or not. - - - The objective has been completely satisfied. - The objective has not been completely satisfied, but may be partially satisfied. - - - - - Objective Status Reason - The reason the objective was given it's status. - - - The target system or system component satisfied all the conditions. - The target system or system component did not satisfy all the conditions. - Some other event took place that is not a pass or a fail. - - - -

Reason may contain any value, and should be used to communicate additional information regarding the status.

-
-
- - - -
- - -

The implementation-status is used to qualify the status value to indicate the degree to which the control was found to be implemented.

-
-
- -
-
- - - Observation - Describes an individual observation. - - Observation Universally Unique Identifier - Uniquely identifies this observation. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. Once assigned, a UUID should be consistently used for a given observation across revisions. - - - - Observation Title - The title for this observation. - - - Observation Description - A human-readable description of this assessment observation. - - - - - - - - - Observation Method - Identifies how the observation was made. - - - - An inspection was performed. - An interview was performed. - A manual or automated test was performed. - This is only for use when converting historic content to OSCAL, where the conversion process cannot initially identify the appropriate method(s). - - - - - - Observation Type - Identifies the nature of the observation. More than one may be used to further qualify and enable filtering. - - - - A difference between the SSP implementation statement, and actual implementation. - An observation about the status of a the associated control objective. - A mitigating factor was identified. - An assessment finding. Used for observations made by tools, penetration testing, and other means. - An observation from a past assessment, which was converted to OSCAL at a later date. - - - - - - -

Used to identify the individual and/or tool that gathered the evidence resulting in the observation identification.

-
-
- - subject - - -

Identifies who was interviewed, or what was tested or inspected.

-
-
- - - Relevant Evidence - Links this observation to relevant evidence. - - - Relevant Evidence Reference - >A resolvable URL reference to relevant evidence. - -

The value of the href can be an internet resource, or a local reference using a fragment e.g. #fragment that points to a back-matter resource in the same document.

-

If a local reference using a fragment is used, this will be indicated by a fragment "#" followed by an identifier which references an identified resource in the document's back-matter or another object that is within the scope of the containing OSCAL document.

-

If an internet resource is used, the href value will be an absolute or relative URI pointing to the location of the referenced resource. A relative URI will be resolved relative to the location of the document containing the link.

-
-
- - - Relevant Evidence Description - A human-readable description of this evidence. - - - - - - - - - -
- - collected field - Date/time stamp identifying when the finding information was collected. - - - expires field - Date/time identifying when the finding information is out-of-date and no longer valid. Typically used with continuous assessment scenarios. - - -
- - - -
- - - Origin - Identifies the source of the finding, such as a tool, interviewed person, or activity. - - - actor - - - - - - - - - - Originating Actor - The actor that produces an observation, a finding, or a risk. One or more actor type can be used to specify a person that is using a tool. - - Actor Type - The kind of actor. - - - A reference to a tool component defined with the assessment assets. - A reference to an assessment-platform defined with the assessment assets. - A reference to a party defined within the document metadata. - - - - - Actor Universally Unique Identifier Reference - A pointer to the tool or person based on the associated type. - - - Actor Role - For a party, this can optionally be used to specify the role the actor was performing. - - - - - - - - - - - - - Task Reference - Identifies an individual task for which the containing object is a consequence of. - - Task Universally Unique Identifier Reference - References a unique task by UUID. - - - - - - - - - - - -

Identifies the person or organization responsible for performing a specific role defined by the activity.

-
-
- - subject - - -

The assessment subjects that the task was performed against.

-
-
- - Identified Subject - Used to detail assessment subjects that were identfied by this task. - - - Assessment Subject Placeholder Universally Unique Identifier Reference - References a unique assessment subject placeholder defined by this task. - - - - subject - - -

The assessment subjects that the task identified, which will be used by another task through a subject-placeholder reference. Such a task will "consume" these subjects.

-
-
-
-
- -
- - - - -

Since responsible-party associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- - - - Threat ID - A pointer, by ID, to an externally-defined threat. - id - - Threat Type Identification System - Specifies the source of the threat information. - - - The value conforms to FedRAMP definitions. - - - - - Threat Information Resource Reference - An optional location for the threat data, from which this ID originates. - - - - - Identified Risk - An identified risk. - - Risk Universally Unique Identifier - Uniquely identifies this risk. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. Once assigned, a UUID should be consistently used for a given risk across revisions. - - - - Risk Title - The title for this risk. - - - Risk Description - A human-readable summary of the identified risk, to include a statement of how the risk impacts the system. - - - - - Risk Statement - An summary of impact for how the risk affects the system. - - - - - - - - - Status - Describes the status of the associated risk. - - - The risk has been identified. - The identified risk is being investigated. (Open risk) - Remediation activities are underway, but are not yet complete. (Open risk) - A risk deviation, such as false positive, risk reduction, or operational requirement has been submitted for approval. (Open risk) - A risk deviation, such as false positive, risk reduction, or operational requirement has been approved. (Open risk) - The risk has been resolved. - - - - - - -

Used to identify the individual and/or tool that identified this risk.

-
-
- - - - - - - - - - Mitigating Factor - Describes an existing mitigating factor that may affect the overall determination of the risk, with an optional link to an implementation statement in the SSP. - - - Mitigating Factor Universally Unique Identifier - Uniquely identifies this mitigating factor. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. Once assigned, a UUID should be consistently used for a given mitigating factor across revisions. - - - Implementation UUID - Points to an implementation statement in the SSP. - - - - Mitigating Factor Description - A human-readable description of this mitigating factor. - - - - - - - - - subject - - -

Links identifiable elements of the system to this mitigating factor, such as an inventory-item or component.

-
-
-
-
- - - Risk Resolution Deadline - The date/time by which the risk must be resolved. - - - - - - - Risk Log - A log of all risk-related tasks taken. - - - Risk Log Entry - Identifies an individual risk response that occurred as part of managing an identified risk. - - - Risk Log Entry Universally Unique Identifier - Uniquely identifies a risk log entry. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. A UUID should be consistently used for this schedule across revisions of the document. - - - - Title - The title for this risk log entry. - - - Risk Task Description - A human-readable description of what was done regarding the risk. - - - Start - Identifies the start date and time of the event. - - - End - Identifies the end date and time of the event. If the event is a point in time, the start and end will be the same date and time. - - - - - - - - - - - - status-change - -

Identifies a change in risk status made resulting from the task described by this risk log entry. This allows the risk's status history to be captured as a sequence of risk log entries.

-
-
- - Risk Response Reference - Identifies an individual risk response that this log entry is for. - - - Response Universally Unique Identifier Reference - References a unique risk response by UUID. - - - - - - - - - - - -

This is used to identify the task(s) that this log entry was generated for.

-
-
- -
-
- -
- - - The type of remediation tracking entry. Can be multi-valued. - - - Contacted vendor to determine the status of a pending fix to a known vulnerability. - Information related to the current state of response to this risk. - A significant step in the response plan has been achieved. - An activity was completed that reduces the likelihood or impact of this risk. - An activity was completed that eliminates the likelihood or impact of this risk. - - The risk is no longer applicable to the system. - A deviation request was made to the authorizing official. - A previously submitted deviation request has been modified. - The authorizing official approved the deviation. - The authorizing official rejected the deviation. - - -
-
-
- - - Related Observation - Relates the finding to a set of referenced observations that were used to determine the finding. - - - Observation Universally Unique Identifier Reference - References an observation defined in the list of observations. - - -
- - - The risk has been confirmed to be a false positive. - The risk has been accepted. No further action will be taken. - The risk has been adjusted. - A numeric value indicating the sequence in which risks should be addressed. (Lower numbers are higher priority) - - - -
- - - Logged By - Used to indicate who created a log entry in what role. - - Party UUID Reference - A pointer to the party who is making the log entry. - - - Actor Role - A point to the role-id of the role in which the party is making the log entry. - - - - - Risk Status - Describes the status of the associated risk. - - - The risk has been identified. - The identified risk is being investigated. (Open risk) - Remediation activities are underway, but are not yet complete. (Open risk) - A risk deviation, such as false positive, risk reduction, or operational requirement has been submitted for approval. (Open risk) - A risk deviation, such as false positive, risk reduction, or operational requirement has been approved. (Open risk) - The risk has been resolved. - - - - - - Characterization - A collection of descriptive data about the containing object from a specific origin. - - - - - - - - - -

metadata about the specific actor that generated this descriptive data.

-
-
- - Facet - An individual characteristic that is part of a larger set produced by the same actor. - - - Facet Name - The name of the risk metric within the specified system. - - - Naming System - Specifies the naming system under which this risk metric is organized, which allows for the same names to be used in different systems controlled by different parties. This avoids the potential of a name clash. - - - - - The facet is from an unknown taxonomy. The meaning of the name is tool or organization specific. - - - - - - - - - - Facet Value - Indicates the value of the facet. - - - - - - - - - - - - - Indicates if the facet is 'initial' as first identified, or 'adjusted' indicating that the value has be changed after some adjustments have been made (e.g., to identify residual risk). - - - As first identified. - Indicates that residual risk remains after some adjustments have been made. - - - - General likelihood rating. - General impact rating. - General risk rating. - General severity rating. - - - Likelihood as defined by FedRAMP. The class can be used to specify 'initial' and 'adjusted' risk states. - Impact as defined by FedRAMP. The class can be used to specify 'initial' and 'adjusted' risk states. - Risk as calculated according to FedRAMP. The class can be used to specify 'initial' and 'adjusted' risk states. - - - An identifier managed by the CVE program (see https://cve.mitre.org/). - - - Base: Access Vector - Base: Access Complexity - Base: Authentication - Base: Confidentiality Impact - Base: Integrity Impact - Base: Availability Impact - Temporal: Exploitability - Temporal: Remediation Level - Temporal: Report Confidence - Environmental: Collateral Damage Potential - Environmental: Target Distribution - Environmental: Confidentiality Requirement - Environmental: Integrity Requirement - Environmental: Availability Requirement - - - Local - Network Adjacent - Network - - - High - Medium - Low - - - Multiple - Single - None - - - None - Partial - Complete - - - Unproven - Proof-of-Concept - Functional - High - Not Defined - - - Official Fix - Temporary Fix - Workaround - Unavailable - Not Defined - - - Unconfirmed - Uncorroborated - Confirmed - Not Defined - - - None - Low (light loss) - Low Medium - Medium High - High (catastrophic loss) - Not Defined - - - - - - - - - - - Base: Attack Vector - Base: Attack Complexity - Base: Privileges Required - Base: User Interaction - Base: Scope - Base: Confidentiality Impact - Base: Integrity Impact - Base: Availability Impact - Temporal: Exploit Code Maturity - Temporal: Remediation Level - Temporal: Report Confidence - Environmental: Modified Attack Vector - Environmental: Modified Attack Complexity - Environmental: Modified Privileges Required - Environmental: Modified User Interaction - Environmental: Modified Scope - Environmental: Modified Confidentiality - Environmental: Modified Integrity - Environmental: Modified Availability - Environmental: Confidentiality Requirement Modifier - Environmental: Integrity Requirement Modifier - Environmental: Availability Requirement Modifier - - - Network - Adjacent - Local - Physical - - - High - Low - - - None - Low - High - - - None - Required - - - Unchanged - Changed - - - Not Defined - Unproven - Proof-of-Concept - Functional - High - - - Not Defined - Official Fix - Temporary Fix - Workaround - Unavailable - - - Not Defined - Unknown - Reasonable - Confirmed - - - Not Defined - Low - Medium - High - - - Not Defined - Network - Adjacent - Local - Physical - - - Not Defined - High - Low - - - Not Defined - None - Low - High - - - Not Defined - None - Required - - - Not Defined - Unchanged - Changed - - - -
-
- - - Risk Response - Describes either recommended or an actual plan for addressing the risk. - - Remediation Universally Unique Identifier - Uniquely identifies this remediation. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. Once assigned, a UUID should be consistently used for a given remediation across revisions. - - - Remediation Intent - Identifies whether this is a recommendation, such as from an assessor or tool, or an actual plan accepted by the system owner. - - - Recommended Remediation - The actions intended to resolve the risk. - This remediation activities were performed to address the risk. - - - - - - Response Title - The title for this response activity. - - - Response Description - A human-readable description of this response plan. - - - - - - - - - - -

Used to identify the individual and/or tool that generated this recommended or planned response.

-
-
- - - - Required Asset - Identifies an asset required to achieve remediation. - - - Required Universally Unique Identifier - Uniquely identifies this required asset. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. Once assigned, a UUID should be consistently used for a given required asset across revisions. - - - - subject - - -

Identifies an asset associated with this requirement, such as a party, system component, or inventory-item.

-
-
- - Title for Required Asset - The title for this required asset. - - - Description of Required Asset - A human-readable description of this required asset. - - - - - - - - -
- - - The UUID of the person or organization who made the recommendation - The UUID of the tool that made the recommendation - - -
- - - - -
- - - - - - The risk will be eliminated. - The risk will be reduced. - The risk will be transferred to another organization or entity. - The risk will continue to exist without further efforts to address it. (Sometimes referred to as "Operationally required") - The risk will be partially transferred to another organization or entity. - Plans will be made to address the risk impact if the risk occurs. (This is a form of mitigation.) - No response, such as when the identified risk is found to be a false positive. - - -
- - - - Objective ID - Points to an assessment objective. - - - - - Assessment Part - A partition of an assessment plan or results or a child of another part. - part - - - Part Identifier - A unique identifier for a specific part instance. This identifier's uniqueness is document scoped and is intended to be consistent for the same part across minor revisions of the document. - - - Part Name - A textual label that uniquely identifies the part's semantic type. - - - - An assessment asset. - An assessment method. - Describes a set of control objectives. - - - - - - Part Namespace - A namespace qualifying the part's name. This allows different organizations to associate distinct semantics with the same name. - -

Provides a means to segment the value space for the name, so that different organizations and individuals can assert control over the allowed names and associated text used in a part. This allows the semantics associated with a given name to be defined on an organization-by-organization basis.

-

An organization MUST use a URI that they have control over. e.g., a domain registered to the organization in a URI, a registered uniform resource names (URN) namespace.

-

When a ns is not provided, its value should be assumed to be http://csrc.nist.gov/ns/oscal and the name should be a name defined by the associated OSCAL model.

-
-
- - Part Class - A textual label that provides a sub-type or characterization of the part's name. This can be used to further distinguish or discriminate between the semantics of multiple parts of the same control with the same name and ns. - -

A class can be used in validation rules to express extra constraints over named items of a specific class value.

-

A class can also be used in an OSCAL profile as a means to target an alteration to control content.

-
-
- - - Part Title - A name given to the part, which may be used by a tool for display and navigation. - - - - - - - Part Text - Permits multiple paragraphs, lists, tables etc. - - - - - - - - - - - - - The assessment method to use. This typically appears on parts with the name "assessment". - - - - The process of holding discussions with individuals or groups of individuals within an organization to once again, facilitate assessor understanding, achieve clarification, or obtain evidence. - The process of reviewing, inspecting, observing, studying, or analyzing one or more assessment objects (i.e., specifications, mechanisms, or activities). - The process of exercising one or more assessment objects (i.e., activities or mechanisms) under specified conditions to compare actual with expected behavior. - - - - -

A part provides for logical partitioning of prose, and can be thought of as a grouping structure (e.g., section). A part can have child parts allowing for arbitrary nesting of prose content (e.g., statement hierarchy). A part can contain prop objects that allow for enriching prose text with structured name/value information.

-

A part can be assigned an optional id, which allows for internal and external references to the textual concept contained within a part. A id provides a means for an OSCAL profile, or a higher layer OSCAL model to reference a specific part within a catalog. For example, an id can be used to reference or to make modifications to a control statement in a profile.

-

Use of part and prop provides for a wide degree of extensibility within the OSCAL catalog model. The optional ns provides a means to qualify a part's name, allowing for organization-specific vocabularies to be defined with clear semantics. Any organization that extends OSCAL in this way should consistently assign a ns value that represents the organization, making a given namespace qualified name unique to that organization. This allows the combination of ns and name to always be unique and unambiguous, even when mixed with extensions from other organizations. Each organization is responsible for governance of their own extensions, and is strongly encouraged to publish their extensions as standards to their user community. If no ns is provided, the name is expected to be in the "OSCAL" namespace.

-

To ensure a ns is unique to an organization and naming conflicts are avoided, a URI containing a DNS or other globally defined organization name should be used. For example, if FedRAMP and DoD both extend OSCAL, FedRAMP will use the ns "https://fedramp.gov", while DoD will use the ns "https://defense.gov" for any organization specific name.

-

Tools that process OSCAL content are not required to interpret unrecognized OSCAL extensions; however, OSCAL compliant tools should not modify or remove unrecognized extensions, unless there is a compelling reason to do so, such as data sensitivity.

-
-
- -
diff --git a/test-suite/oscal/v1.0.0/oscal_assessment-plan_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_assessment-plan_metaschema.xml deleted file mode 100644 index 13a5ff80b..000000000 --- a/test-suite/oscal/v1.0.0/oscal_assessment-plan_metaschema.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - OSCAL Assessment Plan Model - 1.0.0 - oscal-ap - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - -

The OSCAL assessment plan format is used to describe the information typically provided by an assessor during the preparation for an assessment.

-

The root of the OSCAL assessment plan format is assessment-plan. -

-
- - - - - - Security Assessment Plan (SAP) - An assessment plan, such as those provided by a FedRAMP assessor. - assessment-plan - - Assessment Plan Universally Unique Identifier - Uniquely identifies this assessment plan. This UUID must be changed each time the content of the plan changes. - - - - - -

Used by the SAP to import information about the system being assessed.

-
-
- - - Local Definitions - Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP. - - - component - - -

Used to add any components, not defined via the System Security Plan (AR->AP->SSP)

-
-
- - - -

Used to add any inventory-items, not defined via the System Security Plan (AR->AP->SSP)

-
-
- - user - - -

Used to add any users, not defined via the System Security Plan (AR->AP->SSP)

-
-
- - - objectives-and-methods - - - - - - - - -
- - - - -

Since multiple component entries can be provided, each component must have a unique uuid.

-
-
- - - -

A given uuid must be assigned only once to a user.

-
-
-
-
- - Assessment Plan Terms and Conditions - Used to define various terms and conditions under which an assessment, described by the plan, can be performed. Each child part defines a different type of term or condition. - - - - - - - - Defines the circumstances, conditions, degree, and manner in which the use of cyber-attack techniques or actions may be applied to the assessment. - Any information the assessor should make known to the system owner or authorizing official. Has child 'item' parts for each individual disclosure. - Defines any assessment activities which the system owner or authorizing official wishes to ensure are performed as part of the assessment. - Defines any assessment activities which the system owner or authorizing official explicitly prohibits from being performed as part of the assessment. - Defines conditions related to the delivery of the assessment results, such as when to deliver, how, and to whom. - Defines any supposition made by the assessor. Has child 'item' parts for each assumption. - An explanation of practices, procedures, and rules used in the course of the assessment. - - - - - - - - - - - - - - - - - - - -
-
- - - - -
diff --git a/test-suite/oscal/v1.0.0/oscal_assessment-results_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_assessment-results_metaschema.xml deleted file mode 100644 index 10fa3cab3..000000000 --- a/test-suite/oscal/v1.0.0/oscal_assessment-results_metaschema.xml +++ /dev/null @@ -1,339 +0,0 @@ - - - - OSCAL Assessment Results Model - 1.0.0 - oscal-ar - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - -

The OSCAL assessment results format is used to describe the information typically provided by an assessor following an assessment.

-

The root of the OSCAL assessment results format is assessment-results. -

-
- - - - - - Security Assessment Results (SAR) - Security assessment results, such as those provided by a FedRAMP assessor in the FedRAMP Security Assessment Report. - assessment-results - - Assessment Results Universally Unique Identifier - Uniquely identifies this assessment results file. This UUID must be changed each time the content of the results changes. - - - - - -

Used by the SAR to import information about the original plan for assessing the system.

-
-
- - - Local Definitions - Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP. - - - objectives-and-methods - - - - - - activity - - - - - - - - result - - - - -
-
- - - - - - - - - - - - - Assessment Result - Used by the assessment results and POA&M. In the assessment results, this identifies all of the assessment observations and findings, initial and residual risks, deviations, and disposition. In the POA&M, this identifies initial and residual risks, deviations, and disposition. - - Results Universally Unique Identifier - Uniquely identifies this set of results. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. Once assigned, a UUID should be consistently used for a given set of results across revisions. - - - - Results Title - The title for this set of results. - - - - Results Description - A human-readable description of this set of test results. - - - - start field - Date/time stamp identifying the start of the evidence collection reflected in these results. - - - end field - Date/time stamp identifying the end of the evidence collection reflected in these results. In a continuous motoring scenario, this may contain the same value as start if appropriate. - - - - - - - - - - - Local Definitions - Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP. - - - component - - -

Used to add any components, not defined via the System Security Plan (AR->AP->SSP)

-
-
- - - -

Used to add any inventory-items, not defined via the System Security Plan (AR->AP->SSP)

-
-
- - user - - -

Used to add any users, not defined via the System Security Plan (AR->AP->SSP)

-
-
- - - - -

This needs to be defined in the results if an assessment platform used is different from the one described in the assessment plan. Else the platform(s) defined in the plan may be referenced within the results.

-
-
- - - assessment-task - - -
- - - - -

Since multiple component entries can be provided, each component must have a unique uuid.

-
-
- - - -

A given uuid must be assigned only once to a user.

-
-
-
-
- - - -

The Assessment Results control-selection ignores any control selection in the Assessment Plan and re-selects controls from the baseline identified by the SSP.

-

The Assessment Results control-objective-selection ignores any control objective selection in the Assessment Plan and re-selects control objectives from the baseline identified by the SSP.

-

Any additional control objectives defined in the Assessment Plan local-definitions do not need to be re-defined in the Assessment Results local-definitions; however, if they were explicitly referenced with an Assessment Plan control-objective-selection, they need to be selected again in the Assessment Results control-objective-selection.

-
-
- - - Attestation Statements - A set of textual statements, typically written by the assessor. - - - - - - - - part - - - - - - - -

Since responsible-party associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- - - Assessment Log - A log of all assessment-related actions taken. - - - Assessment Log Entry - - Identifies the result of an action and/or task that occurred as part of executing an assessment plan or an assessment event that occurred in producing the assessment results. - - - Assessment Log Entry Universally Unique Identifier - Uniquely identifies an assessment event. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. A UUID should be consistently used for this schedule across revisions of the document. - - - - Action Title - The title for this event. - - - - Action Description - A human-readable description of this event. - - - Start - Identifies the start date and time of an event. - - - End - Identifies the end date and time of an event. If the event is a point in time, the start and end will be the same date and time. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - Finding - Describes an individual finding. - - Finding Universally Unique Identifier - Uniquely identifies this finding. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. Once assigned, a UUID should be consistently used for a given finding across revisions. - - - - Finding Title - The title for this finding. - - - - Finding Description - A human-readable description of this finding. - - - - - - - - - - - - -

Used to identify the individual and/or tool generated this finding.

-
-
- - target - - - Implementation Statement UUID - Identifies the implementation statement in the SSP to which this finding is related. - - - - Related Observation - Relates the finding to a set of referenced observations that were used to determine the finding. - - - Observation Universally Unique Identifier Reference - References an observation defined in the list of observations. - - - - - Associated Risk - Relates the finding to a set of referenced risks that were used to determine the finding. - - - Risk Universally Unique Identifier Reference - References an risk defined in the list of risks. - - - -
-
- - - - Import Assessment Plan - Used by assessment-results to import information about the original plan for assessing the system. - - Assessment Plan Reference - >A resolvable URL reference to the assessment plan governing the assessment activities. - -

The value of the href can be an internet resource, or a local reference using a fragment e.g. #fragment that points to a back-matter - resource in the same document.

- -

If a local reference using a fragment is used, this will be indicated by a fragment "#" followed by an identifier which references an identified resource in the document's back-matter or another object that is within the scope of the containing OSCAL document.

-

If an internet resource is used, the href value will be an absolute or relative URI pointing to the location of the referenced resource. A relative URI will be resolved relative to the location of the document containing the link.

-
-
- - - -
- -
diff --git a/test-suite/oscal/v1.0.0/oscal_catalog_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_catalog_metaschema.xml deleted file mode 100644 index c40f33411..000000000 --- a/test-suite/oscal/v1.0.0/oscal_catalog_metaschema.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - - - -]> - - OSCAL Control Catalog Model - 1.0.0 - oscal-catalog - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - -

The OSCAL Control Catalog format can be used to describe a collection of security controls and related control enhancements, along with contextualizing documentation and metadata. The root of the Control Catalog format is catalog. -

-
- - - - Catalog - A collection of controls. - catalog - - Catalog Universally Unique Identifier - A globally unique identifier for this catalog instance. This UUID should be changed when this document is revised. - - - - - - - - - - - - - - - - -

Back matter including references and resources.

-
-
-
- - - - -

Catalogs may use one or more group objects to subdivide the control contents of a catalog.

-

An OSCAL catalog model provides a structured representation of control information.

-
- - A small catalog with a single control - - A Miniature Catalog - - A Single Control - - - -
- - Control Group - A group of controls, or of groups of controls. - - - Group Identifier - A unique identifier for a specific group instance that can be used to reference the group within this and in other OSCAL documents. This identifier's uniqueness is document scoped and is intended to be consistent for the same group across minor revisions of the document. - - - Group Class - A textual label that provides a sub-type or characterization of the group. - -

A class can be used in validation rules to express extra constraints over named items of a specific class value.

-

A class can also be used in an OSCAL profile as a means to target an alteration to control content.

-
-
- - - Group Title - A name given to the group, which may be used by a tool for display and navigation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - &allowed-values-control-group-property-name; - - - -

Catalogs can use a group to collect related controls into a single grouping. That can be useful to group controls into a family or other logical grouping.

-

A group may have its own properties, statements, parameters, and references, which are inherited by all members of that group.

-
- - - My Group - - - Control - - - -
- - Control - A structured information object representing a security or privacy control. Each security or privacy control within the Catalog is defined by a distinct control instance. - - - Control Identifier - A unique identifier for a specific control instance that can be used to reference the control in other OSCAL documents. This identifier's uniqueness is document scoped and is intended to be consistent for the same control across minor revisions of the document. - - - Control Class - A textual label that provides a sub-type or characterization of the control. - -

A class can be used in validation rules to express extra constraints over named items of a specific class value.

-

A class can also be used in an OSCAL profile as a means to target an alteration to control content.

-
-
- - - Control Title - A name given to the control, which may be used by a tool for display and navigation. - - - - - - - - - - - - - - - - - - - - - - - - - &allowed-values-control-group-property-name; - The status of a control. For example, a value of 'withdrawn' can indicate that the control has been withdrawn and should no longer be used. - - - The control is no longer used. - - - The link cites an external resource related to this control. - The link identifies another control with bearing to this control. - The link identifies another control that must be present if this control is present. - The link identifies other control content where this control content is now addressed. - - - -

Controls may be grouped using group, and controls may be partitioned using part or further enhanced (extended) using control.

-

A control must have a part with the name "statement", which represents the textual narrative of the control. This "statement" part must occur only once, but may have nested parts to allow for multiple paragraphs or sections of text.

-
- - - Control 1 - - -
-
diff --git a/test-suite/oscal/v1.0.0/oscal_complete_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_complete_metaschema.xml deleted file mode 100644 index 82989c7ff..000000000 --- a/test-suite/oscal/v1.0.0/oscal_complete_metaschema.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - -]> - - OSCAL Unified Model of Models - 1.0.0 - oscal-complete - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal/1.0 - -

This format represents a combination of all of the OSCAL models.

-
- - - - - - - -
diff --git a/test-suite/oscal/v1.0.0/oscal_component_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_component_metaschema.xml deleted file mode 100644 index ed1880ef2..000000000 --- a/test-suite/oscal/v1.0.0/oscal_component_metaschema.xml +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - - - - - - -]> - - OSCAL Component Definition Model - 1.0.0 - oscal-component-definition - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - -

The OSCAL Component Definition Model can be used to describe the implementation of controls in a component or a set of components grouped as a capability. A component can be either a technical component, or a documentary component. A technical component is a component that is implemented in hardware (physical or virtual) or software. A documentary component is a component implemented in a document, such as a process, procedure, or policy.

-

The root of the OSCAL Implementation Component format is component-definition. -

-

NOTE: This documentation is a work in progress. As a result, documentation for many of the information elements is missing or incomplete.

-
- - - - - Component Definition - A collection of component descriptions, which may optionally be grouped by capability. - component-definition - - Component Definition Universally Unique Identifier - A globally unique identifier for this component definition instance. This UUID should be changed when this document is revised. - - - - - - - - component - - - - - - - - - - - -

Since multiple component entries can be provided, each component must have a unique uuid.

-
-
- - - -

A given component must not be referenced more than once within the same capability.

-
-
-
-
- - - Import Component Definition - Loads a component definition from another resource. - - Hyperlink Reference - A link to a resource that defines a set of components and/or capabilities to import into this collection. - - - - - Component - A defined component that can be part of an implemented system. - - Component Identifier - The unique identifier for the component. - - - type - - - - Component Title - A human readable name for the component. - - - Component Description - A description of the component, including information about its function. - - - Purpose - A summary of the technological or business purpose of the component. - - - - - - - - - - - - - -

Used for service components to define the protocols supported by the service.

-
-
- - - - - - -
- - - - - - - &allowed-values-component_component_property-name; - &allowed-values-component_inventory-item_property-name; - - - - - - - - - - &allowed-values-component_component_link-rel; - This component uses the network provided by the identified network component. - - - - - - - - &allowed-values-responsible-roles-operations; - &allowed-values-responsible-roles-component-production; - - - - &allowed-values-property-name-asset-type-values; - - - - - - - - The component allows an authenticated scan. - The component does not allow an authenticated scan. - - - - The component is virtualized. - The component is not virtualized. - - - - The component is publicly accessible. - The component is not publicly accessible. - - - - The component is implemented within the system boundary. - The component is implemented outside the system boundary. - - - - - - - - - - - - - - - - - - - - &allowed-values-component_component_software; - - - - - - - &allowed-values-component_component_service; - - - - - - - - - - - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
- -

Components may be products, services, APIs, policies, processes, plans, guidance, standards, or other tangible items that enable security and/or privacy.

-

The type indicates which of these component types is represented.

-

A group of components may be aggregated into a capability. For example, an account management capability that consists of an account management process, and a Lightweight Directory Access Protocol (LDAP) software implementation.

-

Capabilities are expressed by combining one or more components.

-
-
- - - Component Type - A category describing the purpose of the component. - - - &allowed-values-component-type; - - - - - - Capability - A grouping of other components and/or capabilities. - - Capability Identifier - A unique identifier for a capability. - - - Capability Name - The capability's human-readable name. - - - - Capability Description - A summary of the capability. - - - - - - - - - - - - - - - - - - - -

A given component must not be referenced more than once within the same capability.

-
-
-
-
- - Incorporates Component - - TBD - - Component Reference - A reference to a component by its identifier - - - - Component Description - A description of the component, including information about its function. - - - - - - Control Implementation Set - Defines how the component or capability supports a set of controls. - - Control Implementation Set Identifier - A unique identifier for the set of implemented controls. - - - -

A URL reference to the source catalog or profile for which this component is implementing controls for.

-
-
- - - Control Implementation Description - A description of how the specified set of controls are implemented for the containing component or capability. - - - - - - - - - - - - - - - - - - -

Since multiple set-parameter entries can be provided, each parameter must be set only once.

-
-
-
- -

Use of set-parameter in this context, sets the parameter for all related controls referenced in an implemented-requirement. If the same parameter is also set in a specific implemented-requirement, then the new value will override this value.

-
-
- - Control Implementation - Describes how the containing component or capability implements an individual control. - - Control Implementation Identifier - A unique identifier for a specific control implementation. - - - - - Control Implementation Description - A description of how the specified control is implemented for the containing component or capability. - - - - - - - - - - - - - - - - - - - - - - -

Since multiple set-parameter entries can be provided, each parameter must be set only once.

-
-
- - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
- - - -

Since statement entries can be referenced using the statement's statement-id, each statement must be referenced only once.

-
-
-
-
- - Control Statement Implementation - Identifies which statements within a control are addressed. - - -

A reference to the specific implemented statement associated with a control.

-
-
- - Control Statement Reference Universally Unique Identifier - A globally unique identifier that can be used to reference this control statement entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - Statement Implementation Description - A summary of how the containing control statement is implemented by the component or capability. - - - - - - - - - - - - - - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
-
diff --git a/test-suite/oscal/v1.0.0/oscal_control-common_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_control-common_metaschema.xml deleted file mode 100644 index 373fb8347..000000000 --- a/test-suite/oscal/v1.0.0/oscal_control-common_metaschema.xml +++ /dev/null @@ -1,271 +0,0 @@ - - - - - -]> - - OSCAL Control Catalog Format -- Common Models - 1.0.0 - oscal-catalog-common - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - - - - - - Part - A partition of a control's definition or a child of another part. - - - Part Identifier - A unique identifier for a specific part instance. This identifier's uniqueness is document scoped and is intended to be consistent for the same part across minor revisions of the document. - - - Part Name - A textual label that uniquely identifies the part's semantic type. - - - - An introduction to a control or a group of controls. - A set of control implementation requirements. - An individual item within a control statement. - Additional information to consider when selecting, implementing, assessing, and monitoring a control. - Describes a set of assessment objectives. - Describes a method-based assessment over a set of assessment objects. - Provides a list of assessment objects. - - - - - - Part Namespace - A namespace qualifying the part's name. This allows different organizations to associate distinct semantics with the same name. - -

Provides a means to segment the value space for the name, so that different organizations and individuals can assert control over the allowed names and associated text used in a part. This allows the semantics associated with a given name to be defined on an organization-by-organization basis.

-

An organization MUST use a URI that they have control over. e.g., a domain registered to the organization in a URI, a registered uniform resource names (URN) namespace.

-

When a ns is not provided, its value should be assumed to be http://csrc.nist.gov/ns/oscal and the name should be a name defined by the associated OSCAL model.

-
-
- - Part Class - A textual label that provides a sub-type or characterization of the part's name. This can be used to further distinguish or discriminate between the semantics of multiple parts of the same control with the same name and ns. - - -

A class can be used in validation rules to express extra constraints over named items of a specific class value.

-

A class can also be used in an OSCAL profile as a means to target an alteration to control content.

-
-
- - - Part Title - A name given to the part, which may be used by a tool for display and navigation. - - - - - - Part Text - Permits multiple paragraphs, lists, tables etc. - - - - - - - - - - - - - &allowed-values-control-group-property-name; - - - - The assessment method to use. This typically appears on parts with the name "assessment". - - - - The process of holding discussions with individuals or groups of individuals within an organization to once again, facilitate assessor understanding, achieve clarification, or obtain evidence. - The process of reviewing, inspecting, observing, studying, or analyzing one or more assessment objects (i.e., specifications, mechanisms, or activities). - The process of exercising one or more assessment objects (i.e., activities or mechanisms) under specified conditions to compare actual with expected behavior. - - - - -

A part provides for logical partitioning of prose, and can be thought of as a grouping structure (e.g., section). A part can have child parts allowing for arbitrary nesting of prose content (e.g., statement hierarchy). A part can contain prop objects that allow for enriching prose text with structured name/value information.

-

A part can be assigned an optional id, which allows for internal and external references to the textual concept contained within a part. A id provides a means for an OSCAL profile, or a higher layer OSCAL model to reference a specific part within a catalog. For example, an id can be used to reference or to make modifications to a control statement in a profile.

-

Use of part and prop provides for a wide degree of extensibility within the OSCAL catalog model. The optional ns provides a means to qualify a part's name, allowing for organization-specific vocabularies to be defined with clear semantics. Any organization that extends OSCAL in this way should consistently assign a ns value that represents the organization, making a given namespace qualified name unique to that organization. This allows the combination of ns and name to always be unique and unambiguous, even when mixed with extensions from other organizations. Each organization is responsible for governance of their own extensions, and is strongly encouraged to publish their extensions as standards to their user community. If no ns is provided, the name is expected to be in the "OSCAL" namespace.

-

To ensure a ns is unique to an organization and naming conflicts are avoided, a URI containing a DNS or other globally defined organization name should be used. For example, if FedRAMP and DoD both extend OSCAL, FedRAMP will use the ns "https://fedramp.gov", while DoD will use the ns "https://defense.gov" for any organization specific name. -

-

Tools that process OSCAL content are not required to interpret unrecognized OSCAL extensions; however, OSCAL compliant tools should not modify or remove unrecognized extensions, unless there is a compelling reason to do so, such as data sensitivity.

-
- - Multiple Parts with Different Organization-Specific Names - - Something FedRAMP Cares About - Something DoD Cares About - - -
- - - - - - Parameter - Parameters provide a mechanism for the dynamic assignment of value(s) in a control. - - param - - - Parameter Identifier - A unique identifier for a specific parameter instance. This identifier's uniqueness is document scoped and is intended to be consistent for the same parameter across minor revisions of the document. - - - - Parameter Class - A textual label that provides a characterization of the parameter. - -

A class can be used in validation rules to express extra constraints over named items of a specific class value.

-
-
- - - - - - - - - - - Parameter Label - A short, placeholder name for the parameter, which can be used as a substitute for a value if no value is assigned. - -

The label value should be suitable for inline display in a rendered catalog.

-
-
- - Parameter Usage Description - Describes the purpose and use of a parameter - - - constraint - - - - guideline - - - - - - - value - - -

A set of values provided in a catalog can be redefined at any higher layer of OSCAL (e.g., Profile).

-
-
- - select - -

A set of parameter value choices, that may be picked from to set the parameter value.

-
-
-
- - -
- -

In a catalog, a parameter is typically used as a placeholder for the future assignment of a parameter value, although the OSCAL model allows for the direct assignment of a value if desired by the control author. The value may be optionally used to specify one or more values. If no value is provided, then it is expected that the value will be provided at the Profile or Implementation layer.

-

A parameter can include a variety of metadata options that support the future solicitation of one or more values. A label provides a textual placeholder that can be used in a tool to solicit parameter value input, or to display in catalog documentation. The desc provides a short description of what the parameter is used for, which can be used in tooling to help a user understand how to use the parameter. A constraint can be used to provide criteria for the allowed values. A guideline provides a recommendation for the use of a parameter.

-
-
- - - - Constraint - A formal or informal expression of a constraint or test - - - - Constraint Description - A textual summary of the constraint to be applied. - - - - Constraint Test - A test expression which is expected to be evaluated by a tool. - - - - Constraint test - A formal (executable) expression of a constraint - - - - - - - - Guideline - A prose statement that provides a recommendation for the use of a parameter. - - - Guideline Text - Prose permits multiple paragraphs, lists, tables etc. - - - - - - - - Parameter Value - A parameter value or set of values. - - - - Selection - Presenting a choice among alternatives - - Parameter Cardinality - Describes the number of selections that must occur. Without this setting, only one value should be assumed to be permitted. - - - Only one value is permitted. - One or more values are permitted. - - - - - - Choice - A value selection among several such options - choice - value - - - - - - -

A set of parameter value choices, that may be picked from to set the parameter value.

-
-
- - - Depends on - Another parameter invoking this one - - - Control Identifier Reference - A reference to a control with a corresponding id value. - -
diff --git a/test-suite/oscal/v1.0.0/oscal_implementation-common_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_implementation-common_metaschema.xml deleted file mode 100644 index a6dd0b6bf..000000000 --- a/test-suite/oscal/v1.0.0/oscal_implementation-common_metaschema.xml +++ /dev/null @@ -1,681 +0,0 @@ - - - - - - - - - - - -]> - - OSCAL Implementation Common Information - 1.0.0 - oscal-implementation-common - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - - - - - - - - - Component - A defined component that can be part of an implemented system. - - Component Identifier - The unique identifier for the component. - - - - type - - - - Component Title - A human readable name for the system component. - - - Component Description - A description of the component, including information about its function. - - - Purpose - A summary of the technological or business purpose of the component. - - - - - - - - - Status - Describes the operational status of the system component. - - State - The operational status. - - - The component is being designed, developed, or implemented. - The component is currently operational and is available for use in the system. - The component is no longer operational. - Some other state. - - - - - - - - - - - - - -

Used for service components to define the protocols supported by the service.

-
-
- -
- - - - Relative placement of component ('internal' or 'external') to the system. - UUID of the related leveraged-authorization assembly in this SSP. - UUID of the component as it was assigned in the leveraged system's SSP. - - - - - - &allowed-values-component_inventory-item_property-name; - - &allowed-values-component_component_property-name; - - - - - - - - &allowed-values-component_component_link-rel; - This component uses the network provided by the identified network component. - - - - - - - &allowed-values-responsible-roles-operations; - &allowed-values-responsible-roles-component-production; - - - - &allowed-values-property-name-asset-type-values; - - - - The component allows an authenticated scan. - The component does not allow an authenticated scan. - - - - The component is publicly accessible. - The component is not publicly accessible. - - - - The component is virtualized. - The component is not virtualized. - - - - The component is implemented within the system boundary. - The component is implemented outside the system boundary. - - - - - - - - - - - - - - - The name of the company or organization - - - - - - - - - - A link to an online information provided by the authorizing body. - - - - - - - &allowed-values-component_component_software; - - - - - - - &allowed-values-component_component_service; - - - - - - - - - Title of the Interconnection Security Agreement (ISA). - Date of the Interconnection Security Agreement (ISA). - The name of the remote interconnected system. - An Internet Protocol Version 4 interconnection address - An Internet Protocol Version 6 interconnection address - An Internet Protocol Version 6 interconnection address - - - The identified IP address is for this system. - The identified IP address is for the remote system to which this system is connected. - - - - A link to the system interconnection agreement. - - - Interconnection Security Agreement (ISA) point of contact (POC) for this system. - Interconnection Security Agreement (ISA) point of contact (POC) for the remote interconnected system. - Interconnection Security Agreement (ISA) authorizing official for this system. - Interconnection Security Agreement (ISA) authorizing official for the remote interconnected system. - - - - - - Data from the remote system flows into this system. - Data from this system flows to the remote system. - - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
- -

Components may be products, services, application programming interface (APIs), policies, processes, plans, guidance, standards, or other tangible items that enable security and/or privacy.

-

The type indicates which of these component types is represented.

- -

When defining a service component where are relationship to other components is known, one or more link entries with rel values of provided-by and used-by can be used to link to the specific component identifier(s) that provide and use the service respectively.

-
-
- - - Component Type - A category describing the purpose of the component. - - - The system as a whole. - An external system, which may be a leveraged system or the other side of an interconnection. - &allowed-values-component-type; - A physical or virtual network. - - - - - - Service Protocol Information - Information about the protocol used to provide a service. - - Service Protocol Information Universally Unique Identifier - A globally unique identifier that can be used to reference this service protocol entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - Protocol Name - The common name of the protocol, which should be the appropriate "service name" from the IANA Service Name and Transport Protocol Port Number Registry. - - -

The short name of the protocol (e.g., https).

-
-
- - - Protocol Title - A human readable name for the protocol (e.g., Transport Layer Security). - - - - - -
- - Port Range - Where applicable this is the IPv4 port range on which the service operates. - - Start - Indicates the starting port number in a port range - -

Should be a number within a permitted range

-
-
- - End - Indicates the ending port number in a port range - -

Should be a number within a permitted range

-
-
- - Transport - Indicates the transport type. - - - Transmission Control Protocol - User Datagram Protocol - - - - -

To be validated as a natural number (integer >= 1). A single port uses the same value for start and end. Use multiple 'port-range' entries for non-contiguous ranges.

-
- - - - - - - -
- - - Implementation Status - Indicates the degree to which the a given control is implemented. - - Implementation State - Identifies the implementation status of the control or control objective. - - - The control is fully implemented. - The control is partially implemented. - There is a plan for implementing the control as explained in the remarks. - There is an alternative implementation for this control as explained in the remarks. - This control does not apply to this system as justified in the remarks. - - - - - - - - - - - - - System User - A type of user that interacts with the system based on an associated role. - - User Universally Unique Identifier - The unique identifier for the user class. - - - - User Title - A name given to the user, which may be used by a tool for display and navigation. - - - User Short Name - A short common name, abbreviation, or acronym for the user. - - - User Description - A summary of the user's purpose within the system. - - - - - - - - - - - - - - - - - - - The type of user, such as internal, external, or general-public. - The user's privilege level within the system, such as privileged, non-privileged, no-logical-access. - - - A user account for a person or entity that is part of the organization who owns or operates the system. - A user account for a person or entity that is not part of the organization who owns or operates the system. - A user of the system considered to be outside - - - This role has elevated access to the system, such as a group or system administrator. - This role has typical user-level access to the system without elevated access. - This role has no access to the system, such as a manager who approves access as part of a process. - - - &allowed-values-responsible-roles-operations; - - - -

Permissible values to be determined closer to the application, such as by a receiving authority.

-
-
- - Privilege - Identifies a specific system privilege held by the user, along with an associated description and/or rationale for the privilege. - - - Privilege Title - A human readable name for the privilege. - - - Privilege Description - A summary of the privilege's purpose within the system. - - - - - - - - Functions Performed - Describes a function performed for a given authorized privilege by this user class. - - - - - - - Inventory Item - A single managed inventory item within the system. - - - Inventory Item Universally Unique Identifier - A globally unique identifier that can be used to reference this inventory item entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - - - Inventory Item Description - A summary of the inventory item stating its purpose within the system. - - - - - - - - - - - - - Implemented Component - The set of components that are implemented in a given system inventory item. - - - - Component Universally Unique Identifier Reference - A reference to a component that is implemented as part of an inventory item. - - - - - - - - - - - - - - - - -

This construct is used to either: 1) associate a party or parties to a role defined on the component using the responsible-role construct, or 2) to define a party or parties that are responsible for a role defined within the context of the containing inventory-item. -

-
-
- -
- - - - - - - &allowed-values-component_component_property-name; - &allowed-values-component_inventory-item_property-name; - - - - - - - - &allowed-values-responsible-roles-operations; - - - - - - - -

Since responsible-party associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- -
- - - The Internet Protocol v4 Address of the asset. - The Internet Protocol v6 Address of the asset. - The full-qualified domain name (FQDN) of the asset. - A Uniform Resource Identifier (URI) for the asset. - A serial number for the asset. - The NetBIOS name for the asset. - The media access control (MAC) address for the asset. - The physical location of the asset's hardware (e.g., Data Center ID, Cage#, Rack#, or other meaningful location identifiers). - is the asset subjected to network scans? (yes/no) - - - - - The model number of the hardware used by the asset. - - The name of the operating system used by the asset. - - The version of the operating system used by the asset. - - The software product name used by the asset. - - The software product version used by the asset. - - The software product patch level used by the asset. - - - - - &allowed-values-component_inventory-item_property-name; - - - - &allowed-values-property-name-asset-type-values; - - - - The name of the company or organization - - - - - The asset is included in periodic vulnerability scanning. - The asset is not included in periodic vulnerability scanning. - - - - A reference to the baseline template used to configure the asset. - - - - - &allowed-values-responsible-roles-operations; - &allowed-values-responsible-roles-component-production; - - - - - - - - - - - -

Since responsible-party associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- - - - Source Resource Reference - A reference to an OSCAL catalog or profile providing the referenced control or subcontrol definition. - - - - Control Statement Reference - A reference to a control statement by its identifier - - - Set Parameter Value - Identifies the parameter that will be set by the enclosed value. - - - - - Parameter Value - A parameter value or set of values. - value - - - - - - - - - - System Identification - A unique identifier for the system described by this system security plan. - id - - Identification System Type - Identifies the identification system from which the provided identifier was assigned. - - - The identifier was assigned by FedRAMP. - A Universally Unique Identifier (UUID) as defined by RFC4122. - - - - - - - - - Parameter ID - A reference to a parameter within a control, who's catalog has been imported into the current implementation context. - - - System ISSO - - - -
diff --git a/test-suite/oscal/v1.0.0/oscal_metadata_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_metadata_metaschema.xml deleted file mode 100644 index 3f1d4ba3c..000000000 --- a/test-suite/oscal/v1.0.0/oscal_metadata_metaschema.xml +++ /dev/null @@ -1,947 +0,0 @@ - - - - - - OSCAL Document Metadata Description - 1.0.0 - oscal-metadata - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - - - - - - Publication metadata - Provides information about the publication and availability of the containing document. - - - Document Title - A name given to the document, which may be used by a tool for display and navigation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Since responsible-party associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
- - Indicates the organization that created this content. - Indicates the organization for which this content was created. - Indicates the organization responsible for all content represented in the "document". - - - The link identifies the authoritative location for this file. Defined by RFC 6596. - The link identifies an alternative location or format for this file. Defined by the HTML Living Standard - This link identifies a resource containing the latest version in the version history. Defined by RFC 5829. - This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. - This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. - -
-
- - - Revision History Entry - An entry in a sequential list of revisions to the containing document in reverse chronological order (i.e., most recent previous revision first). - - - Document Title - A name given to the document revision, which may be used by a tool for display and navigation. - - - - - - - - - - - - - - - - - The link identifies the authoritative location for this file. Defined by RFC 6596. - The link identifies an alternative location or format for this file. Defined by the HTML Living Standard - This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. - This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. - - - -

While published, last-modified, oscal-version, and version are not required, values for these entries should be provided if the information is known. For a revision entry to be considered valid, at least one of the following items must be provided: published, last-modified, version, or a link with a rel of source.

-
-
- - - Location - A location, with associated metadata that can be referenced. - - Location Universally Unique Identifier - A unique identifier that can be used to reference this defined location elsewhere in an OSCAL document. A UUID should be consistently used for a given location across revisions of the document. - - - - Location Title - A name given to the location, which may be used by a tool for display and navigation. - - - -

Typically, the physical address of the location will be used here. If this information is sensitive, then a mailing address can be used instead.

-
-
- - - - -

This is a contact email associated with the location.

-
-
- - - - -

A phone number used to contact the location.

-
-
- - Location URL - The uniform resource locator (URL) for a web site or Internet presence associated with the location. - - - - - - - - - - -
- - - Characterizes the kind of location. - - - A location that contains computing assets. A class can be used to indicate a subclass of data-center. - - - The location is a data-center used for normal operations. - The location is a data-center used for fail-over or backup operations. - - -
- - - Location Reference - References a location defined in metadata. - - - - - - - - - - - - Location Reference - References a location defined in metadata. - - - - - - - - - - - Party (organization or person) - A responsible entity which is either a person or an organization. - - Party Universally Unique Identifier - A unique identifier that can be used to reference this defined location elsewhere in an OSCAL document. A UUID should be consistently used for a given party across revisions of the document. - - - Party Type - A category describing the kind of party the object describes. - - - An individual. - A group of individuals formed for a specific purpose. - - - - - - - Party Name - The full name of the party. This is typically the legal name associated with the party. - - - Party Short Name - A short common name, abbreviation, or acronym for the party. - - - - Party External Identifier - An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID) - id - - - - External Identifier Schema - Indicates the type of external identifier. - - - The identifier is Open Researcher and Contributor ID (ORCID). - - - - - - - - - - - - - - -

This is a contact email associated with the party.

-
-
- - - - -

A phone number used to contact the party.

-
-
- - - - - - - - - - - Organizational Affiliation - Identifies that the party object is a member of the organization associated with the provided UUID. - - - - - - - -

Parties of both the person or organization type can be associated with an organization using the member-of-organization. -

-
-
- -
- - - A mail stop associated with the party. - The name or number of the party's office. - The formal job title of a person. - - -
- - - Party Reference - References a party defined in metadata. - - - - - - - - - - - Role - Defines a function assumed or expected to be assumed by a party in a specific situation. - - - Role Identifier - A unique identifier for a specific role instance. This identifier's uniqueness is document scoped and is intended to be consistent for the same role across minor revisions of the document. - -

OSCAL has defined a set of standardized roles for consistent use in OSCAL documents. This allows tools consuming OSCAL content to infer specific semantics when these roles are used. These roles are documented in the specific contexts of their use (e.g., responsible-party, responsible-role). When using such a role, it is necessary to define these roles in this list, which will then allow such a role to be referenced.

-
-
- - - Role Title - A name given to the role, which may be used by a tool for display and navigation. - - - Role Short Name - A short common name, abbreviation, or acronym for the role. - - - - Role Description - A summary of the role's purpose and associated responsibilities. - - - - - - - - - - -

Permissible values to be determined closer to the application (e.g. by a receiving authority).

-
-
- - - Role Identifier Reference - A reference to the roles served by the user. - - - - - - - - - - - - - Back matter - A collection of resources, which may be included directly or by reference. - - - Resource - A resource associated with content in the containing document. A resource may be directly included in the document base64 encoded or may point to one or more equivalent internet resources. - - - Resource Universally Unique Identifier - A globally unique identifier that can be used to reference this defined resource elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - Resource Title - A name given to the resource, which may be used by a tool for display and navigation. - - - - Resource Description - A short summary of the resource used to indicate the purpose of the resource. - - - - - - - - - - Citation - A citation consisting of end note text and optional structured bibliographic data. - - - Citation Text - A line of citation text. - - - - - - - - - - -

The text is used to define the endnote text, without any required bibliographic structure. If structured bibliographic data is needed, then the biblio can be used for this purpose.

-

A biblio can be used to capture a structured bibliographical citation in an appropriate format.

-
-
- - Resource link - A pointer to an external resource with an optional hash for verification and change detection. - - - Hypertext Reference - A resolvable URI reference to a resource. - - - - - - -

When appearing as part of a resource/rlink, the hash applies to the resource referenced by the href. -

-
-
-
- -

This construct is different from link, which makes no provision for a hash or formal title.

-

Multiple rlink can be included for a resource. In such a case, all provided rlink items are intended to be equivalent in content, but may differ in structure. A media-type is used to identify the format of a given rlink, and can be used to differentiate a items in a collection of rlinks. The media-type also provides a hint to the OSCAL document consumer about the structure of the resource referenced by the rlink. -

-
-
- - - Base64 - The Base64 alphabet in RFC 2045 - aligned with XSD. - value - - File Name - Name of the file before it was encoded as Base64 to be embedded in a resource. This is the name that will be assigned to the file when the file is decoded. - - - - - -
- - - Identifies the type of resource represented. - For resources representing a published document, this represents the version number of that document. - For resources representing a published document, this represents the publication date of that document. - - - - - - Indicates the resource is an organization's logo. - Indicates the resource represents an image. - Indicates the resource represents an image of screen content. - Indicates the resource represents an applicable law. - Indicates the resource represents an applicable regulation. - Indicates the resource represents an applicable standard. - Indicates the resource represents applicable guidance. - Indicates the resource provides a list of relevant acronyms. - Indicates the resource cites relevant information. - - Indicates the resource is a policy. - Indicates the resource is a procedure. - Indicates the resource is guidance document related to the subject system of an SSP. - Indicates the resource is guidance document a user's guide or administrator's guide. - Indicates the resource is guidance document a administrator's guide. - Indicates the resource represents rules of behavior content. - Indicates the resource represents a plan. - - Indicates the resource represents an artifact, such as may be reviewed by an assessor. - Indicates the resource represents evidence, such as to support an assessment findiing. - Indicates the resource represents output from a tool. - Indicates the resource represents machine data, which may require a tool or analysis for interpretation or presentation. - Indicates the resource represents notes from an interview, such as may be collected during an assessment. - Indicates the resource is a set of questions, possibly with responses. - Indicates the resource is a report. - Indicates the resource is a formal agreement between two or more parties. - - - - - -

Ensures that each rlink item references a unique resource.

-
-
- - - -

Ensures that all base64 resources have a unique filename. -

-
-
- - - -

A title is required when a citation is provided.

-
-
-
-
- -

A resource can be used in two ways. 1) it may point to an specific retrievable network resource using a rlink, or 2) it may be included as an attachment using a base64. A resource may contain multiple rlink and base64 entries that represent alternative download locations (rlink) and attachments (base64) for the same resource. Both rlink and base64 allow for a media-type to be specified, which is used to distinguish between different representations of the same resource (e.g., Microsoft Word, PDF). When multiple rlink and base64 items are included for a given resource, all items must contain equivalent information. This allows the document consumer to choose a preferred item to process based on a the selected item's media-type. This is extremely important when the items represent OSCAL content that is represented in alternate formats (i.e., XML, JSON, YAML), allowing the same OSCAL data to be processed from any of the available formats indicated by the items.

-

When a resource includes a citation, then the title and citation properties must both be included.

-
-
-
- - - - - - -

Provides a collection of identified resource objects that can be referenced by a link with a rel value of "reference" and an href value that is a fragment "#" followed by a reference to a reference identifier. Other specialized link "rel" values also use this pattern when indicated in that context of use.

-
- - - Use of link, citation, and resource - -

The following is a contrived example to show the use of link, citation, and resource.

-
- - - My citation - - - - - - - -
-
- - - - - - Property - An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. The value of a property is a simple scalar value, which may be expressed as a list of values. - prop - - Property Name - A textual label that uniquely identifies a specific attribute, characteristic, or quality of the property's containing object. - - - A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. - - - - - Property Universally Unique Identifier - A unique identifier that can be used to reference this property elsewhere in an OSCAL document. A UUID should be consistently used for a given location across revisions of the document. - - - - - Property Namespace - A namespace qualifying the property's name. This allows different organizations to associate distinct semantics with the same name. - -

Provides a means to segment the value space for the name, so that different organizations and individuals can assert control over the allowed names and associated values used in a property. This allows the semantics associated with a given name/value pair to be defined on an organization-by-organization basis.

-

An organization MUST use a URI that they have control over. e.g., a domain registered to the organization in a URI, a registered uniform resource names (URN) namespace.

-

When a ns is not provided, its value should be assumed to be http://csrc.nist.gov/ns/oscal and the name should be a name defined by the associated OSCAL model.

-
-
- - Property Value - Indicates the value of the attribute, characteristic, or quality. - - - Property Class - A textual label that provides a sub-type or characterization of the property's name. This can be used to further distinguish or discriminate between the semantics of multiple properties of the same object with the same name and ns. - - -

A class can be used in validation rules to express extra constraints over named items of a specific class value.

-
-
- - - - -

Properties permit the deployment and management of arbitrary controlled values, within OSCAL objects. A property can be included for any purpose useful to an application or implementation. Typically, properties will be used to sort, filter, select, order, and arrange OSCAL content objects, to relate OSCAL objects to one another, or to associate an OSCAL object to class hierarchies, taxonomies, or external authorities. Thus, the lexical composition of properties may be constrained by external processes to ensure consistency.

-

Property allows for associated remarks that describe why the specific property value was applied to the containing object, or the significance of the value in the context of the containing object.

-
-
- - - Link - A reference to a local or remote resource - - Hypertext Reference - A resolvable URL reference to a resource. - -

The value of the href can be an internet resource, or a local reference using a fragment e.g. #fragment that points to a back-matter - resource in the same document.

- -

If a local reference using a fragment is used, this will be indicated by a fragment "#" followed by an identifier which references an identified resource in the document's back-matter or another object that is within the scope of the containing OSCAL document.

-

If an internet resource is used, the href value will be an absolute or relative URI pointing to the location of the referenced resource. A relative URI will be resolved relative to the location of the document containing the link.

-
-
- - Relation - Describes the type of relationship provided by the link. This can be an indicator of the link's purpose. - - - Reference - - - - - -

The media-type provides a hint about the content model of the referenced resource. A valid entry from the IANA Media Types registry SHOULD be used.

-
-
- - - Link Text - A textual label to associate with the link, which may be used for presentation in a tool. - - - - - - - - - - - - - - - - -

To provide a cryptographic hash for a remote target resource, a local reference to a back matter resource is needed. The resource allows one or more hash values to be provided using the rlink/hash object.

-

The OSCAL link is a roughly based on the HTML link element. -

-
- - Providing for link integrity - -

The following is a contrived example to show the use of link, citation, and resource.

-
- - My Hashed Resource - ...snip... - - - - C2E9C1..snip..F88D2E - - - - -
-
- - - Responsible Party - A reference to a set of organizations or persons that have responsibility for performing a referenced role in the context of the containing object. - - Responsible Role - The role that the party is responsible for. - - - - - -

Specifies one or more parties that are responsible for performing the associated role. -

-
-
- - - - - - - -
- - - - - - - - -
- - Responsible Role - A reference to one or more roles with responsibility for performing a function relative to the containing object. - - Responsible Role ID - The role that is responsible for the business function. - - - - - - - - - - - - - - - - - - Hash - A representation of a cryptographic digest generated over a resource using a specified hash algorithm. - value - - Hash algorithm - Method by which a hash is derived - - - The SHA-224 algorithm as defined by NIST FIPS 180-4. - - The SHA-256 algorithm as defined by NIST FIPS 180-4. - - The SHA-384 algorithm as defined by NIST FIPS 180-4. - - The SHA-512 algorithm as defined by NIST FIPS 180-4. - - The SHA3-224 algorithm as defined by NIST FIPS 202. - - The SHA3-256 algorithm as defined by NIST FIPS 202. - - The SHA3-384 algorithm as defined by NIST FIPS 202. - - The SHA3-512 algorithm as defined by NIST FIPS 202. - - - - -

Any other value used MUST be a value defined in the W3C XML Security Algorithm Cross-Reference Digest Methods (W3C, April 2013) or RFC 6931 Section 2.1.5 New SHA Functions.

-
-
- -

A hash value can be used to authenticate that a referenced resource is the same resources as was pointed to by the author of the reference.

-
-
- - - Media Type - Specifies a media type as defined by the Internet Assigned Numbers Authority (IANA) Media Types Registry. - - - - - Remarks - Additional commentary on the containing object. - - - - - - - Publication Timestamp - The date and time the document was published. The date-time value must be formatted according to RFC 3339 with full time and time zone included. - -

This value represents the point in time when the OSCAL document was published. Typically, this date value will be machine generated at the time the containing document is published.

-

In some cases, an OSCAL document may be derived from some source material in a different format. In such a case, the published value should indicate when the OSCAL document was published, not the source material. Where necessary, the publication date of the original source material can be captured as a named property or custom metadata construct.

-

A publisher of OSCAL content can use this data point along with its siblings last-modified and version to establish a sequence of successive revisions of a given OSCAL-based publication. The metadata for previous revisions can be represented as a revision in this object.

-
-
- - - Last Modified Timestamp - The date and time the document was last modified. The date-time value must be formatted according to RFC 3339 with full time and time zone included. - -

This value represents the point in time when the OSCAL document was last updated, or at the point of creation the creation date. Typically, this date value will be machine generated at time of creation or modification.

-

In some cases, an OSCAL document may be derived from some source material in a different format. In such a case, the last-modified value should indicate the modification time of the OSCAL document, not the source material.

-

A publisher of OSCAL content can use this data point along with its siblings published and version to establish a sequence of successive revisions of a given OSCAL-based publication. The metadata for previous revisions can be represented as a revision in this object.

-
-
- - Document Version - A string used to distinguish the current version of the document from other previous (and future) versions. - -

A version string may be a release number, sequence number, date, or other identifier suffcient to distinguish between different document versions. This version is typically set by the document owner or by the tool used to maintain the content.

-

While not required, it is recommended that OSCAL content authors use Semantic Versioning as a format for version strings. This allows for the easy identification of a version tree consisting of major, minor, and patch numbers.

-

A publisher of OSCAL content can use this data point along with its siblings published and last-modified to establish a sequence of successive revisions of a given OSCAL-based publication. The metadata for previous revisions can be represented as a revision in this object.

-
-
- - OSCAL version - The OSCAL model version the document was authored against. - -

Indicates the version of the OSCAL model to which this data set conforms, for example 1.1.0 or 1.0.0-M1. That can be used as a hint by a tool to indicate which version of the OSCAL XML or JSON schema to use for validation.

-
-
- - - Email Address - An email address as defined by RFC 5322 Section 3.4.1. - - - - - Telephone Number - Contact number by telephone. - number - - type flag - Indicates the type of phone number. - - - A home phone number. - An office phone number. - A mobile phone number. - - - - - - - Address - A postal address for the location. - - type - - - - - - - - City - City, town or geographical region for the mailing address. - - - State - State, province or analogous geographical region for mailing address - - - Postal Code - Postal or ZIP code for mailing address - - - Country Code - The ISO 3166-1 alpha-2 country code for the mailing address. - - - - - - - - - Address line - A single line of an address. - - - - Address Type - Indicates the type of address. - - - A home address. - A work address. - - - - - - - Document Identifier - A document identifier qualified by an identifier scheme. A document identifier provides a globally unique identifier for a group of documents that are to be treated as different versions of the same document. If this element does not appear, or if the value of this element is empty, the value of "document-id" is equal to the value of the "uuid" flag of the top-level root element. - identifier - - - - Document Identification Scheme - Qualifies the kind of document identifier using a URI. If the scheme is not provided the value of the element will be interpreted as a string of characters. - - - A Digital Object Identifier (DOI); use is preferred, since this allows for retrieval of a full bibliographic record. - - - - -

This element is optional, but it will always have a valid value, as if it is missing the value of "document-id" is assumed to be equal to the UUID of the root. This requirement allows for document creators to retroactively link an update to the original version, by providing a document-id on the new document that is equal to the uuid of the original document.

-
-
- - - -
diff --git a/test-suite/oscal/v1.0.0/oscal_poam_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_poam_metaschema.xml deleted file mode 100644 index 8b899625d..000000000 --- a/test-suite/oscal/v1.0.0/oscal_poam_metaschema.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - OSCAL Plan of Action and Milestones (POA&M) Model - 1.0.0 - oscal-poam - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - -

The OSCAL Plan of Action and Milestones (POA&M) format is used to describe the information typically provided by an assessor during the preparation for an assessment.

-

The root of the OSCAL Plan of Action and Milestones (POA&M) format is plan-action-milestones. -

-
- - - - - - - Plan of Action and Milestones (POA&M) - A plan of action and milestones which identifies initial and residual risks, deviations, and disposition, such as those required by FedRAMP. - plan-of-action-and-milestones - - POA&M Universally Unique Identifier - Uniquely identifies this POA&M. This UUID must be changed each time the content of the POA&M changes. - - - - - - -

Used by the POA&M to import information about the system.

-
-
- - - - - - - - - - - - - - - - -
- -

Either an OSCAL-based SSP must be imported, or a unique system-id must be specified. Both may be present.

-
-
- - Local Definitions - Allows components, and inventory-items to be defined within the POA&M for circumstances where no OSCAL-based SSP exists, or is not delivered with the POA&M. - - - component - - -

Used to add any components, not defined via the System Security Plan (AR->AP->SSP)

-
-
- - - -

Used to add any inventory-items, not defined via the System Security Plan (AR->AP->SSP)

-
-
- -
- - - - -

Since multiple component entries can be provided, each component must have a unique uuid.

-
-
-
-
- - - POA&M Item - Describes an individual POA&M item. - - POA&M Item Universally Unique Identifier - Uniquely identifies the POA&M entry. This UUID may be referenced elsewhere in an OSCAL document when referring to this information. A UUID should be consistently used for a given POA&M item across revisions of the document. - - - - POA&M Item Title - The title or name for this POA&M item . - - - - POA&M Item Description - A human-readable description of POA&M item. - - - - - - - - - Origin - Identifies the source of the finding, such as a tool or person. - - - - actor - - - - -

Used to identify the individual and/or tool generated this poam-item.

-
-
- - - - - - - - Related Observation - Relates the poam-item to a set of referenced observations that were used to determine the finding. - - - Observation Universally Unique Identifier Reference - References an observation defined in the list of observations. - - - - - - Associated Risk - Relates the finding to a set of referenced risks that were used to determine the finding. - - - Risk Universally Unique Identifier Reference - References an risk defined in the list of risks. - - - -
-
-
diff --git a/test-suite/oscal/v1.0.0/oscal_profile_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_profile_metaschema.xml deleted file mode 100644 index 2066fb9ff..000000000 --- a/test-suite/oscal/v1.0.0/oscal_profile_metaschema.xml +++ /dev/null @@ -1,436 +0,0 @@ - - - -]> - - OSCAL Profile Model - 1.0.0 - oscal-profile - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - -

A profile designates a selection and configuration of controls from one or more catalogs, along with a series of operations over them. The topmost element in the OSCAL profile XML schema is profile.

-
- - - - - - Profile - Each OSCAL profile is defined by a Profile element - profile - - Catalog Universally Unique Identifier - A globally unique identifier for this profile instance. This UUID should be changed when this document is revised. - - - - - - - - - - - -

An OSCAL document that describes a tailoring of controls from one or more catalogs, with possible modification of multiple controls. It provides mechanisms by which controls may be selected (import), merged or (re)structured (merge), and amended (modify). OSCAL profiles may select subsets of controls, set parameter values for them in application, and even adjust the representation of controls as given in and by a catalog. They may also serve as sources for further modification in and by other profiles, that import them.

-
-
- - Import resource - The import designates a catalog, profile, or other resource to be included (referenced and potentially modified) by this profile. The import also identifies which controls to select using the include-all, include-controls, and exclude-controls directives. - - Catalog or Profile Reference - A resolvable URL reference to the base catalog or profile that this profile is tailoring. - -

The value of the href can be an internet resource, or a local reference using a fragment e.g. #fragment that points to a back-matter - resource in the same document.

- -

If a local reference using a fragment is used, this will be indicated by a fragment "#" followed by an identifier which references an identified resource in the document's back-matter or another object that is within the scope of the containing OSCAL document.

-

If an internet resource is used, the href value will be an absolute or relative URL pointing to the location of the referenced resource. A relative URL will be resolved relative to the location of the document containing the link.

-
-
- - - - -

Identifies that all controls are to be included from the imported catalog or profile.

-
-
- - include-controls - - -

Identifies a subset of controls to import from the referenced catalog or profile by control identifier or match pattern.

-
-
-
- - exclude-controls - - -

Identifies which controls to exclude, or eliminate, from the set of included controls by control identifier or match pattern.

-
-
-
- -

A profile must be based on an existing OSCAL catalog or another OSCAL profile. An import indicates such a source whose controls are to be included (referenced and modified) in a profile. This source will either be a catalog whose controls are given (by value), or a profile with its own control imports.

-

The contents of the import element indicate which controls from the source will be included. Controls from the source catalog or profile may be either selected, using the include-all or include-controls directives, or de-selected (using an exclude-controls directive).

-
- - - - - -
- - Merge controls - A Merge element merges controls in resolution. - - - - - - - - -

The contents of the merge element may be used to reorder or restructure controls by indicating an order and/or structure in resolution.

-

Implicitly, a merge element is also a filter: controls that are included in a profile, but not included (implicitly or explicitly) in the scope of a merge element, will not be merged into (will be dropped) in the resulting resolution.

-
-
- - Combination rule - A Combine element defines whether and how to combine multiple (competing) versions of the same control - - -

Whenever combining controls from multiple (import) pathways, an issue arises of what to do with clashing invocations (multiple competing versions of a control).

-

This setting permits a profile designer to apply a rule for the resolution of such cases. In a well-designed profile, such collisions would ordinarily be avoided, but this setting can be useful for defining what to do when it occurs.

-
-
- - As is - An As-is element indicates that the controls should be structured in resolution as they are structured in their source catalogs. It does not contain any elements or attributes. - - - Combination method - How clashing controls should be handled - - - Use the first definition - the first control with a given ID is used; subsequent ones are discarded - Merge - controls with the same ID are combined - Keep - controls with the same ID are kept, retaining the clash - - - - - Custom grouping - A Custom element frames a structure for embedding represented controls in resolution. - - - - - - - - - -

The custom element represents a custom arrangement or organization of controls in the resolution of a catalog.

-

While the as-is element provides for a restitution of a control set's organization (in one or more source catalogs), this element permits the definition of an entirely different structure.

-
-
- - Control group - A group of (selected) controls or of groups of controls - - - Group Identifier - A unique identifier for a specific group instance that can be used to reference the group within this and in other OSCAL documents. This identifier's uniqueness is document scoped and is intended to be consistent for the same group across minor revisions of the document. - - - Group Class - A textual label that provides a sub-type or characterization of the group. - -

A class can be used in validation rules to express extra constraints over named items of a specific class value.

-

A class can also be used in an OSCAL profile as a means to target an alteration to control content.

-
-
- - - Group Title - A name given to the group, which may be used by a tool for display and navigation. - - - - - - - - - - - - - - - - - - - - - - - -

This construct mirrors the same construct that exists in an OSCAL catalog.

-
-
- - Modify controls - Set parameters or amend controls in resolution - - - Parameter Setting - A parameter setting, to be propagated to points of insertion - - - - Parameter ID - Indicates the value of the 'id' flag on a target parameter; i.e. which parameter to set - - - Parameter Class - A textual label that provides a characterization of the parameter. - -

A class can be used in validation rules to express extra constraints over named items of a specific class value.

-
-
- - - - - - - - - - Parameter Label - A short, placeholder name for the parameter, which can be used as a substitute for a value if no value is assigned. - -

The label value should be suitable for inline display in a rendered catalog.

-
-
- - Parameter Usage Description - Describes the purpose and use of a parameter - - - constraint - - - - guideline - - - - - value - - -

Used to (re)define a parameter value.

-
-
- - select - -
-
- - - - -

Since multiple set-parameter entries can be provided, each parameter must be set only once.

-
-
-
-
- - - -
-
- - Select controls - Specifies which controls to use in the containing context. - - Order - A designation of how a selection of controls in a profile is to be ordered. - - - - - - - - - - - - - include-controls - - - - - exclude-controls - - -

Identifies which controls to exclude, or eliminate, from the set of matching includes.

-
-
-
- -

To be schema-valid, this element must contain either (but not both) a single include-all directive, or a sequence of include-controls directives.

-

If this directive is not provided, then no controls are to be inserted; i.e., all controls are included explicitly.

-
-
- - - Insert All - Insert all controls from the imported catalog or profile resources identified in the import directive. - -

This element provides an alternative to calling controls individually from a catalog.

-
-
- - Call - Call a control by its ID - - - - Match Controls by Identifier - - - - - Match Controls by Pattern - Select controls by (regular expression) match on ID - - - - - -

If with-child-controls is yes on the call to a control, no sibling callelements need to be used to call any controls appearing within it. Since generally, this is how control enhancements are represented (as controls within controls), this provides a way to include controls with all their dependent controls (enhancements) without having to call them individually.

-
-
- - Alteration - An Alter element specifies changes to be made to an included control when a profile is resolved. - - - - - - - - - - -

Use @control-id to indicate the scope of alteration.

-

It is an error for two alter elements to apply to the same control. In practice, multiple alterations can be applied (together), but it creates confusion.

-

At present, no provision is made for altering many controls at once (for example, to systematically remove properties or add global properties); extending this element to match multiple control IDs could provide for this.

-
-
- - Removal - Specifies objects to be removed from a control based on specific aspects of the object that must all match. - - Reference by (assigned) name - Identify items to remove by matching their assigned name - - - Reference by class - Identify items to remove by matching their class. - - - Reference by ID - Identify items to remove indicated by their id. - - - Item Name Reference - Identify items to remove by the name of the item's information element name, e.g. title or prop - - - Item Namespace Reference - Identify items to remove by the item's ns, which is the namespace associated with a part, or prop. - - -

Use name-ref, class-ref, id-ref or generic-identifier to indicate class tokens or ID reference, or the formal name, of the component to be removed or erased from a control, when a catalog is resolved. The control affected is indicated by the pointer on the removal's parent (containing) alter element.

-

To change an element, use remove to remove the element, then add to add it back again with changes.

-
-
- - Addition - Specifies contents to be added into controls, in resolution - - Position - Where to add the new content with respect to the targeted element (beside it or inside it) - - - Preceding the id-ref target - Following the id-ref target - Inside the control or id-ref target, at the start - Inside the control or id-ref target, at the end - - - - - Reference by ID - Target location of the addition. - - - - Title Change - A name given to the control, which may be used by a tool for display and navigation. - - - - - - - - - - - - - - - - - - - &allowed-values-control-group-property-name; - - - -

When no id-ref is given, the addition is inserted into the control targeted by the alteration at the start or end as indicated by position. Only position values of "starting" or "ending" are permitted when there is no id-ref.

-

id-ref, when given, should indicate, by its ID, an element inside the control to serve as the anchor point for the addition. In this case, position value may be any of the permitted values.

-
-
- - Include contained controls with control - When a control is included, whether its child (dependent) controls are also included. - - - Include child controls with an included control. - When importing a control, only include child controls that are also explicitly called. - - - - - Pattern - A glob expression matching the IDs of one or more controls to be selected. - -
diff --git a/test-suite/oscal/v1.0.0/oscal_ssp_metaschema.xml b/test-suite/oscal/v1.0.0/oscal_ssp_metaschema.xml deleted file mode 100644 index acdb41896..000000000 --- a/test-suite/oscal/v1.0.0/oscal_ssp_metaschema.xml +++ /dev/null @@ -1,1043 +0,0 @@ - - - - - - - -]> - - OSCAL System Security Plan (SSP) Model - 1.0.0 - oscal-ssp - http://csrc.nist.gov/ns/oscal/1.0 - http://csrc.nist.gov/ns/oscal - -

The OSCAL Control SSP format can be used to describe the information typically specified in a system security plan, such as those defined in NIST SP 800-18.

-

The root of the OSCAL System Security Plan (SSP) format is system-security-plan.

-
- - - - - - - - - System Security Plan (SSP) - A system security plan, such as those described in NIST SP 800-18 - system-security-plan - - System Security Plan Universally Unique Identifier - A globally unique identifier for this catalog instance. This UUID should be changed when this document is revised. - - - - - - - - - - - - - - - - Import Profile - Used to import the OSCAL profile representing the system's control baseline. - - Profile Reference - A resolvable URL reference to the profile to use as the system's control baseline. - -

The value of the href can be an internet resource, or a local reference using a fragment e.g. #fragment that points to a back-matter - resource in the same document.

- -

If a local reference using a fragment is used, this will be indicated by a fragment "#" followed by an identifier which references an identified resource in the document's back-matter or another object that is within the scope of the containing OSCAL document.

-

If an internet resource is used, the href value will be an absolute or relative URI pointing to the location of the referenced resource. A relative URI will be resolved relative to the location of the document containing the link.

-
-
- - - -
- - - - - - System Characteristics - Contains the characteristics of the system, such as its name, purpose, and security impact level. - - - - - - System Name - Full - The full name of the system. - - - System Name - Short - A short name for the system, such as an acronym, that is suitable for display in a data table or summary list. - - - System Description - A summary of the system. - - - - - - - - - - Security Sensitivity Level - The overall information system sensitivity categorization, such as defined by FIPS-199. - - -

Often, organizations require the security sensitivity level to correspond with the highest confidentiality, integrity, or availability level identified by security-impact-level. -

-
-
- - - - - - - - - - -
- - - A value of 1, 2, or 3 as defined by SP 800-63-3. - - A value of 1, 2, or 3 as defined by SP 800-63-3. - - A value of 1, 2, or 3 as defined by SP 800-63-3. - - - - As defined by SP 800-63-3. - - As defined by SP 800-63-3. - - As defined by SP 800-63-3. - - - - The associated value is one of: public-cloud, private-cloud, community-cloud, government-only-cloud, hybrid-cloud, or other. - The associated value is one of: saas, paas, iaas, or other. - - - The public cloud deployment model as defined by The NIST Definition of Cloud Computing. - - The private cloud deployment model as defined by The NIST Definition of Cloud Computing. - - The community cloud deployment model as defined by The NIST Definition of Cloud Computing. - - - TODO: define - Any other type of cloud deployment model that is exclusive to the other choices. - -

The hybrid cloud deployment model, as defined by The NIST Definition of Cloud Computing, can be supported by selecting two or more of the existing deployment models.

-
-
- - Software as a service (SaaS) cloud service model as defined by The NIST Definition of Cloud Computing. - - Platform as a service (PaaS) cloud service model as defined by The NIST Definition of Cloud Computing. - - Infrastructure as a service (IaaS) cloud service model as defined by The NIST Definition of Cloud Computing. - - Any other type of cloud service model that is exclusive to the other choices. - - - - -

Since responsible-party associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
- - &allowed-values-responsible-roles-system; - -
-
- - System Information - Contains details about all information types that are stored, processed, or transmitted by the system, such as privacy information, and those defined in NIST SP 800-60. - - - - - - - - - - Information Type - Contains details about one information type that is stored, processed, or transmitted by the system, such as privacy information, and those defined in NIST SP 800-60. - - - - Information Type Universally Unique Identifier - A globally unique identifier that can be used to reference this information type entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - title field - A human readable name for the information type. This title should be meaningful within the context of the system. - - - Information Type Description - A summary of how this information type is used within the system. - - - - Information Type Categorization - A set of information type identifiers qualified by the given identification system used, such as NIST SP 800-60. - - - Information Type Identification System - Specifies the information type identification system used. - - - Based on the section identifiers in NIST Special Publication 800-60 Volume II Revision 1. - - - - - - - - Information Type Systematized Identifier - An identifier qualified by the given identification system used, such as NIST SP 800-60. - id - - - - - - - - - - - - Confidentiality Impact Level - The expected level of impact resulting from the unauthorized disclosure of the described information. - - - - - - - - - - - - - - Integrity Impact Level - The expected level of impact resulting from the unauthorized modification of the described information. - - - - - - - - - - - - - - Availability Impact Level - The expected level of impact resulting from the disruption of access to or use of the described information or the information system. - - - - - - - - - - - - - - - - - - Is this a privacy sensitive system? yes or no - - - The system is privacy sensitive. - The system isnot privacy sensitive. - - - A link to the privacy impact assessment. - - - - - - - - A 'low' sensitivity level as defined in FIPS-199. - - A 'moderate' sensitivity level as defined in FIPS-199. - - A 'high' sensitivity level as defined in FIPS-199. - - -

FIPS-199 taxonomy is provided here as a starting point. We will provide other taxonomies based on community requests.

-
-
-
-
- - Base Level (Confidentiality, Integrity, or Availability) - The prescribed base (Confidentiality, Integrity, or Availability) security impact level. - - - Selected Level (Confidentiality, Integrity, or Availability) - The selected (Confidentiality, Integrity, or Availability) security impact level. - - - Adjustment Justification - If the selected security level is different from the base security level, this contains the justification for the change. - - - Security Impact Level - The overall level of expected impact resulting from unauthorized disclosure, modification, or loss of access to information. - - - - Security Objective: Confidentiality - A target-level of confidentiality for the system, based on the sensitivity of information within the system. - - - - Security Objective: Integrity - A target-level of integrity for the system, based on the sensitivity of information within the system. - - - - Security Objective: Availability - A target-level of availability for the system, based on the sensitivity of information within the system. - - - - - Status - Describes the operational status of the system. - - State - The current operating status. - - - The system is currently operating in production. - The system is being designed, developed, or implemented - The system is undergoing a major change, development, or transition. - The system is no longer operational. - Some other state. - - - - - - - -

If 'other' is selected, a remark must be included to describe the current state.

-
-
- - System Authorization Date - The date the system received its authorization. - - - Authorization Boundary - A description of this system's authorization boundary, optionally supplemented by diagrams that illustrate the authorization boundary. - - - Authorization Boundary Description - A summary of the system's authorization boundary. - - - - - - - - - - - -

A visual depiction of the system's authorization boundary.

-
-
- - remarks field - Commentary about the system's authorization boundary that enhances the diagram. - -
- - - - -

A given uuid must be assigned only once to a diagram.

-
-
-
-
- - Diagram - A graphic that provides a visual representation the system, or some aspect of it. - - Diagram ID - The identifier for this diagram. - - - - Diagram Description - A summary of the diagram. - -

This description is intended to be used as alternate text to support compliance with requirements from Section 508 of the United States Workforce Rehabilitation Act of 1973. -

-
-
- - - - - - - - Caption - A brief caption to annotate the diagram. - - - remarks field - Commentary about the diagram that enhances it. - -
- - - A reference to the diagram image. - - - - - - - - -

A diagram must include a link with a rel value of "diagram", who's href references a remote URI or an internal reference within this document containing the diagram.

-
- - -

The internal reference "#diagram1" points to an attached resource defined in the back-matter as a resource. The media-type indicates that the image is a Portable Network Graphics (PNG) image.

-
- - A boundary diagram. - - -
-
- - Network Architecture - A description of the system's network architecture, optionally supplemented by diagrams that illustrate the network architecture. - - - Network Architecture Description - A summary of the system's network architecture. - - - - - - - - - - - - - - - - - -

A given uuid must be assigned only once to a diagram.

-
-
-
- -
- - Data Flow - A description of the logical flow of information within the system and across its boundaries, optionally supplemented by diagrams that illustrate these flows. - - - Data Flow Description - A summary of the system's data flow. - - - - - - - - - - - - - - - - - -

A given uuid must be assigned only once to a diagram.

-
-
-
-
- - - - - - System Implementation - Provides information as to how the system is implemented. - - - - - - - - - - Leveraged Authorization - A description of another authorized system from which this system inherits capabilities that satisfy security requirements. Another term for this concept is a common control provider. - - - - Leveraged Authorization Universally Unique Identifier - A globally unique identifier that can be used to reference this leveraged authorization entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - title field - A human readable name for the leveraged authorization in the context of the system. - - - - - - - - - party-uuid field - A reference to the party that manages the leveraged system. - - - - - - - A reference to the system security plan for the leveraged authorization. - - - - - - - - - - - user - - - - component - - - - - - -

A set of inventory-item entries that represent the managed inventory instances of the system.

-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The component allows an authenticated scan. - The component does not allow an authenticated scan. - - - - - - - -

A given uuid must be assigned only once to a user.

-
-
-
-
- - - Control Implementation - Describes how the system satisfies a set of controls. - - - Control Implementation Description - A statement describing important things to know about how this set of control satisfaction documentation is approached. - - - - - - - - - - - - -

Since multiple set-parameter entries can be provided, each parameter must be set only once.

-
-
-
- -

Use of set-parameter in this context, sets the parameter for all related controls referenced in an implemented-requirement. If the same parameter is also set in a specific implemented-requirement, then the new value will override this value.

-
-
- - Control-based Requirement - Describes how the system satisfies an individual control. - - Control Requirement Universally Unique Identifier - A globally unique identifier that can be used to reference this control requirement entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - - - - - - - - - - - - - - - - - - - - - - - - - Identifies the source of the implemented control. - - - The control is implemented by the organization owning the system, but is not specific to the system itself. - The control is implemented specifically to this system. - The control is provided by the system, but must be configured by the customer. - The control must be implemented by the customer. - This control is inherited from an underlying system. - - - Indicates all or some portion of this control is inherited from an underlying authorized system. - - - &allowed-values-responsible-roles-operations; - - - - - - - - - -

Since all implementation statements are defined at the by-component level (e.g., type=this-system), there must be at least one by-component.

-
-
- - - -

Since multiple set-parameter entries can be provided, each parameter must be set only once.

-
-
- - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
- - - -

Since statement entries can be referenced using the statement's statement-id, each statement must be referenced only once.

-
-
- - - -

Since by-component can reference component entries using the component's uuid, each component must be referenced only once. This ensures that all implementation statements are contained in the same by-component entry.

-
-
-
-
- - Specific Control Statement - Identifies which statements within a control are addressed. - - -

A reference to the specific implemented statement associated with a control.

-
-
- - Control Statement Reference Universally Unique Identifier - A globally unique identifier that can be used to reference this control statement entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - - - - - - - - - - - - - - - - &allowed-values-responsible-roles-operations; - - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
- - - -

Since by-component can reference component entries using the component's uuid, each component must be referenced only once. This ensures that all implementation statements are contained in the same by-component entry.

-
-
- -
-
- - - Component Control Implementation - Defines how the referenced component implements a set of controls. - - Component Universally Unique Identifier Reference - A reference to the component that is implementing a given control or control statement. - - - By-Component Universally Unique Identifier - A globally unique identifier that can be used to reference this by-component entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - Control Implementation Description - An implementation statement that describes how a control or a control statement is implemented within the referenced system component. - - - - - - - - - - - - -

The implementation-status is used to qualify the status value to indicate the degree to which the control is implemented.

-
-
- - Export - Identifies content intended for external consumption, such as with leveraged organizations. - - - Control Implementation Export Description - An implementation statement that describes the aspects of the control or control statement implementation that can be available to another system leveraging this system. - - - - - - - - - - Provided Control Implementation - Describes a capability which may be inherited by a leveraging system. - - - - Provided Universally Unique Identifier - A globally unique identifier that can be used to reference this provided entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - Provided Control Implementation Description - An implementation statement that describes the aspects of the control or control statement implementation that can be provided to another system leveraging this system. - - - - - - - - - - - - - - - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- - Control Implementation Responsibility - Describes a control implementation responsibility imposed on a leveraging system. - - - Responsibility Universally Unique Identifier - A globally unique identifier that can be used to reference this responsibility entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - - Control Implementation Responsibility Description - An implementation statement that describes the aspects of the control or control statement implementation that a leveraging system must implement to satisfy the control provided by a leveraged system. - - - - - - - - - - - -

A role defined at the by-component level takes precedence over the same role defined on the parent implemented-requirement or on the referenced component.

-
-
- -
- - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- -
- - - - - - - - - -
- - Inherited Control Implementation - Describes a control implementation inherited by a leveraging system. - - - - Inherited Universally Unique Identifier - A globally unique identifier that can be used to reference this inherited entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - - Inherited Control Implementation Description - An implementation statement that describes the aspects of a control or control statement implementation that a leveraging system is inheriting from a leveraged system. - - - - - - - - - - - - - - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- - Satisfied Control Implementation Responsibility - Describes how this system satisfies a responsibility imposed by a leveraged system. - - - - Satisfied Universally Unique Identifier - A globally unique identifier that can be used to reference this satisfied entry elsewhere in an OSCAL document. A UUID should be consistently used for a given resource across revisions of the document. - - - - - Satisfied Control Implementation Responsibility Description - An implementation statement that describes the aspects of a control or control statement implementation that a leveraging system is implementing based on a requirement from a leveraged system. - - - - - - - - - - - - - - - - - -

Since responsible-role associates multiple party-uuid entries with a single role-id, each role-id must be referenced only once.

-
-
-
-
- - - - - -
- - - &allowed-values-responsible-roles-operations; - &allowed-values-responsible-roles-component-production; - - - - -

Since multiple set-parameter entries can be provided, each parameter must be set only once.

-
-
-
-
- - - Provided UUID - Identifies a 'provided' assembly associated with this assembly. - - - - Provided UUID - Identifies a 'provided' assembly associated with this assembly. - -
diff --git a/test-suite/oscal/v1.0.0/readme.md b/test-suite/oscal/v1.0.0/readme.md deleted file mode 100644 index 0a95a4fee..000000000 --- a/test-suite/oscal/v1.0.0/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# OSCAL Metaschema Examples - -Copied here for convenience. Do not assume these are current without checking! diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component-type.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component-type.ent deleted file mode 100644 index 7f4f680f4..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component-type.ent +++ /dev/null @@ -1,12 +0,0 @@ -A connection to something outside this system. -Any software, operating system, or firmware. -A physical device. -A service that may provide APIs. -An enforceable policy. -A tangible asset used to provide physical protections or countermeasures. - -A list of steps or actions to take to achieve some end result. -An applicable plan. -Any guideline or recommendation. -Any organizational or industry standard. -An external assessment performed on some other component, that has been validated by a third-party. diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_link-rel.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_link-rel.ent deleted file mode 100644 index 6c37b1098..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_link-rel.ent +++ /dev/null @@ -1,8 +0,0 @@ -A reference to another component that this component has a dependency on. - -A reference to another component of component-type=validation, that is a validation (e.g., FIPS 140-2) for this component -A pointer to a validation record (e.g., FIPS 140-2) or other compliance information. - -A reference to the baseline template used to configure the asset. -This service is used by the referenced component identifier. -A link to the system security plan of the external system. diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_property-name.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_property-name.ent deleted file mode 100644 index 1b33e3c06..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_property-name.ent +++ /dev/null @@ -1,8 +0,0 @@ - -The version of the component. -The specific patch level of the component. -The model of the component. - -The date the component was released, such as a software release date or policy publication date. -Used with component-type='validation' to provide a well-known name for a kind of validation. -Used with component-type='validation' to indicate the validating body's assigned identifier for their validation of this component. diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_service.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_service.ent deleted file mode 100644 index 4a1e28f21..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_service.ent +++ /dev/null @@ -1,3 +0,0 @@ -This service is provided by the referenced component identifier. - -This service is used by the referenced component identifier. diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_software.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_software.ent deleted file mode 100644 index cc756b9e3..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_component_software.ent +++ /dev/null @@ -1 +0,0 @@ -If a "software" component-type, the identifier, such as a SWID tag, for the software component. diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_inventory-item_property-name.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_inventory-item_property-name.ent deleted file mode 100644 index cf26a06ff..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-component_inventory-item_property-name.ent +++ /dev/null @@ -1,13 +0,0 @@ - -Simple indication of the asset's function, such as Router, Storage Array, DNS Server. -An organizationally specific identifier that is used to uniquely identify a logical or tangible item by the organization that owns the item. -An asset tag assigned by the organization responsible for maintaining the logical or tangible item. -Identifies whether the asset is publicly accessible (yes/no) -Identifies whether the asset is virtualized (yes/no) -Virtual LAN identifier of the asset. -The network identifier of the asset. -A human-readable label for the parent context. -An alternative identifier, whose value is easily sortable among other such values in the document. -The name of the baseline configuration for the asset. -Can the asset be check with an authenticated scan? (yes/no) -The function provided by the asset for the system. diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-control-group-property-name.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-control-group-property-name.ent deleted file mode 100644 index c8f59dc6a..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-control-group-property-name.ent +++ /dev/null @@ -1,2 +0,0 @@ -A human-readable label for the parent context. -An alternative identifier, whose value is easily sortable among other such values in the document. diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-property-name-asset-type-values.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-property-name-asset-type-values.ent deleted file mode 100644 index 8f966e8fe..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-property-name-asset-type-values.ent +++ /dev/null @@ -1,14 +0,0 @@ - - -System software that manages computer hardware, software resources, and provides common services for computer programs. -An electronic collection of data, or information, that is specially organized for rapid search and retrieval. -A system that delivers content or services to end users over the Internet or an intranet. -A system that resolves domain names to internet protocol (IP) addresses. -A computer system that sends and receives electronic mail messages. -A system that stores, organizes and provides access to directory information in order to unify network resources. -A private branch exchange (PBX) provides a a private telephone switchboard. -A network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. -A physical or virtual networking device that forwards data packets between computer networks. -A physical or virtual networking device that connects devices within a computer network by using packet switching to receive and forward data to the destination device. -A consolidated, block-level data storage capability. -A physical or virtual machine that centralizes hardware, software, or services for a specific purpose. diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-responsible-roles-component-production.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-responsible-roles-component-production.ent deleted file mode 100644 index 3fa68e899..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-responsible-roles-component-production.ent +++ /dev/null @@ -1,2 +0,0 @@ -Responsible for the creation and maintenance of a component. -Organization responsible for providing the component, if this is different from the "maintainer" (e.g., a reseller). diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-responsible-roles-operations.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-responsible-roles-operations.ent deleted file mode 100644 index 5b5ab963b..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-responsible-roles-operations.ent +++ /dev/null @@ -1,10 +0,0 @@ -Accountable for ensuring the asset is managed in accordance with organizational policies and procedures. -Responsible for administering a set of assets. - -Members of the security operations center (SOC). - -Members of the network operations center (NOC). -Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions. -Responsible for providing information and support to users. - -Responsible for the configuration management processes governing changes to the asset. diff --git a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-responsible-roles-system.ent b/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-responsible-roles-system.ent deleted file mode 100644 index 30b7031d8..000000000 --- a/test-suite/oscal/v1.0.0/shared-constraints/allowed-values-responsible-roles-system.ent +++ /dev/null @@ -1,8 +0,0 @@ -The authorizing official for this system. -The authorizing official's designated point of contact (POC) for this system. -The executive ultimately accountable for the system. -The primary management-level point of contact (POC) for the system. -The primary technical point of contact (POC) for the system. -Other point of contact (POC) for the system that is not the management or technical POC. -The primary role responsible for ensuring the organization operates the system securely. -The point of contact (POC) responsible for identifying privacy information within the system, and ensuring its protection if present. diff --git a/test-suite/schema-generation/.gitignore b/test-suite/schema-generation/.gitignore new file mode 100644 index 000000000..81cef83d9 --- /dev/null +++ b/test-suite/schema-generation/.gitignore @@ -0,0 +1,6 @@ + +# test run outputs +current/ + +# XSpec outputs +/*-result.html diff --git a/test-suite/schema-generation/allowed-values/allowed-values-basic_metaschema.xml b/test-suite/schema-generation/allowed-values/allowed-values-basic_metaschema.xml index 137b98b5b..3d400cb1a 100644 --- a/test-suite/schema-generation/allowed-values/allowed-values-basic_metaschema.xml +++ b/test-suite/schema-generation/allowed-values/allowed-values-basic_metaschema.xml @@ -1,19 +1,18 @@ - + - + Metaschema Unit Test: allowed values 1.0-milestone1 metaschema-allowed-values http://csrc.nist.gov/ns/metaschema/unit-test/allowed-values + http://csrc.nist.gov/ns/metaschema/unit-test/allowed-values parent parent assembly parent - + Small odd flag Odd integers from 1 to 11 inclusive @@ -55,7 +54,7 @@ - + Small even flag Even integers from 2 to 10 inclusive diff --git a/test-suite/schema-generation/allowed-values/allowed-values-basic_test_baddates_FAIL.xml b/test-suite/schema-generation/allowed-values/allowed-values-basic_test_baddates_FAIL.xml deleted file mode 100644 index 224535041..000000000 --- a/test-suite/schema-generation/allowed-values/allowed-values-basic_test_baddates_FAIL.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - 2020-01-02 - - 2020-04-31 - - \ No newline at end of file diff --git a/test-suite/schema-generation/allowed-values/allowed-values-basic_test_okay_PASS.xml b/test-suite/schema-generation/allowed-values/allowed-values-basic_test_okay_PASS.xml deleted file mode 100644 index 345b7585b..000000000 --- a/test-suite/schema-generation/allowed-values/allowed-values-basic_test_okay_PASS.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - 2020-01-01 - - 2020-02-29 - - \ No newline at end of file diff --git a/test-suite/schema-generation/allowed-values/allowed-values-basic_test_valid_FAIL.xml b/test-suite/schema-generation/allowed-values/allowed-values-basic_test_valid_FAIL.xml new file mode 100644 index 000000000..3c6a2fa72 --- /dev/null +++ b/test-suite/schema-generation/allowed-values/allowed-values-basic_test_valid_FAIL.xml @@ -0,0 +1,10 @@ + + + 2022-06-22 + 2020-06-31 + + 2020-01-11 + + \ No newline at end of file diff --git a/test-suite/schema-generation/allowed-values/allowed-values-basic_test_valid_PASS.xml b/test-suite/schema-generation/allowed-values/allowed-values-basic_test_valid_PASS.xml new file mode 100644 index 000000000..efc96877a --- /dev/null +++ b/test-suite/schema-generation/allowed-values/allowed-values-basic_test_valid_PASS.xml @@ -0,0 +1,10 @@ + + + 2022-06-22 + 2020-06-30 + + 2020-01-11 + + \ No newline at end of file diff --git a/test-suite/schema-generation/allowed-values/allowed-values-basic_xml-schema.xsd b/test-suite/schema-generation/allowed-values/allowed-values-basic_xml-schema.xsd deleted file mode 100644 index d209bdea2..000000000 --- a/test-suite/schema-generation/allowed-values/allowed-values-basic_xml-schema.xsd +++ /dev/null @@ -1,197 +0,0 @@ - - - - - Metaschema Unit Test: allowed values - 1.0-milestone1 - metaschema-allowed-values - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - Small odd flag - Odd integers from 1 to 11 inclusive - - - Small odd flag: Odd integers from 1 to 11 inclusive - - - - - - -

One

-
-
-
- - - -

Three

-
-
-
- - - -

Five

-
-
-
- - - -

Seven

-
-
-
- - - -

Nine

-
-
-
- - - -

Eleven

-
-
-
-
-
-
-
- - - - child - child assembly - - - child: child assembly - - - - - - - - Small even flag - Even integers from 2 to 10 inclusive - - - Small even flag: Even integers from 2 to 10 inclusive - - - - - - -

Two

-
-
-
- - - -

Four

-
-
-
- - - -

Six

-
-
-
- - - -

Eight

-
-
-
- - - -

Ten

-
-
-
-
-
-
-
- - - - Date - One of several 2020 dates - - - Date: One of several 2020 dates - - - - - - - - - - -

New Year's Day 2020

-
-
-
- - - -

Leap Day 2020

-
-
-
- - - -

July Fourth 2020

-
-
-
-
-
-
diff --git a/test-suite/schema-generation/allowed-values/readme.md b/test-suite/schema-generation/allowed-values/readme.md new file mode 100644 index 000000000..253429005 --- /dev/null +++ b/test-suite/schema-generation/allowed-values/readme.md @@ -0,0 +1,13 @@ +# Allowed Values + +**Status** - down - in flux - come back to - + +**Dependendency** - architectural decisions re deployment of constraints validation capabilities (XML and JSON sides respectively) + +The `allowed-values` construct was our initial effort at values constraints, now being generalized as part of the constraints work. + +The tests here do not currently pass due to bugs in the mapping: + +- We do not get a numeric datatype in the JSON for PositiveInteger, shouldn't we? +- There is currently no support at all for examining / reporting against allowed values under XSD, whether under allow-other 'yes' or 'no' (?) + diff --git a/test-suite/schema-generation/allowed-values/target/allowed-values-basic_metaschema-jsonschema.json b/test-suite/schema-generation/allowed-values/target/allowed-values-basic_metaschema-jsonschema.json new file mode 100644 index 000000000..c82145ff3 --- /dev/null +++ b/test-suite/schema-generation/allowed-values/target/allowed-values-basic_metaschema-jsonschema.json @@ -0,0 +1,82 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/allowed-values/1.0-milestone1/metaschema-allowed-values-schema.json", + "$comment" : "Metaschema Unit Test: allowed values: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-allowed-values-metaschema-allowed-values:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-allowed-values_parent", + "type" : "object", + "properties" : + { "odd-flag" : + { "title" : "Small odd flag", + "description" : "Odd integers from 1 to 11 inclusive", + "type" : "integer", + "enum" : + [ 1, + 3, + 5, + 7, + 9, + 11 ] }, + "field-dates" : + { "anyOf" : + [ + { "$ref" : "#field_metaschema-allowed-values_field-date" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#field_metaschema-allowed-values_field-date" } } ] }, + "children" : + { "anyOf" : + [ + { "$ref" : "#assembly_metaschema-allowed-values_child" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#assembly_metaschema-allowed-values_child" } } ] } }, + "required" : + [ "odd-flag" ], + "additionalProperties" : false }, + "metaschema-allowed-values-metaschema-allowed-values:child" : + { "title" : "child", + "description" : "child assembly", + "$id" : "#assembly_metaschema-allowed-values_child", + "type" : "object", + "properties" : + { "even-flag" : + { "title" : "Small even flag", + "description" : "Even integers from 2 to 10 inclusive", + "type" : "integer", + "enum" : + [ 2, + 4, + 6, + 8, + 10 ] }, + "field-date" : + { "$ref" : "#field_metaschema-allowed-values_field-date" } }, + "required" : + [ "field-date" ], + "additionalProperties" : false }, + "metaschema-allowed-values-metaschema-allowed-values:field-date" : + { "title" : "Date", + "description" : "One of several 2020 dates", + "$id" : "#field_metaschema-allowed-values_field-date", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$", + "enum" : + [ "2020-01-01", + "2020-02-29", + "2020-07-04" ] } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-allowed-values_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/allowed-values/target/allowed-values-basic_metaschema-xmlschema.xsd b/test-suite/schema-generation/allowed-values/target/allowed-values-basic_metaschema-xmlschema.xsd new file mode 100644 index 000000000..56a245b2c --- /dev/null +++ b/test-suite/schema-generation/allowed-values/target/allowed-values-basic_metaschema-xmlschema.xsd @@ -0,0 +1,246 @@ + + + + + Metaschema Unit Test: allowed values + 1.0-milestone1 + metaschema-allowed-values + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + Small odd flag + Odd integers from 1 to 11 inclusive + + + Small odd flag: Odd integers from 1 to 11 inclusive + + + + + + + child + child assembly + + + child: child assembly + + + + + + + + Small even flag + Even integers from 2 to 10 inclusive + + + Small even flag: Even integers from 2 to 10 inclusive + + + + + + + Date + One of several 2020 dates + + + Date: One of several 2020 dates + + + + + + OSCAL reference for native type + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/char-handling/charstrings-test-json-converter.xsl b/test-suite/schema-generation/char-handling/charstrings-test-json-converter.xsl deleted file mode 100644 index da8aa21f8..000000000 --- a/test-suite/schema-generation/char-handling/charstrings-test-json-converter.xsl +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - language-{.} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ^\s*(\*|\d+\.)\s - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - &amp; - &lt; - - &quot; - - &#x2A; - &#x60; - &#x7E; - &#x5E; - - - - - - - - - - - - - - - - - "" - !\[{{$noclosebracket}}\] - - \(\) - `` - - \*\*\*\*\*\* - - \*\*\*\* - \*\* - ~~ - \^\^ - - - - < - - - - > - - </ - - > - - - - - - - - - - - - - - - - - - $1 - - - param-id='$1' - - - href='$2' - - - - alt='$1' - - - - src='$2' - - - - (.*?) - - - ([^{ @not }]*?) - - { insertion } - diff --git a/test-suite/schema-generation/char-handling/charstrings-test-schema.json b/test-suite/schema-generation/char-handling/charstrings-test-schema.json deleted file mode 100644 index db5cbdb9b..000000000 --- a/test-suite/schema-generation/char-handling/charstrings-test-schema.json +++ /dev/null @@ -1,46 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime-schema.json", - "$comment" : "Metaschema Unit Test: datatypes-dateTime: JSON Schema", - "type" : "object", - "definitions" : - { "examples" : - { "title" : "Examples", - "description" : "Some character strings of different sorts", - "$id" : "#/definitions/examples", - "type" : "object", - "properties" : - { "character-strings" : - { "anyOf" : - [ - { "$ref" : "#/definitions/charstring" }, - - { "type" : "array", - "items" : - { "$ref" : "#/definitions/charstring" }, - "minItems" : 2 } ] }, - "markup-lines" : - { "anyOf" : - [ - { "$ref" : "#/definitions/markupline" }, - - { "type" : "array", - "items" : - { "$ref" : "#/definitions/markupline" }, - "minItems" : 2 } ] } }, - "additionalProperties" : false }, - "charstring" : - { "title" : "Character string", - "description" : "String of characters", - "$id" : "#/definitions/charstring", - "type" : "string" }, - "markupline" : - { "title" : "Markup line", - "description" : "Characters, and more", - "$id" : "#/definitions/markupline", - "type" : "string" } }, - "properties" : - { "examples" : - { "$ref" : "#/definitions/examples" } }, - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/char-handling/charstrings-test-schema.xsd b/test-suite/schema-generation/char-handling/charstrings-test-schema.xsd deleted file mode 100644 index 49e95bc93..000000000 --- a/test-suite/schema-generation/char-handling/charstrings-test-schema.xsd +++ /dev/null @@ -1,285 +0,0 @@ - - - - - Metaschema Unit Test: datatypes-dateTime - 1.0-milestone1 - metaschema-datatypes-dateTime - examples - - - - - - Examples - Some character strings of different sorts - - - Examples: Some character strings of different sorts - - - - - - - - - - - - Character string - String of characters - - - Character string: String of characters - - - - - - - Markup line - Characters, and more - - - Markup line: Characters, and more - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test-suite/schema-generation/char-handling/charstrings-test-xml-converter.xsl b/test-suite/schema-generation/char-handling/charstrings-test-xml-converter.xsl deleted file mode 100644 index 8ce87a7a5..000000000 --- a/test-suite/schema-generation/char-handling/charstrings-test-xml-converter.xsl +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - no - - no - - - - - - { $json-indent='yes' } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - ## - ### - #### - ##### - ###### - - - - - - - - - - - | - --- | - - - - - | - - - | - - - - ``` - - - - ``` - - - - - - - - - - - - - - - * - - - - - - - - - - 1. - - - - - ` - - ` - - - * - - * - - - ** - - ** - - - " - - " - - - {{ - - }} - - - - [ - - ] - ( - - ) - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test-suite/schema-generation/char-handling/charstrings-test_okay-PASS-back.xml b/test-suite/schema-generation/char-handling/charstrings-test_okay-PASS-back.xml deleted file mode 100644 index 9600fff23..000000000 --- a/test-suite/schema-generation/char-handling/charstrings-test_okay-PASS-back.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - Here's a string including punctuation ' " \ . $ - Here's a string with an ampersand & - Less-than and greater-than, as <delimiters> ... - The star aka asterisk * may be magical and maybe also the tick ` - Also, occasionally we have links and other markup. - And sometimes, we have *very confusing stuff* as well. - diff --git a/test-suite/schema-generation/char-handling/charstrings-test_okay-PASS.json b/test-suite/schema-generation/char-handling/charstrings-test_okay-PASS.json deleted file mode 100644 index 915246302..000000000 --- a/test-suite/schema-generation/char-handling/charstrings-test_okay-PASS.json +++ /dev/null @@ -1,10 +0,0 @@ - - { "examples" : - { "character-strings" : - [ "Here's a string including punctuation ' \" \\ . $", - "Here's a string with an ampersand &", - "Less-than and greater-than, as ...", - "The star aka asterisk * may be magical and maybe also the tick `" ], - "markup-lines" : - [ "Also, occasionally we have [links](w3.org) and *other markup*.", - "And *sometimes*, we have \\*very confusing stuff\\* as well." ] } } \ No newline at end of file diff --git a/test-suite/schema-generation/char-handling/charstrings-test_xml-schema.xsd b/test-suite/schema-generation/char-handling/charstrings-test_xml-schema.xsd deleted file mode 100644 index 75002f573..000000000 --- a/test-suite/schema-generation/char-handling/charstrings-test_xml-schema.xsd +++ /dev/null @@ -1,278 +0,0 @@ - - - - - Metaschema Unit Test: datatypes-dateTime - 1.0-milestone1 - metaschema-datatypes-dateTime - examples - - - - - - - Examples - Some character strings of different sorts - - - Examples: Some character strings of different sorts - - - - - - - - - - Character string - String of characters - - - Character string: String of characters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test-suite/schema-generation/char-handling/refresh.sh b/test-suite/schema-generation/char-handling/refresh.sh deleted file mode 100644 index ab6c8adba..000000000 --- a/test-suite/schema-generation/char-handling/refresh.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -# Produces Metaschema artifacts from an OSCAL Metaschema metaschema -# Including XML and JSON schemas, conversion utilities (XSLTs) and Markdown documentation - -METASCHEMAXML=charstrings-test_metaschema.xml -BASENAME=charstrings-test - -OSCALDIR=../../../.. - -if [[ -z SAXON_HOME ]]; then - echo "SAXON_HOME is not set" - exit 1 -elif [[ -z "$SAXON_HOME" ]]; then - echo "SAXON_HOME is set to the empty string" - exit 1 -fi - -SAXON=$SAXON_HOME/Saxon-HE-9.9.1-3.jar - -if [ ! -f $SAXON ]; then - echo "The saxon library was not found at: $SAXON!" - exit 1 -fi - -# Saxon CL documented here: http://www.saxonica.com/documentation9.8/using-xsl/commandline.html - -LIBDIR=$OSCALDIR/build/metaschema -XSDDIR=. -JSONDIR=. -CONVERSION_DIR=. -CURRENT_DIR=$(pwd -W) -# DOCSDIR=docs - -echo Working in $CURRENT_DIR - -MAKE_XSD="java -jar $SAXON -s:$METASCHEMAXML -o:$XSDDIR/$BASENAME-schema.xsd -xsl:$LIBDIR/xml/produce-xsd.xsl" -MAKE_JSC="java -jar $SAXON -s:$METASCHEMAXML -o:$JSONDIR/$BASENAME-schema.json -xsl:$LIBDIR/json/produce-json-schema.xsl" - -CONV_XML="java -jar $SAXON -s:$METASCHEMAXML -o:$CONVERSION_DIR/$BASENAME-xml-converter.xsl -xsl:$LIBDIR/xml/produce-xml-converter.xsl" -CONV_JSON="java -jar $SAXON -s:$METASCHEMAXML -o:$CONVERSION_DIR/$BASENAME-json-converter.xsl -xsl:$LIBDIR/json/produce-json-converter.xsl" - -EXAMPLE_BASE=charstrings-test_okay-PASS - -EXAMPLE_JSON="java -jar $SAXON -s:$EXAMPLE_BASE.xml -o:$EXAMPLE_BASE.json -xsl:$CONVERSION_DIR/$BASENAME-xml-converter.xsl json-indent=yes" -EXAMPLE_BACK="java -jar $SAXON -it -o:$EXAMPLE_BASE-back.xml -xsl:$CONVERSION_DIR/$BASENAME-json-converter.xsl json-file=$CURRENT_DIR/$EXAMPLE_BASE.json" - -# DOCS_XSLT="java -jar $SAXON -s:$METASCHEMAXML -o:$LIBDIR/temp/$BASENAME-xml-docs-md.xsl -xsl:$LIBDIR/xml/produce-and-run-documentor.xsl" - -# Now ... -echo -echo Producing JSON and XML schemas and tools from $METASCHEMAXML ... -$MAKE_XSD -echo _ Made XSD ________________________ $XSDDIR/$BASENAME-schema.xsd -$MAKE_JSC -echo _ Made JSON Schema ________________ $JSONDIR/$BASENAME-schema.json -$CONV_XML -echo _ Made XML-to-JSON converter ______ $CONVERSION_DIR/$BASENAME-xml-converter.xsl -$CONV_JSON -echo _ Made JSON-to-XML converter ______ $CONVERSION_DIR/$BASENAME-json-converter.xsl -$EXAMPLE_JSON -echo _ Produced $EXAMPLE_BASE.json from $EXAMPLE_BASE.xml -$EXAMPLE_BACK -echo _ Produced $EXAMPLE_BASE-back.xml from $EXAMPLE_BASE.json - -# $DOCS_XSLT -# echo _ Made Metaschema documentation _ $DOCSDIR/${BASENAME}_xml.md $DOCSDIR/json_${BASENAME}_json.md -# echo diff --git a/test-suite/schema-generation/choice/choice-multiple_metaschema.xml b/test-suite/schema-generation/choice/choice-multiple_metaschema.xml new file mode 100644 index 000000000..22f71107d --- /dev/null +++ b/test-suite/schema-generation/choice/choice-multiple_metaschema.xml @@ -0,0 +1,39 @@ + + + Metaschema Unit Test: choice multiple choices + 1.0 + json-value-key-label + http://csrc.nist.gov/ns/metaschema/unit-test/choice + http://csrc.nist.gov/ns/metaschema/unit-test/choice + + + parent + parent assembly + parent + + + child + child assembly + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test-suite/schema-generation/choice/choice-multiple_test_multiple_PASS.json b/test-suite/schema-generation/choice/choice-multiple_test_multiple_PASS.json new file mode 100644 index 000000000..5185ce37b --- /dev/null +++ b/test-suite/schema-generation/choice/choice-multiple_test_multiple_PASS.json @@ -0,0 +1,32 @@ +{ + "parent": { + "children": [ + { + "non-choice": "1-1 and 2-1", + "choice-1-1": {}, + "choice-2-1": {}, + "choice-3-1": {} + }, + { + "non-choice": "1-1 and 2-2", + "choice-1-1": {}, + "choice-2-2": {}, + "choice-3-2": {} + }, + { + "non-choice": "1-2 and 2-1", + "choice-1-2": {}, + "choice-2-1": {}, + "choice-3-2": {} + }, + { + "non-choice": "1-2 and 2-2", + "choice-1-2": {}, + "choice-2-2": {}, + "choice-3-2": {} + }, + { "non-choice": "something", + "choice-3-2": {} } + ] + } +} \ No newline at end of file diff --git a/test-suite/schema-generation/choice/readme.md b/test-suite/schema-generation/choice/readme.md new file mode 100644 index 000000000..b43633eb8 --- /dev/null +++ b/test-suite/schema-generation/choice/readme.md @@ -0,0 +1,7 @@ +# Choice + +**Status** - up - bare bones - but runs - + +Shows the metaschema `choice` mechanism works as intended. + +Could use many more tests especially of invalid cases. diff --git a/test-suite/schema-generation/choice/target/choice-multiple_metaschema-jsonschema.json b/test-suite/schema-generation/choice/target/choice-multiple_metaschema-jsonschema.json new file mode 100644 index 000000000..13d3242a0 --- /dev/null +++ b/test-suite/schema-generation/choice/target/choice-multiple_metaschema-jsonschema.json @@ -0,0 +1,61 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/choice/1.0/json-value-key-label-schema.json", + "$comment" : "Metaschema Unit Test: choice multiple choices: JSON Schema", + "type" : "object", + "definitions" : + { "json-value-key-label-json-value-key-label:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_json-value-key-label_parent", + "type" : "object", + "properties" : + { "children" : + { "type" : "array", + "minItems" : 1, + "items" : + { "title" : "child", + "description" : "child assembly", + "type" : "object", + "properties" : + { "non-choice" : + { "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "choice-1-1" : + { "type" : "object", + "additionalProperties" : false }, + "choice-1-2" : + { "type" : "object", + "additionalProperties" : false }, + "choice-1-3" : + { "type" : "object", + "additionalProperties" : false }, + "choice-2-1" : + { "type" : "object", + "additionalProperties" : false }, + "choice-2-2" : + { "type" : "object", + "additionalProperties" : false }, + "choice-2-3" : + { "type" : "object", + "additionalProperties" : false }, + "choice-3-1" : + { "type" : "object", + "additionalProperties" : false }, + "choice-3-2" : + { "type" : "object", + "additionalProperties" : false }, + "choice-3-3" : + { "type" : "object", + "additionalProperties" : false } }, + "required" : + [ "non-choice" ], + "additionalProperties" : false } } }, + "additionalProperties" : false } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_json-value-key-label_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/choice/target/choice-multiple_metaschema-xmlschema.xsd b/test-suite/schema-generation/choice/target/choice-multiple_metaschema-xmlschema.xsd new file mode 100644 index 000000000..3926eae51 --- /dev/null +++ b/test-suite/schema-generation/choice/target/choice-multiple_metaschema-xmlschema.xsd @@ -0,0 +1,235 @@ + + + + + Metaschema Unit Test: choice multiple choices + 1.0 + json-value-key-label + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + child + child assembly + + + child: child assembly + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/collapsible/collapsible-no-op_metaschema.xml b/test-suite/schema-generation/collapsible/collapsible-no-op_metaschema.xml index 8dcfebc8f..ef492396e 100644 --- a/test-suite/schema-generation/collapsible/collapsible-no-op_metaschema.xml +++ b/test-suite/schema-generation/collapsible/collapsible-no-op_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: collapsible-no-op 1.0-milestone1 metaschema-collapsible-no-op http://csrc.nist.gov/ns/metaschema/unit-test/collapsible-no-op + http://csrc.nist.gov/ns/metaschema/unit-test/collapsible-no-op parent parent assembly diff --git a/test-suite/schema-generation/collapsible/collapsible_json-schema.json b/test-suite/schema-generation/collapsible/collapsible_json-schema.json deleted file mode 100644 index 79eb6eebe..000000000 --- a/test-suite/schema-generation/collapsible/collapsible_json-schema.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://csrc.nist.gov/ns/metaschema/unit-test/collapsible-schema.json", - "$comment": "Metaschema Unit Test: collapsible: JSON Schema", - "type": "object", - "definitions": { - "parent": { - "title": "parent", - "description": "parent assembly", - "$id": "#/definitions/parent", - "type": "object", - "properties": { - "props": { - "anyOf": [ - {"$ref": "#/definitions/prop"}, - { - "type": "array", - "items": {"$ref": "#/definitions/prop"}, - "minItems": 1 - } - ] - } - }, - "required": ["props"], - "additionalProperties": false - }, - "prop": { - "title": "prop", - "description": "prop field", - "$id": "#/definitions/prop", - "type": "object", - "properties": { - "name": { - "title": "A simple flag", - "description": "A simpleflag", - "type": "string" - }, - "STRVALUE": { - "anyOf": [ - {"type": "string"}, - { - "type": "array", - "items": {"type": "string"}, - "minItems": 1 - } - ] - } - }, - "required": ["STRVALUE"], - "additionalProperties": false - } - }, - "properties": { - "parent": {"$ref": "#/definitions/parent"} - }, - "required": ["parent"], - "additionalProperties": false, - "maxProperties": 1 -} \ No newline at end of file diff --git a/test-suite/schema-generation/collapsible/collapsible_metaschema.xml b/test-suite/schema-generation/collapsible/collapsible_metaschema.xml index c9b33b5f4..29cf48182 100644 --- a/test-suite/schema-generation/collapsible/collapsible_metaschema.xml +++ b/test-suite/schema-generation/collapsible/collapsible_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: collapsible 1.0-milestone1 metaschema-collapsible http://csrc.nist.gov/ns/metaschema/unit-test/collapsible + http://csrc.nist.gov/ns/metaschema/unit-test/collapsible parent parent assembly diff --git a/test-suite/schema-generation/collapsible/target/collapsible-no-op_metaschema-jsonschema.json b/test-suite/schema-generation/collapsible/target/collapsible-no-op_metaschema-jsonschema.json new file mode 100644 index 000000000..4db1e6061 --- /dev/null +++ b/test-suite/schema-generation/collapsible/target/collapsible-no-op_metaschema-jsonschema.json @@ -0,0 +1,37 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/collapsible-no-op/1.0-milestone1/metaschema-collapsible-no-op-schema.json", + "$comment" : "Metaschema Unit Test: collapsible-no-op: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-collapsible-no-op-metaschema-collapsible-no-op:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-collapsible-no-op_parent", + "type" : "object", + "properties" : + { "props" : + { "anyOf" : + [ + { "$ref" : "#field_metaschema-collapsible-no-op_prop" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#field_metaschema-collapsible-no-op_prop" } } ] } }, + "required" : + [ "props" ], + "additionalProperties" : false }, + "metaschema-collapsible-no-op-metaschema-collapsible-no-op:prop" : + { "title" : "prop", + "description" : "prop field", + "$id" : "#field_metaschema-collapsible-no-op_prop", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-collapsible-no-op_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/collapsible/target/collapsible-no-op_metaschema-xmlschema.xsd b/test-suite/schema-generation/collapsible/target/collapsible-no-op_metaschema-xmlschema.xsd new file mode 100644 index 000000000..165482292 --- /dev/null +++ b/test-suite/schema-generation/collapsible/target/collapsible-no-op_metaschema-xmlschema.xsd @@ -0,0 +1,198 @@ + + + + + Metaschema Unit Test: collapsible-no-op + 1.0-milestone1 + metaschema-collapsible-no-op + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + prop + prop field + + + prop: prop field + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/collapsible/target/collapsible_metaschema-jsonschema.json b/test-suite/schema-generation/collapsible/target/collapsible_metaschema-jsonschema.json new file mode 100644 index 000000000..ed6db01fe --- /dev/null +++ b/test-suite/schema-generation/collapsible/target/collapsible_metaschema-jsonschema.json @@ -0,0 +1,47 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/collapsible/1.0-milestone1/metaschema-collapsible-schema.json", + "$comment" : "Metaschema Unit Test: collapsible: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-collapsible-metaschema-collapsible:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-collapsible_parent", + "type" : "object", + "properties" : + { "props" : + { "anyOf" : + [ + { "$ref" : "#field_metaschema-collapsible_prop" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#field_metaschema-collapsible_prop" } } ] } }, + "required" : + [ "props" ], + "additionalProperties" : false }, + "metaschema-collapsible-metaschema-collapsible:prop" : + { "title" : "prop", + "description" : "prop field", + "$id" : "#field_metaschema-collapsible_prop", + "type" : "object", + "properties" : + { "name" : + { "title" : "A simple flag", + "description" : "A simpleflag", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-collapsible_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/collapsible/target/collapsible_metaschema-xmlschema.xsd b/test-suite/schema-generation/collapsible/target/collapsible_metaschema-xmlschema.xsd new file mode 100644 index 000000000..f11919553 --- /dev/null +++ b/test-suite/schema-generation/collapsible/target/collapsible_metaschema-xmlschema.xsd @@ -0,0 +1,211 @@ + + + + + Metaschema Unit Test: collapsible + 1.0-milestone1 + metaschema-collapsible + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + prop + prop field + + + prop: prop field + + + + + + + A simple flag + A simpleflag + + + A simple flag: A simpleflag + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/char-handling/charstrings-test_metaschema.xml b/test-suite/schema-generation/datatypes/charstrings_metaschema.xml similarity index 80% rename from test-suite/schema-generation/char-handling/charstrings-test_metaschema.xml rename to test-suite/schema-generation/datatypes/charstrings_metaschema.xml index 49bad9a51..6f2171ad2 100644 --- a/test-suite/schema-generation/char-handling/charstrings-test_metaschema.xml +++ b/test-suite/schema-generation/datatypes/charstrings_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: datatypes-dateTime 1.0-milestone1 metaschema-datatypes-dateTime http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime Examples Some character strings of different sorts diff --git a/test-suite/schema-generation/datatypes/charstrings_test_okay_PASS.json b/test-suite/schema-generation/datatypes/charstrings_test_okay_PASS.json new file mode 100644 index 000000000..3a0719b63 --- /dev/null +++ b/test-suite/schema-generation/datatypes/charstrings_test_okay_PASS.json @@ -0,0 +1,15 @@ +{ + "$schema": "charstrings_json-schema.json", + "examples": { + "character-strings": [ + "Here's a string including punctuation ' \" \\ . $", + "Here's a string with an ampersand &", + "Less-than and greater-than, as ...", + "The star aka asterisk * may be magical and maybe also the tick `" + ], + "markup-lines": [ + "Also, occasionally we have [links](w3.org) and *other markup*.", + "And *sometimes*, we have \\*very confusing stuff\\* as well." + ] + } +} \ No newline at end of file diff --git a/test-suite/schema-generation/char-handling/charstrings-test_okay-PASS.xml b/test-suite/schema-generation/datatypes/charstrings_test_okay_PASS.xml similarity index 93% rename from test-suite/schema-generation/char-handling/charstrings-test_okay-PASS.xml rename to test-suite/schema-generation/datatypes/charstrings_test_okay_PASS.xml index 1cde31a7d..778bc76cb 100644 --- a/test-suite/schema-generation/char-handling/charstrings-test_okay-PASS.xml +++ b/test-suite/schema-generation/datatypes/charstrings_test_okay_PASS.xml @@ -1,6 +1,6 @@ Here's a string including punctuation ' " \ . $ Here's a string with an ampersand & diff --git a/test-suite/schema-generation/datatypes/datatypes-date_metaschema.xml b/test-suite/schema-generation/datatypes/datatypes-date_metaschema.xml index fe77e30c9..6bf071937 100644 --- a/test-suite/schema-generation/datatypes/datatypes-date_metaschema.xml +++ b/test-suite/schema-generation/datatypes/datatypes-date_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: datatypes-dateTime 1.0-milestone1 metaschema-datatypes-dateTime http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime parent parent assembly diff --git a/test-suite/schema-generation/datatypes/datatypes-date_test_fancy_FAIL.xml b/test-suite/schema-generation/datatypes/datatypes-date_test_fancy_FAIL.xml index 0b88f44c1..7e4dd1163 100644 --- a/test-suite/schema-generation/datatypes/datatypes-date_test_fancy_FAIL.xml +++ b/test-suite/schema-generation/datatypes/datatypes-date_test_fancy_FAIL.xml @@ -1,7 +1,5 @@ - + jUNE 23 2020.06.23 6/23/2020 diff --git a/test-suite/schema-generation/datatypes/datatypes-date_test_valid_PASS.json b/test-suite/schema-generation/datatypes/datatypes-date_test_valid_PASS.json index de928f06a..2672ca7f5 100644 --- a/test-suite/schema-generation/datatypes/datatypes-date_test_valid_PASS.json +++ b/test-suite/schema-generation/datatypes/datatypes-date_test_valid_PASS.json @@ -11,7 +11,7 @@ ], "children": { - "field-date": "1990-08-22T12:20:00-05:00" + "field-date": "1990-08-22-05:00" } } } diff --git a/test-suite/schema-generation/datatypes/datatypes-date_test_valid_PASS.xml b/test-suite/schema-generation/datatypes/datatypes-date_test_valid_PASS.xml index 7a0e8f3f4..450d58b38 100644 --- a/test-suite/schema-generation/datatypes/datatypes-date_test_valid_PASS.xml +++ b/test-suite/schema-generation/datatypes/datatypes-date_test_valid_PASS.xml @@ -1,7 +1,6 @@ + flag-date="2020-06-23Z"> 2020-06-23Z 2020-06-23-04:00 2020-06-23 diff --git a/test-suite/schema-generation/datatypes/datatypes-date_xml-schema.xsd b/test-suite/schema-generation/datatypes/datatypes-date_xml-schema.xsd deleted file mode 100644 index cf542bfda..000000000 --- a/test-suite/schema-generation/datatypes/datatypes-date_xml-schema.xsd +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Metaschema Unit Test: datatypes-dateTime - 1.0-milestone1 - metaschema-datatypes-dateTime - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - Date Flag - date flag, time zone optional - - - Date Flag: date flag, time zone optional - - - - - - - child - child assembly - - - child: child assembly - - - - - - - - - Date - Time zone optional - - - Date: Time zone optional - - - - - - diff --git a/test-suite/schema-generation/datatypes/datatypes-datetime-no-tz_metaschema.xml b/test-suite/schema-generation/datatypes/datatypes-datetime-no-tz_metaschema.xml index b4b08ee41..b90abde11 100644 --- a/test-suite/schema-generation/datatypes/datatypes-datetime-no-tz_metaschema.xml +++ b/test-suite/schema-generation/datatypes/datatypes-datetime-no-tz_metaschema.xml @@ -1,19 +1,18 @@ - + - + Metaschema Unit Test: datatypes-dateTime 1.0-milestone1 metaschema-datatypes-dateTime http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime parent parent assembly parent - + Date and Time Flag datetime flag @@ -33,7 +32,7 @@ - + Date and Time No time zone diff --git a/test-suite/schema-generation/datatypes/datatypes-datetime-no-tz_xml-schema.xsd b/test-suite/schema-generation/datatypes/datatypes-datetime-no-tz_xml-schema.xsd deleted file mode 100644 index be3302dc7..000000000 --- a/test-suite/schema-generation/datatypes/datatypes-datetime-no-tz_xml-schema.xsd +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Metaschema Unit Test: datatypes-dateTime - 1.0-milestone1 - metaschema-datatypes-dateTime - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - Date and Time Flag - datetime flag - - - Date and Time Flag: datetime flag - - - - - - - child - child assembly - - - child: child assembly - - - - - - - - - Date and Time - No time zone - - - Date and Time: No time zone - - - - - - diff --git a/test-suite/schema-generation/datatypes/datatypes-datetime_json-schema.json b/test-suite/schema-generation/datatypes/datatypes-datetime_json-schema.json deleted file mode 100644 index 14bb7b6af..000000000 --- a/test-suite/schema-generation/datatypes/datatypes-datetime_json-schema.json +++ /dev/null @@ -1,64 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime-schema.json", - "$comment" : "Metaschema Unit Test: datatypes-dateTime: JSON Schema", - "type" : "object", - "definitions" : - { "parent" : - { "title" : "parent", - "description" : "parent assembly", - "$id" : "#/definitions/parent", - "type" : "object", - "properties" : - { "flag-datetime" : - { "title" : "Date and Time Flag", - "description" : "datetime flag", - "type" : "string", - "format" : "date-time", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$" }, - "field-datetimes" : - { "anyOf" : - [ - { "$ref" : "#/definitions/field-datetime" }, - - { "type" : "array", - "items" : - { "$ref" : "#/definitions/field-datetime" }, - "minItems" : 1 } ] }, - "children" : - { "anyOf" : - [ - { "$ref" : "#/definitions/child" }, - - { "type" : "array", - "items" : - { "$ref" : "#/definitions/child" }, - "minItems" : 1 } ] } }, - "required" : - [ "flag-datetime" ], - "additionalProperties" : false }, - "child" : - { "title" : "child", - "description" : "child assembly", - "$id" : "#/definitions/child", - "type" : "object", - "properties" : - { "field-datetime" : - { "$ref" : "#/definitions/field-datetime" } }, - "required" : - [ "field-datetime" ], - "additionalProperties" : false }, - "field-datetime" : - { "title" : "Date and Time", - "description" : "With time zone", - "$id" : "#/definitions/field-datetime", - "type" : "string", - "format" : "date-time", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$" } }, - "properties" : - { "parent" : - { "$ref" : "#/definitions/parent" } }, - "required" : - [ "parent" ], - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/datatypes-datetime_metaschema.xml b/test-suite/schema-generation/datatypes/datatypes-datetime_metaschema.xml index bfca0564d..778dfc2f5 100644 --- a/test-suite/schema-generation/datatypes/datatypes-datetime_metaschema.xml +++ b/test-suite/schema-generation/datatypes/datatypes-datetime_metaschema.xml @@ -1,20 +1,19 @@ - + - + Metaschema Unit Test: datatypes-dateTime 1.0-milestone1 metaschema-datatypes-dateTime http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime parent parent assembly parent Date and Time Flag datetime flag @@ -35,7 +34,7 @@ - + Date and Time With time zone diff --git a/test-suite/schema-generation/datatypes/datatypes-datetime_xml-schema.xsd b/test-suite/schema-generation/datatypes/datatypes-datetime_xml-schema.xsd deleted file mode 100644 index e538b7489..000000000 --- a/test-suite/schema-generation/datatypes/datatypes-datetime_xml-schema.xsd +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Metaschema Unit Test: datatypes-dateTime - 1.0-milestone1 - metaschema-datatypes-dateTime - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - Date and Time Flag - datetime flag - - - Date and Time Flag: datetime flag - - - - - - - child - child assembly - - - child: child assembly - - - - - - - - - Date and Time - With time zone - - - Date and Time: With time zone - - - - - - - - The xs:dateTime with a required timezone. - - - - - - diff --git a/test-suite/schema-generation/datatypes/datatypes-numeric_metaschema.xml b/test-suite/schema-generation/datatypes/datatypes-numeric_metaschema.xml new file mode 100644 index 000000000..2299f5007 --- /dev/null +++ b/test-suite/schema-generation/datatypes/datatypes-numeric_metaschema.xml @@ -0,0 +1,34 @@ + + + + + + Metaschema Unit Test: URIs + 1.0-milestone1 + metaschema-datatypes-uri + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri + + Number set + Block of four different numbers + numSet + + + Integer + Per W3C + + + Positive Integer + 1 or more + + + Non-negative Integer + zero or more + + + Decimal + Floating point + + + + diff --git a/test-suite/schema-generation/datatypes/datatypes-prose_metaschema.xml b/test-suite/schema-generation/datatypes/datatypes-prose_metaschema.xml index df87b4b4e..b7737f93a 100644 --- a/test-suite/schema-generation/datatypes/datatypes-prose_metaschema.xml +++ b/test-suite/schema-generation/datatypes/datatypes-prose_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: datatypes 1.0-milestone1 metaschema-datatypes http://csrc.nist.gov/ns/metaschema/unit-test/datatypes + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes parent parent assembly @@ -34,7 +33,7 @@ Plain text plain text, no markup - + Length The length. @@ -46,7 +45,7 @@ Rich text Rich text supports markup - + Length The length. @@ -58,7 +57,7 @@ Prose Prose permits multiple paragraphs, lists, tables etc. - + Length The length. diff --git a/test-suite/schema-generation/datatypes/datatypes-prose_test_valid_PASS.json b/test-suite/schema-generation/datatypes/datatypes-prose_test_valid_PASS.json index 33f2d3075..0dce8cea4 100644 --- a/test-suite/schema-generation/datatypes/datatypes-prose_test_valid_PASS.json +++ b/test-suite/schema-generation/datatypes/datatypes-prose_test_valid_PASS.json @@ -1,6 +1,6 @@ { "parent": { - "field-date": "2019-07-08TZ", + "field-date": "2019-07-08Z", "field-plaintext": "Some *plain* text", "field-richtext": "Some *rich* text", "field-prose": "Here's some *extra prose*" diff --git a/test-suite/schema-generation/datatypes/datatypes-prose_xml-schema.xsd b/test-suite/schema-generation/datatypes/datatypes-prose_xml-schema.xsd deleted file mode 100644 index b377aeb5f..000000000 --- a/test-suite/schema-generation/datatypes/datatypes-prose_xml-schema.xsd +++ /dev/null @@ -1,393 +0,0 @@ - - - - - Metaschema Unit Test: datatypes - 1.0-milestone1 - metaschema-datatypes - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - - - Prose - Prose permits multiple paragraphs, lists, tables etc. - - - Prose: Prose permits multiple paragraphs, lists, tables etc. - - - - - - - - - Prose - Prose permits multiple paragraphs, lists, tables etc. - - - Prose: Prose permits multiple paragraphs, lists, tables etc. - - - - - - - - - - - Date - With time zone - - - Date: With time zone - - - - - - - - - Plain text - plain text, no markup - - - Plain text: plain text, no markup - - - - - - - - - Plain text - plain text, no markup - - - Plain text: plain text, no markup - - - - - - - Length - The length. - - - Length: The length. - - - - - - - - - - - - - - Length - The length. - - - Length: The length. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The xs:date with a required timezone. - - - - - - diff --git a/test-suite/schema-generation/datatypes/datatypes-token_metaschema.xml b/test-suite/schema-generation/datatypes/datatypes-token_metaschema.xml new file mode 100644 index 000000000..3bc566cbc --- /dev/null +++ b/test-suite/schema-generation/datatypes/datatypes-token_metaschema.xml @@ -0,0 +1,23 @@ + + + + + + Metaschema Unit Test: URIs + 1.0-milestone1 + metaschema-datatypes-uri + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri + + parent + parent assembly + parent + + + Token fields + Each field a single token + + + + + diff --git a/test-suite/schema-generation/datatypes/datatypes-token_test_invalid_FAIL.json b/test-suite/schema-generation/datatypes/datatypes-token_test_invalid_FAIL.json new file mode 100644 index 000000000..a381148ef --- /dev/null +++ b/test-suite/schema-generation/datatypes/datatypes-token_test_invalid_FAIL.json @@ -0,0 +1,6 @@ +{ + "$schema": "../../../../../metaschema-schema-generator/test-schemagen/datatypes/datatypes-token_schema.json", + "parent": { + "token-field": [ ".🚀🛑" ] + } +} \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/datatypes-token_test_valid_PASS.json b/test-suite/schema-generation/datatypes/datatypes-token_test_valid_PASS.json new file mode 100644 index 000000000..345da4f26 --- /dev/null +++ b/test-suite/schema-generation/datatypes/datatypes-token_test_valid_PASS.json @@ -0,0 +1,6 @@ +{ + "$schema": "../../../../../metaschema-schema-generator/test-schemagen/datatypes/datatypes-token_schema.json", + "parent": { + "token-field": [ "Straßer", "Müller", "Adèle", "Yiğit", "ğ0·." ] + } +} \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/datatypes-uri_metaschema.xml b/test-suite/schema-generation/datatypes/datatypes-uri_metaschema.xml index 3a0b90dcf..cef24b8d1 100644 --- a/test-suite/schema-generation/datatypes/datatypes-uri_metaschema.xml +++ b/test-suite/schema-generation/datatypes/datatypes-uri_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: URIs 1.0-milestone1 metaschema-datatypes-uri http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri parent parent assembly diff --git a/test-suite/schema-generation/datatypes/datatypes-uri_test_broken_FAIL.json b/test-suite/schema-generation/datatypes/datatypes-uri_test_broken_FAIL.json index f3d397c10..206d582da 100644 --- a/test-suite/schema-generation/datatypes/datatypes-uri_test_broken_FAIL.json +++ b/test-suite/schema-generation/datatypes/datatypes-uri_test_broken_FAIL.json @@ -1,6 +1,6 @@ { "parent": { - "uri-flag": "//pages.nist.gov/OSCAL", + "uri-flag": "pages.nist.gov/OSCAL", "uri-reference-flag": "c:\\OSCAL", "uri-fields": [ "https://www.w3.org{}", diff --git a/test-suite/schema-generation/datatypes/datatypes-uri_xml-schema.xsd b/test-suite/schema-generation/datatypes/datatypes-uri_xml-schema.xsd deleted file mode 100644 index 562830cad..000000000 --- a/test-suite/schema-generation/datatypes/datatypes-uri_xml-schema.xsd +++ /dev/null @@ -1,107 +0,0 @@ - - - - - Metaschema Unit Test: URIs - 1.0-milestone1 - metaschema-datatypes-uri - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - Universal Resource Identifier Flag - Per W3C - - - Universal Resource Identifier Flag: Per W3C - - - - - - Universal Resource Identifier Reference Flag - Per W3C, can be a relative URI - - - Universal Resource Identifier Reference Flag: Per W3C, can be a relative URI - - - - - - - Universal Resource Identifier Flag - Per W3C - - - Universal Resource Identifier Flag: Per W3C - - - - - - - - - Universal Resource Identifier Flag - Per W3C - - - Universal Resource Identifier Flag: Per W3C - - - - - - - - A URI - - - - - - Requires a scheme with colon per RFC 3986 - - - - - - - A URI reference, such as a relative URL - - - - - - diff --git a/test-suite/schema-generation/datatypes/datatypes-uuid_json-schema.json b/test-suite/schema-generation/datatypes/datatypes-uuid_json-schema.json deleted file mode 100644 index d030b97e6..000000000 --- a/test-suite/schema-generation/datatypes/datatypes-uuid_json-schema.json +++ /dev/null @@ -1,42 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri-schema.json", - "$comment" : "Metaschema Unit Test: UUID Datatype: JSON Schema", - "type" : "object", - "definitions" : - { "parent" : - { "title" : "parent", - "description" : "parent assembly", - "$id" : "#/definitions/parent", - "type" : "object", - "properties" : - { "uuid-flag" : - { "title" : "Universally Unique Identifier Flag", - "description" : "A version 4 UUID per RFC 4122.", - "type" : "string", - "pattern" : "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" }, - "uuid-fields" : - { "anyOf" : - [ - { "$ref" : "#/definitions/uuid-field" }, - - { "type" : "array", - "items" : - { "$ref" : "#/definitions/uuid-field" }, - "minItems" : 1 } ] } }, - "required" : - [ "uuid-flag" ], - "additionalProperties" : false }, - "uuid-field" : - { "title" : "Universally Unique Identifier Field", - "description" : "A version 4 UUID per RFC 4122.", - "$id" : "#/definitions/uuid-field", - "type" : "string", - "pattern" : "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" } }, - "properties" : - { "parent" : - { "$ref" : "#/definitions/parent" } }, - "required" : - [ "parent" ], - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/datatypes-uuid_metaschema.xml b/test-suite/schema-generation/datatypes/datatypes-uuid_metaschema.xml index 8b33d348f..b610c1e67 100644 --- a/test-suite/schema-generation/datatypes/datatypes-uuid_metaschema.xml +++ b/test-suite/schema-generation/datatypes/datatypes-uuid_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: UUID Datatype 1.0-milestone2 metaschema-datatypes-uuid http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri parent parent assembly diff --git a/test-suite/schema-generation/datatypes/datatypes-uuid_xml-schema.xsd b/test-suite/schema-generation/datatypes/datatypes-uuid_xml-schema.xsd deleted file mode 100644 index 4321b850f..000000000 --- a/test-suite/schema-generation/datatypes/datatypes-uuid_xml-schema.xsd +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Metaschema Unit Test: UUID Datatype - 1.0-milestone2 - metaschema-datatypes-uuid - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - Universally Unique Identifier Flag - A version 4 UUID per RFC 4122. - - - Universally Unique Identifier Flag: A version 4 UUID per RFC 4122. - - - - - - - Universally Unique Identifier Field - A version 4 UUID per RFC 4122. - - - Universally Unique Identifier Field: A version 4 UUID per RFC 4122. - - - - - - - - A Type 4 ('random' or 'pseudorandom' UUID per RFC 4122 - - - - - - A sequence of 8-4-4-4-12 hex digits, with extra constraints in the 13th and 17-18th places for version 4 - - - - - diff --git a/test-suite/schema-generation/datatypes/readme.md b/test-suite/schema-generation/datatypes/readme.md new file mode 100644 index 000000000..af30e4e89 --- /dev/null +++ b/test-suite/schema-generation/datatypes/readme.md @@ -0,0 +1,10 @@ +# Datatypes + +**Status** - untested, unknown - + +The metaschemas here all successfully build schemas, invoking various data types for purpose of exercising lexical constraint testing (for example, does a URI look sufficiently like a URI). + +These tests are known to have run in the past but current status is not confirmed. + +Work item: split this directory into several. + diff --git a/test-suite/schema-generation/datatypes/target/charstrings_metaschema-jsonschema.json b/test-suite/schema-generation/datatypes/target/charstrings_metaschema-jsonschema.json new file mode 100644 index 000000000..e90be3f14 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/charstrings_metaschema-jsonschema.json @@ -0,0 +1,49 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime/1.0-milestone1/metaschema-datatypes-dateTime-schema.json", + "$comment" : "Metaschema Unit Test: datatypes-dateTime: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:examples" : + { "title" : "Examples", + "description" : "Some character strings of different sorts", + "$id" : "#assembly_metaschema-datatypes-dateTime_examples", + "type" : "object", + "properties" : + { "character-strings" : + { "anyOf" : + [ + { "$ref" : "#field_metaschema-datatypes-dateTime_charstring" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#field_metaschema-datatypes-dateTime_charstring" } } ] }, + "markup-lines" : + { "anyOf" : + [ + { "$ref" : "#field_metaschema-datatypes-dateTime_markupline" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#field_metaschema-datatypes-dateTime_markupline" } } ] } }, + "additionalProperties" : false }, + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:charstring" : + { "title" : "Character string", + "description" : "String of characters", + "$id" : "#field_metaschema-datatypes-dateTime_charstring", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:markupline" : + { "title" : "Markup line", + "description" : "Characters, and more", + "$id" : "#field_metaschema-datatypes-dateTime_markupline", + "type" : "string" } }, + "properties" : + { "examples" : + { "$ref" : "#assembly_metaschema-datatypes-dateTime_examples" } }, + "required" : + [ "examples" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/target/charstrings_metaschema-xmlschema.xsd b/test-suite/schema-generation/datatypes/target/charstrings_metaschema-xmlschema.xsd new file mode 100644 index 000000000..e90be3f14 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/charstrings_metaschema-xmlschema.xsd @@ -0,0 +1,49 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime/1.0-milestone1/metaschema-datatypes-dateTime-schema.json", + "$comment" : "Metaschema Unit Test: datatypes-dateTime: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:examples" : + { "title" : "Examples", + "description" : "Some character strings of different sorts", + "$id" : "#assembly_metaschema-datatypes-dateTime_examples", + "type" : "object", + "properties" : + { "character-strings" : + { "anyOf" : + [ + { "$ref" : "#field_metaschema-datatypes-dateTime_charstring" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#field_metaschema-datatypes-dateTime_charstring" } } ] }, + "markup-lines" : + { "anyOf" : + [ + { "$ref" : "#field_metaschema-datatypes-dateTime_markupline" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#field_metaschema-datatypes-dateTime_markupline" } } ] } }, + "additionalProperties" : false }, + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:charstring" : + { "title" : "Character string", + "description" : "String of characters", + "$id" : "#field_metaschema-datatypes-dateTime_charstring", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:markupline" : + { "title" : "Markup line", + "description" : "Characters, and more", + "$id" : "#field_metaschema-datatypes-dateTime_markupline", + "type" : "string" } }, + "properties" : + { "examples" : + { "$ref" : "#assembly_metaschema-datatypes-dateTime_examples" } }, + "required" : + [ "examples" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/datatypes-date_json-schema.json b/test-suite/schema-generation/datatypes/target/datatypes-date_metaschema-jsonschema.json similarity index 59% rename from test-suite/schema-generation/datatypes/datatypes-date_json-schema.json rename to test-suite/schema-generation/datatypes/target/datatypes-date_metaschema-jsonschema.json index af1c7c67d..2ed5a727e 100644 --- a/test-suite/schema-generation/datatypes/datatypes-date_json-schema.json +++ b/test-suite/schema-generation/datatypes/target/datatypes-date_metaschema-jsonschema.json @@ -1,61 +1,61 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime/1.0-milestone1/metaschema-datatypes-dateTime-schema.json", "$comment" : "Metaschema Unit Test: datatypes-dateTime: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-datatypes-dateTime_parent", "type" : "object", "properties" : { "flag-date" : - { "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$", - "title" : "Date Flag", - "description" : "date flag, time zone optional" }, + { "title" : "Date Flag", + "description" : "date flag, time zone optional", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, "field-dates" : { "anyOf" : [ - { "$ref" : "#/definitions/field-date" }, + { "$ref" : "#field_metaschema-datatypes-dateTime_field-date" }, { "type" : "array", + "minItems" : 1, "items" : - { "$ref" : "#/definitions/field-date" }, - "minItems" : 1 } ] }, + { "$ref" : "#field_metaschema-datatypes-dateTime_field-date" } } ] }, "children" : { "anyOf" : [ - { "$ref" : "#/definitions/child" }, + { "$ref" : "#assembly_metaschema-datatypes-dateTime_child" }, { "type" : "array", + "minItems" : 1, "items" : - { "$ref" : "#/definitions/child" }, - "minItems" : 1 } ] } }, + { "$ref" : "#assembly_metaschema-datatypes-dateTime_child" } } ] } }, "required" : [ "flag-date" ], "additionalProperties" : false }, - "child" : + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:child" : { "title" : "child", "description" : "child assembly", - "$id" : "#/definitions/child", + "$id" : "#assembly_metaschema-datatypes-dateTime_child", "type" : "object", "properties" : { "field-date" : - { "$ref" : "#/definitions/field-date" } }, + { "$ref" : "#field_metaschema-datatypes-dateTime_field-date" } }, "required" : [ "field-date" ], "additionalProperties" : false }, - "field-date" : + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:field-date" : { "title" : "Date", "description" : "Time zone optional", - "$id" : "#/definitions/field-date", + "$id" : "#field_metaschema-datatypes-dateTime_field-date", "type" : "string", "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-datatypes-dateTime_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/datatypes/target/datatypes-date_metaschema-xmlschema.xsd b/test-suite/schema-generation/datatypes/target/datatypes-date_metaschema-xmlschema.xsd new file mode 100644 index 000000000..eccb22c53 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-date_metaschema-xmlschema.xsd @@ -0,0 +1,228 @@ + + + + + Metaschema Unit Test: datatypes-dateTime + 1.0-milestone1 + metaschema-datatypes-dateTime + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + Date Flag + date flag, time zone optional + + + Date Flag: date flag, time zone optional + + + + + + + child + child assembly + + + child: child assembly + + + + + + + + + Date + Time zone optional + + + Date: Time zone optional + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/datatypes/target/datatypes-datetime-no-tz_metaschema-jsonschema.json b/test-suite/schema-generation/datatypes/target/datatypes-datetime-no-tz_metaschema-jsonschema.json new file mode 100644 index 000000000..a8de72263 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-datetime-no-tz_metaschema-jsonschema.json @@ -0,0 +1,60 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime/1.0-milestone1/metaschema-datatypes-dateTime-schema.json", + "$comment" : "Metaschema Unit Test: datatypes-dateTime: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-datatypes-dateTime_parent", + "type" : "object", + "properties" : + { "flag-datetime-notz" : + { "title" : "Date and Time Flag", + "description" : "datetime flag", + "type" : "string" }, + "field-datetimes-notz" : + { "anyOf" : + [ + { "$ref" : "#field_metaschema-datatypes-dateTime_field-datetime-notz" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#field_metaschema-datatypes-dateTime_field-datetime-notz" } } ] }, + "children" : + { "anyOf" : + [ + { "$ref" : "#assembly_metaschema-datatypes-dateTime_child" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#assembly_metaschema-datatypes-dateTime_child" } } ] } }, + "required" : + [ "flag-datetime-notz" ], + "additionalProperties" : false }, + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:child" : + { "title" : "child", + "description" : "child assembly", + "$id" : "#assembly_metaschema-datatypes-dateTime_child", + "type" : "object", + "properties" : + { "field-datetime-notz" : + { "$ref" : "#field_metaschema-datatypes-dateTime_field-datetime-notz" } }, + "required" : + [ "field-datetime-notz" ], + "additionalProperties" : false }, + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:field-datetime-notz" : + { "title" : "Date and Time", + "description" : "No time zone", + "$id" : "#field_metaschema-datatypes-dateTime_field-datetime-notz", + "type" : "string" } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-datatypes-dateTime_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/target/datatypes-datetime-no-tz_metaschema-xmlschema.xsd b/test-suite/schema-generation/datatypes/target/datatypes-datetime-no-tz_metaschema-xmlschema.xsd new file mode 100644 index 000000000..1ee7793a0 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-datetime-no-tz_metaschema-xmlschema.xsd @@ -0,0 +1,236 @@ + + + + + Metaschema Unit Test: datatypes-dateTime + 1.0-milestone1 + metaschema-datatypes-dateTime + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + Date and Time Flag + datetime flag + + + Date and Time Flag: datetime flag + + + + + + + child + child assembly + + + child: child assembly + + + + + + + + + Date and Time + No time zone + + + Date and Time: No time zone + + + + + + OSCAL reference for native type + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/datatypes/target/datatypes-datetime_metaschema-jsonschema.json b/test-suite/schema-generation/datatypes/target/datatypes-datetime_metaschema-jsonschema.json new file mode 100644 index 000000000..17df7097b --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-datetime_metaschema-jsonschema.json @@ -0,0 +1,60 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime/1.0-milestone1/metaschema-datatypes-dateTime-schema.json", + "$comment" : "Metaschema Unit Test: datatypes-dateTime: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-datatypes-dateTime_parent", + "type" : "object", + "properties" : + { "flag-datetime" : + { "title" : "Date and Time Flag", + "description" : "datetime flag", + "type" : "string" }, + "field-datetimes" : + { "anyOf" : + [ + { "$ref" : "#field_metaschema-datatypes-dateTime_field-datetime" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#field_metaschema-datatypes-dateTime_field-datetime" } } ] }, + "children" : + { "anyOf" : + [ + { "$ref" : "#assembly_metaschema-datatypes-dateTime_child" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#assembly_metaschema-datatypes-dateTime_child" } } ] } }, + "required" : + [ "flag-datetime" ], + "additionalProperties" : false }, + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:child" : + { "title" : "child", + "description" : "child assembly", + "$id" : "#assembly_metaschema-datatypes-dateTime_child", + "type" : "object", + "properties" : + { "field-datetime" : + { "$ref" : "#field_metaschema-datatypes-dateTime_field-datetime" } }, + "required" : + [ "field-datetime" ], + "additionalProperties" : false }, + "metaschema-datatypes-dateTime-metaschema-datatypes-dateTime:field-datetime" : + { "title" : "Date and Time", + "description" : "With time zone", + "$id" : "#field_metaschema-datatypes-dateTime_field-datetime", + "type" : "string" } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-datatypes-dateTime_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/target/datatypes-datetime_metaschema-xmlschema.xsd b/test-suite/schema-generation/datatypes/target/datatypes-datetime_metaschema-xmlschema.xsd new file mode 100644 index 000000000..e62e33834 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-datetime_metaschema-xmlschema.xsd @@ -0,0 +1,230 @@ + + + + + Metaschema Unit Test: datatypes-dateTime + 1.0-milestone1 + metaschema-datatypes-dateTime + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + Date and Time Flag + datetime flag + + + Date and Time Flag: datetime flag + + + + + + + child + child assembly + + + child: child assembly + + + + + + + + + Date and Time + With time zone + + + Date and Time: With time zone + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/datatypes/target/datatypes-numeric_metaschema-jsonschema.json b/test-suite/schema-generation/datatypes/target/datatypes-numeric_metaschema-jsonschema.json new file mode 100644 index 000000000..8bf0de456 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-numeric_metaschema-jsonschema.json @@ -0,0 +1,45 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri/1.0-milestone1/metaschema-datatypes-uri-schema.json", + "$comment" : "Metaschema Unit Test: URIs: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-datatypes-uri-metaschema-datatypes-uri:numSet" : + { "title" : "Number set", + "description" : "Block of four different numbers", + "$id" : "#assembly_metaschema-datatypes-uri_numSet", + "type" : "object", + "properties" : + { "int" : + { "title" : "Integer", + "description" : "Per W3C", + "type" : "integer" }, + "posInt" : + { "title" : "Positive Integer", + "description" : "1 or more", + "type" : "integer", + "multipleOf" : 1, + "minimum" : 1 }, + "nonNegInt" : + { "title" : "Non-negative Integer", + "description" : "zero or more", + "type" : "integer", + "multipleOf" : 1, + "minimum" : 0 }, + "decimal" : + { "title" : "Decimal", + "description" : "Floating point", + "type" : "number" } }, + "required" : + [ "int", + "posInt", + "nonNegInt", + "decimal" ], + "additionalProperties" : false } }, + "properties" : + { "numSet" : + { "$ref" : "#assembly_metaschema-datatypes-uri_numSet" } }, + "required" : + [ "numSet" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/target/datatypes-numeric_metaschema-xmlschema.xsd b/test-suite/schema-generation/datatypes/target/datatypes-numeric_metaschema-xmlschema.xsd new file mode 100644 index 000000000..e5ecad4d1 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-numeric_metaschema-xmlschema.xsd @@ -0,0 +1,235 @@ + + + + + Metaschema Unit Test: URIs + 1.0-milestone1 + metaschema-datatypes-uri + numSet + + + + + + + Number set + Block of four different numbers + + + Number set: Block of four different numbers + + + + + + + Integer + Per W3C + + + Integer: Per W3C + + + + + + + + + Positive Integer + 1 or more + + + Positive Integer: 1 or more + + + + + + + + + Non-negative Integer + zero or more + + + Non-negative Integer: zero or more + + + + + + + + + Decimal + Floating point + + + Decimal: Floating point + + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/datatypes/datatypes-prose_json-schema.json b/test-suite/schema-generation/datatypes/target/datatypes-prose_metaschema-jsonschema.json similarity index 59% rename from test-suite/schema-generation/datatypes/datatypes-prose_json-schema.json rename to test-suite/schema-generation/datatypes/target/datatypes-prose_metaschema-jsonschema.json index 16448eafa..7d433ffa3 100644 --- a/test-suite/schema-generation/datatypes/datatypes-prose_json-schema.json +++ b/test-suite/schema-generation/datatypes/target/datatypes-prose_metaschema-jsonschema.json @@ -1,97 +1,92 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes/1.0-milestone1/metaschema-datatypes-schema.json", "$comment" : "Metaschema Unit Test: datatypes: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-datatypes-metaschema-datatypes:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-datatypes_parent", "type" : "object", "properties" : { "field-date" : - { "$ref" : "#/definitions/field-date" }, + { "$ref" : "#field_metaschema-datatypes_field-date" }, "field-plaintext" : - { "$ref" : "#/definitions/field-plaintext" }, + { "$ref" : "#field_metaschema-datatypes_field-plaintext" }, "field-flag-plaintext" : - { "$ref" : "#/definitions/field-flag-plaintext" }, + { "$ref" : "#field_metaschema-datatypes_field-flag-plaintext" }, "field-richtext" : - { "$ref" : "#/definitions/field-richtext" }, + { "$ref" : "#field_metaschema-datatypes_field-richtext" }, "field-flag-richtext" : - { "$ref" : "#/definitions/field-flag-richtext" }, + { "$ref" : "#field_metaschema-datatypes_field-flag-richtext" }, "field-prose" : - { "$ref" : "#/definitions/field-prose" }, + { "$ref" : "#field_metaschema-datatypes_field-prose" }, "field-flag-prose" : - { "$ref" : "#/definitions/field-flag-prose" } }, + { "$ref" : "#field_metaschema-datatypes_field-flag-prose" } }, "additionalProperties" : false }, - "field-date" : + "metaschema-datatypes-metaschema-datatypes:field-date" : { "title" : "Date", "description" : "With time zone", - "$id" : "#/definitions/field-date", + "$id" : "#field_metaschema-datatypes_field-date", "type" : "string", "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})$" }, - "field-plaintext" : + "metaschema-datatypes-metaschema-datatypes:field-plaintext" : { "title" : "Plain text", "description" : "plain text, no markup", - "$id" : "#/definitions/field-plaintext", - "type" : "string" }, - "field-flag-plaintext" : + "$id" : "#field_metaschema-datatypes_field-plaintext", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "metaschema-datatypes-metaschema-datatypes:field-flag-plaintext" : { "title" : "Plain text", "description" : "plain text, no markup", - "$id" : "#/definitions/field-flag-plaintext", + "$id" : "#field_metaschema-datatypes_field-flag-plaintext", "type" : "object", "properties" : { "length" : { "title" : "Length", "description" : "The length.", - "type" : "integer", - "minimum" : 1, - "multipleOf" : 1 }, + "type" : "string" }, "STRVALUE" : { "type" : "string" } }, "required" : [ "STRVALUE" ], "additionalProperties" : false }, - "field-richtext" : + "metaschema-datatypes-metaschema-datatypes:field-richtext" : { "title" : "Rich text", "description" : "Rich text supports markup", - "$id" : "#/definitions/field-richtext", + "$id" : "#field_metaschema-datatypes_field-richtext", "type" : "string" }, - "field-flag-richtext" : + "metaschema-datatypes-metaschema-datatypes:field-flag-richtext" : { "title" : "Rich text", "description" : "Rich text supports markup", - "$id" : "#/definitions/field-flag-richtext", + "$id" : "#field_metaschema-datatypes_field-flag-richtext", "type" : "object", "properties" : { "length" : { "title" : "Length", "description" : "The length.", - "type" : "integer", - "multipleOf" : 1, - "minimum" : 1 }, + "type" : "string" }, "RICHTEXT" : { "type" : "string" } }, "required" : [ "RICHTEXT" ], "additionalProperties" : false }, - "field-prose" : + "metaschema-datatypes-metaschema-datatypes:field-prose" : { "title" : "Prose", "description" : "Prose permits multiple paragraphs, lists, tables etc.", - "$id" : "#/definitions/field-prose", + "$id" : "#field_metaschema-datatypes_field-prose", "type" : "string" }, - "field-flag-prose" : + "metaschema-datatypes-metaschema-datatypes:field-flag-prose" : { "title" : "Prose", "description" : "Prose permits multiple paragraphs, lists, tables etc.", - "$id" : "#/definitions/field-flag-prose", + "$id" : "#field_metaschema-datatypes_field-flag-prose", "type" : "object", "properties" : { "length" : { "title" : "Length", "description" : "The length.", - "type" : "integer", - "multipleOf" : 1, - "minimum" : 1 }, + "type" : "string" }, "PROSE" : { "type" : "string" } }, "required" : @@ -99,7 +94,7 @@ "additionalProperties" : false } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-datatypes_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/datatypes/target/datatypes-prose_metaschema-xmlschema.xsd b/test-suite/schema-generation/datatypes/target/datatypes-prose_metaschema-xmlschema.xsd new file mode 100644 index 000000000..7d433ffa3 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-prose_metaschema-xmlschema.xsd @@ -0,0 +1,101 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes/1.0-milestone1/metaschema-datatypes-schema.json", + "$comment" : "Metaschema Unit Test: datatypes: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-datatypes-metaschema-datatypes:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-datatypes_parent", + "type" : "object", + "properties" : + { "field-date" : + { "$ref" : "#field_metaschema-datatypes_field-date" }, + "field-plaintext" : + { "$ref" : "#field_metaschema-datatypes_field-plaintext" }, + "field-flag-plaintext" : + { "$ref" : "#field_metaschema-datatypes_field-flag-plaintext" }, + "field-richtext" : + { "$ref" : "#field_metaschema-datatypes_field-richtext" }, + "field-flag-richtext" : + { "$ref" : "#field_metaschema-datatypes_field-flag-richtext" }, + "field-prose" : + { "$ref" : "#field_metaschema-datatypes_field-prose" }, + "field-flag-prose" : + { "$ref" : "#field_metaschema-datatypes_field-flag-prose" } }, + "additionalProperties" : false }, + "metaschema-datatypes-metaschema-datatypes:field-date" : + { "title" : "Date", + "description" : "With time zone", + "$id" : "#field_metaschema-datatypes_field-date", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})$" }, + "metaschema-datatypes-metaschema-datatypes:field-plaintext" : + { "title" : "Plain text", + "description" : "plain text, no markup", + "$id" : "#field_metaschema-datatypes_field-plaintext", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "metaschema-datatypes-metaschema-datatypes:field-flag-plaintext" : + { "title" : "Plain text", + "description" : "plain text, no markup", + "$id" : "#field_metaschema-datatypes_field-flag-plaintext", + "type" : "object", + "properties" : + { "length" : + { "title" : "Length", + "description" : "The length.", + "type" : "string" }, + "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false }, + "metaschema-datatypes-metaschema-datatypes:field-richtext" : + { "title" : "Rich text", + "description" : "Rich text supports markup", + "$id" : "#field_metaschema-datatypes_field-richtext", + "type" : "string" }, + "metaschema-datatypes-metaschema-datatypes:field-flag-richtext" : + { "title" : "Rich text", + "description" : "Rich text supports markup", + "$id" : "#field_metaschema-datatypes_field-flag-richtext", + "type" : "object", + "properties" : + { "length" : + { "title" : "Length", + "description" : "The length.", + "type" : "string" }, + "RICHTEXT" : + { "type" : "string" } }, + "required" : + [ "RICHTEXT" ], + "additionalProperties" : false }, + "metaschema-datatypes-metaschema-datatypes:field-prose" : + { "title" : "Prose", + "description" : "Prose permits multiple paragraphs, lists, tables etc.", + "$id" : "#field_metaschema-datatypes_field-prose", + "type" : "string" }, + "metaschema-datatypes-metaschema-datatypes:field-flag-prose" : + { "title" : "Prose", + "description" : "Prose permits multiple paragraphs, lists, tables etc.", + "$id" : "#field_metaschema-datatypes_field-flag-prose", + "type" : "object", + "properties" : + { "length" : + { "title" : "Length", + "description" : "The length.", + "type" : "string" }, + "PROSE" : + { "type" : "string" } }, + "required" : + [ "PROSE" ], + "additionalProperties" : false } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-datatypes_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/target/datatypes-token_metaschema-jsonschema.json b/test-suite/schema-generation/datatypes/target/datatypes-token_metaschema-jsonschema.json new file mode 100644 index 000000000..0e0f1c3ee --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-token_metaschema-jsonschema.json @@ -0,0 +1,30 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri/1.0-milestone1/metaschema-datatypes-uri-schema.json", + "$comment" : "Metaschema Unit Test: URIs: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-datatypes-uri-metaschema-datatypes-uri:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-datatypes-uri_parent", + "type" : "object", + "properties" : + { "token-flag" : + { "type" : "array", + "minItems" : 1, + "items" : + { "title" : "Universal Resource Identifier Flag", + "description" : "Per W3C", + "type" : "string", + "pattern" : "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" } } }, + "required" : + [ "token-flag" ], + "additionalProperties" : false } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-datatypes-uri_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/datatypes/target/datatypes-token_metaschema-xmlschema.xsd b/test-suite/schema-generation/datatypes/target/datatypes-token_metaschema-xmlschema.xsd new file mode 100644 index 000000000..7279e6798 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-token_metaschema-xmlschema.xsd @@ -0,0 +1,203 @@ + + + + + Metaschema Unit Test: URIs + 1.0-milestone1 + metaschema-datatypes-uri + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + Universal Resource Identifier Flag + Per W3C + + + Universal Resource Identifier Flag: Per W3C + + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + A string token following the rules of XML "no colon" names, with no whitespace. (XML names are single alphabetic characters + followed by alphanumeric characters, periods, underscores or dashes.) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/datatypes/datatypes-uri_json-schema.json b/test-suite/schema-generation/datatypes/target/datatypes-uri_metaschema-jsonschema.json similarity index 58% rename from test-suite/schema-generation/datatypes/datatypes-uri_json-schema.json rename to test-suite/schema-generation/datatypes/target/datatypes-uri_metaschema-jsonschema.json index 4a5f57bb4..92f8d376b 100644 --- a/test-suite/schema-generation/datatypes/datatypes-uri_json-schema.json +++ b/test-suite/schema-generation/datatypes/target/datatypes-uri_metaschema-jsonschema.json @@ -1,20 +1,21 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri/1.0-milestone1/metaschema-datatypes-uri-schema.json", "$comment" : "Metaschema Unit Test: URIs: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-datatypes-uri-metaschema-datatypes-uri:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-datatypes-uri_parent", "type" : "object", "properties" : { "uri-flag" : { "title" : "Universal Resource Identifier Flag", "description" : "Per W3C", "type" : "string", - "format" : "uri" }, + "format" : "uri", + "pattern" : "^[a-zA-Z][a-zA-Z0-9+\\-.]+:.+$" }, "uri-reference-flag" : { "title" : "Universal Resource Identifier Reference Flag", "description" : "Per W3C, can be a relative URI", @@ -23,40 +24,41 @@ "uri-fields" : { "anyOf" : [ - { "$ref" : "#/definitions/uri-field" }, + { "$ref" : "#field_metaschema-datatypes-uri_uri-field" }, { "type" : "array", + "minItems" : 1, "items" : - { "$ref" : "#/definitions/uri-field" }, - "minItems" : 1 } ] }, + { "$ref" : "#field_metaschema-datatypes-uri_uri-field" } } ] }, "uri-reference-fields" : { "anyOf" : [ - { "$ref" : "#/definitions/uri-reference-field" }, + { "$ref" : "#field_metaschema-datatypes-uri_uri-reference-field" }, { "type" : "array", + "minItems" : 1, "items" : - { "$ref" : "#/definitions/uri-reference-field" }, - "minItems" : 1 } ] } }, + { "$ref" : "#field_metaschema-datatypes-uri_uri-reference-field" } } ] } }, "required" : [ "uri-flag", "uri-reference-flag" ], "additionalProperties" : false }, - "uri-field" : + "metaschema-datatypes-uri-metaschema-datatypes-uri:uri-field" : { "title" : "Universal Resource Identifier Flag", "description" : "Per W3C", - "$id" : "#/definitions/uri-field", + "$id" : "#field_metaschema-datatypes-uri_uri-field", "type" : "string", - "format" : "uri" }, - "uri-reference-field" : + "format" : "uri", + "pattern" : "^[a-zA-Z][a-zA-Z0-9+\\-.]+:.+$" }, + "metaschema-datatypes-uri-metaschema-datatypes-uri:uri-reference-field" : { "title" : "Universal Resource Identifier Flag", "description" : "Per W3C", - "$id" : "#/definitions/uri-reference-field", + "$id" : "#field_metaschema-datatypes-uri_uri-reference-field", "type" : "string", "format" : "uri-reference" } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-datatypes-uri_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/datatypes/target/datatypes-uri_metaschema-xmlschema.xsd b/test-suite/schema-generation/datatypes/target/datatypes-uri_metaschema-xmlschema.xsd new file mode 100644 index 000000000..0af6df4e8 --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-uri_metaschema-xmlschema.xsd @@ -0,0 +1,247 @@ + + + + + Metaschema Unit Test: URIs + 1.0-milestone1 + metaschema-datatypes-uri + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + Universal Resource Identifier Flag + Per W3C + + + Universal Resource Identifier Flag: Per W3C + + + + + + Universal Resource Identifier Reference Flag + Per W3C, can be a relative URI + + + Universal Resource Identifier Reference Flag: Per W3C, can be a relative URI + + + + + + + Universal Resource Identifier Flag + Per W3C + + + Universal Resource Identifier Flag: Per W3C + + + + + + + Universal Resource Identifier Flag + Per W3C + + + Universal Resource Identifier Flag: Per W3C + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + A URI + + + + + + A URI reference, such as a relative URL + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/uuid/datatypes-uuid_metaschema_JSON-SCHEMA.json b/test-suite/schema-generation/datatypes/target/datatypes-uuid_metaschema-jsonschema.json similarity index 56% rename from test-suite/schema-generation/uuid/datatypes-uuid_metaschema_JSON-SCHEMA.json rename to test-suite/schema-generation/datatypes/target/datatypes-uuid_metaschema-jsonschema.json index 08e9bb1c3..c1b655e6f 100644 --- a/test-suite/schema-generation/uuid/datatypes-uuid_metaschema_JSON-SCHEMA.json +++ b/test-suite/schema-generation/datatypes/target/datatypes-uuid_metaschema-jsonschema.json @@ -1,41 +1,41 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri/1.0-milestone2/metaschema-datatypes-uuid-schema.json", "$comment" : "Metaschema Unit Test: UUID Datatype: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-datatypes-uuid-metaschema-datatypes-uuid:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-datatypes-uuid_parent", "type" : "object", "properties" : { "uuid-flag" : { "title" : "Universally Unique Identifier Flag", "description" : "A version 4 UUID per RFC 4122.", "type" : "string", - "pattern" : "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" }, + "pattern" : "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" }, "uuid-fields" : { "anyOf" : [ - { "$ref" : "#/definitions/uuid-field" }, + { "$ref" : "#field_metaschema-datatypes-uuid_uuid-field" }, { "type" : "array", "minItems" : 1, "items" : - { "$ref" : "#/definitions/uuid-field" } } ] } }, + { "$ref" : "#field_metaschema-datatypes-uuid_uuid-field" } } ] } }, "required" : - [ "" ], + [ "uuid-flag" ], "additionalProperties" : false }, - "uuid-field" : + "metaschema-datatypes-uuid-metaschema-datatypes-uuid:uuid-field" : { "title" : "Universally Unique Identifier Field", "description" : "A version 4 UUID per RFC 4122.", - "$id" : "#/definitions/uuid-field", + "$id" : "#field_metaschema-datatypes-uuid_uuid-field", "type" : "string", - "pattern" : "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" } }, + "pattern" : "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-datatypes-uuid_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/datatypes/target/datatypes-uuid_metaschema-xmlschema.xsd b/test-suite/schema-generation/datatypes/target/datatypes-uuid_metaschema-xmlschema.xsd new file mode 100644 index 000000000..702e7307f --- /dev/null +++ b/test-suite/schema-generation/datatypes/target/datatypes-uuid_metaschema-xmlschema.xsd @@ -0,0 +1,216 @@ + + + + + Metaschema Unit Test: UUID Datatype + 1.0-milestone2 + metaschema-datatypes-uuid + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + Universally Unique Identifier Flag + A version 4 UUID per RFC 4122. + + + Universally Unique Identifier Flag: A version 4 UUID per RFC 4122. + + + + + + + Universally Unique Identifier Field + A version 4 UUID per RFC 4122. + + + Universally Unique Identifier Field: A version 4 UUID per RFC 4122. + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + A Type 4 ('random' or 'pseudorandom' UUID per RFC 4122 + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/flag/flag-basic_metaschema.xml b/test-suite/schema-generation/flag/flag-basic_metaschema.xml index 11913eecc..e35820600 100644 --- a/test-suite/schema-generation/flag/flag-basic_metaschema.xml +++ b/test-suite/schema-generation/flag/flag-basic_metaschema.xml @@ -1,5 +1,5 @@ - + @@ -7,6 +7,7 @@ 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/oscal/unit-testing/flag-basic + http://csrc.nist.gov/ns/oscal/unit-testing/flag-basic parent parent assembly diff --git a/test-suite/schema-generation/flag/flag-basic_xml-schema.xsd b/test-suite/schema-generation/flag/flag-basic_xml-schema.xsd deleted file mode 100644 index 959d79357..000000000 --- a/test-suite/schema-generation/flag/flag-basic_xml-schema.xsd +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Metaschema Unit Test: flag: basic flag - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - Flag - A basic flag - - - Flag: A basic flag - - - - - - Required Flag - A basic required flag - - - Required Flag: A basic required flag - - - - - - Constrained Flag - With decimal values - - - Constrained Flag: With decimal values - - - - - - -

one-dot-oh

-
-
-
- - - -

one-dot-one

-
-
-
-
-
-
-
-
diff --git a/test-suite/schema-generation/flag/flag-override_metaschema.xml b/test-suite/schema-generation/flag/flag-override_metaschema.xml index 48a8e40f1..644233b19 100644 --- a/test-suite/schema-generation/flag/flag-override_metaschema.xml +++ b/test-suite/schema-generation/flag/flag-override_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: flag: basic flag 1.0-milestone1 metaschema-group-as - http://csrc.nist.gov/ns/oscal/unit-testing/flag-basic + http://csrc.nist.gov/ns/oscal/unit-testing/flag-override + http://csrc.nist.gov/ns/oscal/unit-testing/flag-override parent parent assembly diff --git a/test-suite/schema-generation/flag/flag-override_xml-schema.xsd b/test-suite/schema-generation/flag/flag-override_xml-schema.xsd deleted file mode 100644 index d770f3e8c..000000000 --- a/test-suite/schema-generation/flag/flag-override_xml-schema.xsd +++ /dev/null @@ -1,187 +0,0 @@ - - - - - Metaschema Unit Test: flag: basic flag - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - propB field - propB field ... - - - propB field: propB field ... - - - - - - - name flag - name flag ... - - - name flag: name flag ... - - - - - - -

Z

-
-
-
-
-
-
-
-
-
-
-
-
- - - - Child 1 - A child with a unique set of properties. - - - Child 1: A child with a unique set of properties. - - - - - - - propA field - propA field ... - - - propA field: propA field ... - - - - - - - name flag - name flag ... - - - name flag: name flag ... - - - - - - -

E

-
-
-
- - - -

F

-
-
-
-
-
-
-
-
-
-
-
-
- - - - Child 2 - A child with a unique set of properties. - - - Child 2: A child with a unique set of properties. - - - - - - - propA field - propA field ... - - - propA field: propA field ... - - - - - - - name flag - name flag ... - - - name flag: name flag ... - - - - - - -

G

-
-
-
- - - -

H

-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test-suite/schema-generation/flag/readme.md b/test-suite/schema-generation/flag/readme.md new file mode 100644 index 000000000..8457e80fd --- /dev/null +++ b/test-suite/schema-generation/flag/readme.md @@ -0,0 +1,6 @@ +# Flags + +**Status** - untested, unknown - + +These tests are known to have run in the past but current status is not confirmed. + diff --git a/test-suite/schema-generation/flag/flag-basic_json-schema.json b/test-suite/schema-generation/flag/target/flag-basic_metaschema-jsonschema.json similarity index 56% rename from test-suite/schema-generation/flag/flag-basic_json-schema.json rename to test-suite/schema-generation/flag/target/flag-basic_metaschema-jsonschema.json index 38d6e440b..3b4cadd1a 100644 --- a/test-suite/schema-generation/flag/flag-basic_json-schema.json +++ b/test-suite/schema-generation/flag/target/flag-basic_metaschema-jsonschema.json @@ -1,28 +1,29 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/oscal/unit-testing/flag-basic-schema.json", + "$id" : "http://csrc.nist.gov/ns/oscal/unit-testing/flag-basic/1.0-milestone1/metaschema-group-as-schema.json", "$comment" : "Metaschema Unit Test: flag: basic flag: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-group-as-metaschema-group-as:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-group-as_parent", "type" : "object", "properties" : { "flag" : - { "type" : "string", - "title" : "Flag", - "description" : "A basic flag" }, + { "title" : "Flag", + "description" : "A basic flag", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, "flag-required" : - { "type" : "string", - "title" : "Required Flag", - "description" : "A basic required flag" }, + { "title" : "Required Flag", + "description" : "A basic required flag", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, "flag-constrained" : - { "type" : "number", - "pattern" : "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$", - "title" : "Constrained Flag", + { "title" : "Constrained Flag", "description" : "With decimal values", + "type" : "number", "enum" : [ 1, 1.1 ] } }, @@ -31,7 +32,7 @@ "additionalProperties" : false } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-group-as_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/flag/target/flag-basic_metaschema-xmlschema.xsd b/test-suite/schema-generation/flag/target/flag-basic_metaschema-xmlschema.xsd new file mode 100644 index 000000000..4704a6608 --- /dev/null +++ b/test-suite/schema-generation/flag/target/flag-basic_metaschema-xmlschema.xsd @@ -0,0 +1,214 @@ + + + + + Metaschema Unit Test: flag: basic flag + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + Flag + A basic flag + + + Flag: A basic flag + + + + + + Required Flag + A basic required flag + + + Required Flag: A basic required flag + + + + + + Constrained Flag + With decimal values + + + Constrained Flag: With decimal values + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/flag/target/flag-override_metaschema-jsonschema.json b/test-suite/schema-generation/flag/target/flag-override_metaschema-jsonschema.json new file mode 100644 index 000000000..34c0c61b9 --- /dev/null +++ b/test-suite/schema-generation/flag/target/flag-override_metaschema-jsonschema.json @@ -0,0 +1,91 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/oscal/unit-testing/flag-override/1.0-milestone1/metaschema-group-as-schema.json", + "$comment" : "Metaschema Unit Test: flag: basic flag: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-group-as-metaschema-group-as:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-group-as_parent", + "type" : "object", + "properties" : + { "child1" : + { "$ref" : "#assembly_metaschema-group-as_child1" }, + "child2" : + { "$ref" : "#assembly_metaschema-group-as_child2" }, + "propB" : + { "title" : "propB field", + "description" : "propB field ...", + "type" : "object", + "properties" : + { "name" : + { "title" : "name flag", + "description" : "name flag ...", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$", + "enum" : + [ "z" ] }, + "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false } }, + "additionalProperties" : false }, + "metaschema-group-as-metaschema-group-as:child1" : + { "title" : "Child 1", + "description" : "A child with a unique set of properties.", + "$id" : "#assembly_metaschema-group-as_child1", + "type" : "object", + "properties" : + { "propA" : + { "title" : "propA field", + "description" : "propA field ...", + "type" : "object", + "properties" : + { "name" : + { "title" : "name flag", + "description" : "name flag ...", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$", + "enum" : + [ "e", + "f" ] }, + "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false } }, + "additionalProperties" : false }, + "metaschema-group-as-metaschema-group-as:child2" : + { "title" : "Child 2", + "description" : "A child with a unique set of properties.", + "$id" : "#assembly_metaschema-group-as_child2", + "type" : "object", + "properties" : + { "propA" : + { "title" : "propA field", + "description" : "propA field ...", + "type" : "object", + "properties" : + { "name" : + { "title" : "name flag", + "description" : "name flag ...", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$", + "enum" : + [ "g", + "h" ] }, + "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false } }, + "additionalProperties" : false } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-group-as_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/flag/target/flag-override_metaschema-xmlschema.xsd b/test-suite/schema-generation/flag/target/flag-override_metaschema-xmlschema.xsd new file mode 100644 index 000000000..fa7a2492a --- /dev/null +++ b/test-suite/schema-generation/flag/target/flag-override_metaschema-xmlschema.xsd @@ -0,0 +1,293 @@ + + + + + Metaschema Unit Test: flag: basic flag + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + propB field + propB field ... + + + propB field: propB field ... + + + + + + + name flag + name flag ... + + + name flag: name flag ... + + + + + + + + + + + + Child 1 + A child with a unique set of properties. + + + Child 1: A child with a unique set of properties. + + + + + + + propA field + propA field ... + + + propA field: propA field ... + + + + + + + name flag + name flag ... + + + name flag: name flag ... + + + + + + + + + + + + Child 2 + A child with a unique set of properties. + + + Child 2: A child with a unique set of properties. + + + + + + + propA field + propA field ... + + + propA field: propA field ... + + + + + + + name flag + name flag ... + + + name flag: name flag ... + + + + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/group-as/group-as-array-bounded_metaschema.xml b/test-suite/schema-generation/group-as/group-as-array-bounded_metaschema.xml index 378e8d78a..b1227c17e 100644 --- a/test-suite/schema-generation/group-as/group-as-array-bounded_metaschema.xml +++ b/test-suite/schema-generation/group-as/group-as-array-bounded_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array-bounded + http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array-bounded parent parent assembly diff --git a/test-suite/schema-generation/group-as/group-as-array-bounded_xml-schema.xsd b/test-suite/schema-generation/group-as/group-as-array-bounded_xml-schema.xsd deleted file mode 100644 index 18c8b8ea5..000000000 --- a/test-suite/schema-generation/group-as/group-as-array-bounded_xml-schema.xsd +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - prop - prop field - - - prop: prop field - - - - - - diff --git a/test-suite/schema-generation/group-as/group-as-array-invalid-max_metaschema.xml b/test-suite/schema-generation/group-as/group-as-array-invalid-max_metaschema.xml index 05b4d8db8..156ad8290 100644 --- a/test-suite/schema-generation/group-as/group-as-array-invalid-max_metaschema.xml +++ b/test-suite/schema-generation/group-as/group-as-array-invalid-max_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as + http://csrc.nist.gov/ns/metaschema/unit-test/group-as parent parent assembly diff --git a/test-suite/schema-generation/group-as/group-as-array-invalid-max_xml-schema.xsd b/test-suite/schema-generation/group-as/group-as-array-invalid-max_xml-schema.xsd deleted file mode 100644 index 756544c0c..000000000 --- a/test-suite/schema-generation/group-as/group-as-array-invalid-max_xml-schema.xsd +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - prop - prop field - - - prop: prop field - - - - - - diff --git a/test-suite/schema-generation/group-as/group-as-array-optional_metaschema.xml b/test-suite/schema-generation/group-as/group-as-array-optional_metaschema.xml index 77cf76c58..278e975bb 100644 --- a/test-suite/schema-generation/group-as/group-as-array-optional_metaschema.xml +++ b/test-suite/schema-generation/group-as/group-as-array-optional_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array-optional + http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array-optional parent parent assembly diff --git a/test-suite/schema-generation/group-as/group-as-array-optional_xml-schema.xsd b/test-suite/schema-generation/group-as/group-as-array-optional_xml-schema.xsd deleted file mode 100644 index b37cacd9e..000000000 --- a/test-suite/schema-generation/group-as/group-as-array-optional_xml-schema.xsd +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - prop - prop field - - - prop: prop field - - - - - - diff --git a/test-suite/schema-generation/group-as/group-as-array_metaschema.xml b/test-suite/schema-generation/group-as/group-as-array_metaschema.xml index 01b1a4040..c7446f15e 100644 --- a/test-suite/schema-generation/group-as/group-as-array_metaschema.xml +++ b/test-suite/schema-generation/group-as/group-as-array_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array + http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array parent parent assembly diff --git a/test-suite/schema-generation/group-as/group-as-array_xml-schema.xsd b/test-suite/schema-generation/group-as/group-as-array_xml-schema.xsd deleted file mode 100644 index 00883128f..000000000 --- a/test-suite/schema-generation/group-as/group-as-array_xml-schema.xsd +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - prop - prop field - - - prop: prop field - - - - - - diff --git a/test-suite/schema-generation/group-as/group-as-by-key_json-schema.json b/test-suite/schema-generation/group-as/group-as-by-key_json-schema.json deleted file mode 100644 index 35444619a..000000000 --- a/test-suite/schema-generation/group-as/group-as-by-key_json-schema.json +++ /dev/null @@ -1,43 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-by-key-schema.json", - "$comment" : "Metaschema Unit Test: group-as: JSON Schema", - "type" : "object", - "definitions" : - { "parent" : - { "title" : "parent", - "description" : "parent assembly", - "$id" : "#/definitions/parent", - "type" : "object", - "properties" : - { "props" : - { "type" : "object", - "minProperties" : 1, - "additionalProperties" : - { "allOf" : - [ - { "$ref" : "#/definitions/prop" }, - - { "not" : - { "type" : "string" } } ] } } }, - "required" : - [ "props" ], - "additionalProperties" : false }, - "prop" : - { "title" : "prop", - "description" : "prop field", - "$id" : "#/definitions/prop", - "type" : "object", - "properties" : - { "STRVALUE" : - { "type" : "string" } }, - "required" : - [ "STRVALUE" ], - "additionalProperties" : false } }, - "properties" : - { "parent" : - { "$ref" : "#/definitions/parent" } }, - "required" : - [ "parent" ], - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/group-as/group-as-by-key_metaschema.xml b/test-suite/schema-generation/group-as/group-as-by-key_metaschema.xml index 9a5907ff5..cd0d320a3 100644 --- a/test-suite/schema-generation/group-as/group-as-by-key_metaschema.xml +++ b/test-suite/schema-generation/group-as/group-as-by-key_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as-by-key + http://csrc.nist.gov/ns/metaschema/unit-test/group-as-by-key parent parent assembly @@ -22,8 +21,8 @@ prop prop field - - + + ID Identifier diff --git a/test-suite/schema-generation/group-as/group-as-by-key_test_valid_PASS.json b/test-suite/schema-generation/group-as/group-as-by-key_test_valid_PASS.json index f0b784ed3..00186cf4c 100644 --- a/test-suite/schema-generation/group-as/group-as-by-key_test_valid_PASS.json +++ b/test-suite/schema-generation/group-as/group-as-by-key_test_valid_PASS.json @@ -1,9 +1,9 @@ { "parent": { "props": { - "id3": {"STRVALUE": "test3"}, - "id2": {"STRVALUE": ""}, - "id1": {"STRVALUE": "test1"} + "id3": "test3", + "id2": "some text", + "id1": "test1" } } } diff --git a/test-suite/schema-generation/group-as/group-as-by-key_xml-schema.xsd b/test-suite/schema-generation/group-as/group-as-by-key_xml-schema.xsd deleted file mode 100644 index f747e48a2..000000000 --- a/test-suite/schema-generation/group-as/group-as-by-key_xml-schema.xsd +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - prop - prop field - - - prop: prop field - - - - - - - ID - Identifier - - - ID: Identifier - - - - - - diff --git a/test-suite/schema-generation/group-as/group-as-misc_metaschema.xml b/test-suite/schema-generation/group-as/group-as-misc_metaschema.xml index 91633be3c..234173d24 100644 --- a/test-suite/schema-generation/group-as/group-as-misc_metaschema.xml +++ b/test-suite/schema-generation/group-as/group-as-misc_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as-by-key + http://csrc.nist.gov/ns/metaschema/unit-test/group-as-by-key @@ -48,7 +47,7 @@ Information Type Identifier An identifier qualified by the given identification system used, such as NIST SP 800-60. - + id diff --git a/test-suite/schema-generation/group-as/group-as-misc_xml-schema.xsd b/test-suite/schema-generation/group-as/group-as-misc_xml-schema.xsd deleted file mode 100644 index 8301673f4..000000000 --- a/test-suite/schema-generation/group-as/group-as-misc_xml-schema.xsd +++ /dev/null @@ -1,491 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - root - - - - - - - Root - ... - - - Root: ... - - - - - - - Information Type - Contains details about one information type that is stored, processed, or transmitted by the system, such as privacy information, and those defined in NIST SP 800-60. - - - Information Type: Contains details about one information type that is stored, processed, or transmitted by the system, such as privacy information, and those defined in NIST SP 800-60. - - - - - - - - - - - - - - - - - Information Type Identifier - An identifier qualified by the given identification system used, such as NIST SP 800-60. - - - Information Type Identifier: An identifier qualified by the given identification system used, such as NIST SP 800-60. - - - - - - - Information Type Identification System - Specifies the information type identification system used. - - - Information Type Identification System: Specifies the information type identification system used. - - - - - - - - -

Based on the - section identifiers in NIST Special Publication 800-60 Volume II - Revision 1

-
-
-
-
-
-
-
-
-
-
-
-
- - - - - Confidentiality Impact Level - The expected level of impact resulting from the unauthorized disclosure of information. - - - Confidentiality Impact Level: The expected level of impact resulting from the unauthorized disclosure of information. - - - - - - - Base Level (Confidentiality, Integrity, or Availability) - The prescribed base (Confidentiality, Integrity, or Availability) security impact level. - - - Base Level (Confidentiality, Integrity, or Availability): The prescribed base (Confidentiality, Integrity, or Availability) security impact level. - - - - - - - - - - - Selected Level (Confidentiality, Integrity, or Availability) - The selected (Confidentiality, Integrity, or Availability) security impact level. - - - Selected Level (Confidentiality, Integrity, or Availability): The selected (Confidentiality, Integrity, or Availability) security impact level. - - - - - - - - - - - - - - Integrity Impact Level - The expected level of impact resulting from the unauthorized modification of information. - - - Integrity Impact Level: The expected level of impact resulting from the unauthorized modification of information. - - - - - - - Base Level (Confidentiality, Integrity, or Availability) - The prescribed base (Confidentiality, Integrity, or Availability) security impact level. - - - Base Level (Confidentiality, Integrity, or Availability): The prescribed base (Confidentiality, Integrity, or Availability) security impact level. - - - - - - - - - - - Selected Level (Confidentiality, Integrity, or Availability) - The selected (Confidentiality, Integrity, or Availability) security impact level. - - - Selected Level (Confidentiality, Integrity, or Availability): The selected (Confidentiality, Integrity, or Availability) security impact level. - - - - - - - - - - - - - - Availability Impact Level - The expected level of impact resulting from the disruption of access to or use of information or the information system. - - - Availability Impact Level: The expected level of impact resulting from the disruption of access to or use of information or the information system. - - - - - - - Base Level (Confidentiality, Integrity, or Availability) - The prescribed base (Confidentiality, Integrity, or Availability) security impact level. - - - Base Level (Confidentiality, Integrity, or Availability): The prescribed base (Confidentiality, Integrity, or Availability) security impact level. - - - - - - - - - - - Selected Level (Confidentiality, Integrity, or Availability) - The selected (Confidentiality, Integrity, or Availability) security impact level. - - - Selected Level (Confidentiality, Integrity, or Availability): The selected (Confidentiality, Integrity, or Availability) security impact level. - - - - - - - - - -
- - - - Information Type Universally Unique Identifier - A globally unique identifier that can be used to reference this information type entry elsewhere in an OSCAL document. A UUID should be consistantly used for a given resource across revisions of the document. - - - Information Type Universally Unique Identifier: A globally unique identifier that can be used to reference this information type entry elsewhere in an OSCAL document. A UUID should be consistantly used for a given resource across revisions of the document. - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A Type 4 ('random' or 'pseudorandom' UUID per RFC 4122 - - - - - - A sequence of 8-4-4-4-12 hex digits, with extra constraints in the 13th and 17-18th places for version 4 - - - - -
diff --git a/test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_metaschema.xml b/test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_metaschema.xml index e36cb8a98..e3fa5464b 100644 --- a/test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_metaschema.xml +++ b/test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional + http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional parent parent assembly diff --git a/test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_xml-schema.xsd b/test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_xml-schema.xsd deleted file mode 100644 index 5b7dff743..000000000 --- a/test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_xml-schema.xsd +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - prop - prop field - - - prop: prop field - - - - - - diff --git a/test-suite/schema-generation/group-as/group-as-singleton-or-array_metaschema.xml b/test-suite/schema-generation/group-as/group-as-singleton-or-array_metaschema.xml index 2fc98606a..715fc5007 100644 --- a/test-suite/schema-generation/group-as/group-as-singleton-or-array_metaschema.xml +++ b/test-suite/schema-generation/group-as/group-as-singleton-or-array_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array + http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array parent parent assembly diff --git a/test-suite/schema-generation/group-as/group-as-singleton-or-array_xml-schema.xsd b/test-suite/schema-generation/group-as/group-as-singleton-or-array_xml-schema.xsd deleted file mode 100644 index a5a326747..000000000 --- a/test-suite/schema-generation/group-as/group-as-singleton-or-array_xml-schema.xsd +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - prop - prop field - - - prop: prop field - - - - - - diff --git a/test-suite/schema-generation/group-as/readme.md b/test-suite/schema-generation/group-as/readme.md new file mode 100644 index 000000000..d34699ba0 --- /dev/null +++ b/test-suite/schema-generation/group-as/readme.md @@ -0,0 +1,9 @@ +# Grouping - `group-as` + +Feature set for assigning names to groups, supported in different and various forms in both JSON (objects, arrays, combination) and XML (implicit and explicitly wrapped groups). + +**Status** - untested, unknown - + +These tests are known to have run in the past but current status is not confirmed. + +TODO group-as-by-key is known to be non-functional unit test that first! \ No newline at end of file diff --git a/test-suite/schema-generation/group-as/group-as-array-bounded_json-schema.json b/test-suite/schema-generation/group-as/target/group-as-array-bounded_metaschema-jsonschema.json similarity index 59% rename from test-suite/schema-generation/group-as/group-as-array-bounded_json-schema.json rename to test-suite/schema-generation/group-as/target/group-as-array-bounded_metaschema-jsonschema.json index ba0e9a33c..63b47f677 100644 --- a/test-suite/schema-generation/group-as/group-as-array-bounded_json-schema.json +++ b/test-suite/schema-generation/group-as/target/group-as-array-bounded_metaschema-jsonschema.json @@ -1,32 +1,33 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array-bounded-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array-bounded/1.0-milestone1/metaschema-group-as-schema.json", "$comment" : "Metaschema Unit Test: group-as: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-group-as-metaschema-group-as:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-group-as_parent", "type" : "object", "properties" : { "props" : { "type" : "array", - "items" : - { "$ref" : "#/definitions/prop" }, "minItems" : 2, - "maxItems" : 3 } }, + "maxItems" : 3, + "items" : + { "$ref" : "#field_metaschema-group-as_prop" } } }, "required" : [ "props" ], "additionalProperties" : false }, - "prop" : + "metaschema-group-as-metaschema-group-as:prop" : { "title" : "prop", "description" : "prop field", - "$id" : "#/definitions/prop", - "type" : "string" } }, + "$id" : "#field_metaschema-group-as_prop", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-group-as_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/group-as/target/group-as-array-bounded_metaschema-xmlschema.xsd b/test-suite/schema-generation/group-as/target/group-as-array-bounded_metaschema-xmlschema.xsd new file mode 100644 index 000000000..f299126a2 --- /dev/null +++ b/test-suite/schema-generation/group-as/target/group-as-array-bounded_metaschema-xmlschema.xsd @@ -0,0 +1,198 @@ + + + + + Metaschema Unit Test: group-as + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + prop + prop field + + + prop: prop field + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/group-as/target/group-as-array-invalid-max_metaschema-jsonschema.json b/test-suite/schema-generation/group-as/target/group-as-array-invalid-max_metaschema-jsonschema.json new file mode 100644 index 000000000..7367306de --- /dev/null +++ b/test-suite/schema-generation/group-as/target/group-as-array-invalid-max_metaschema-jsonschema.json @@ -0,0 +1,28 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as/1.0-milestone1/metaschema-group-as-schema.json", + "$comment" : "Metaschema Unit Test: group-as: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-group-as-metaschema-group-as:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-group-as_parent", + "type" : "object", + "properties" : + { "prop" : + { "$ref" : "#field_metaschema-group-as_prop" } }, + "additionalProperties" : false }, + "metaschema-group-as-metaschema-group-as:prop" : + { "title" : "prop", + "description" : "prop field", + "$id" : "#field_metaschema-group-as_prop", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-group-as_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/group-as/target/group-as-array-invalid-max_metaschema-xmlschema.xsd b/test-suite/schema-generation/group-as/target/group-as-array-invalid-max_metaschema-xmlschema.xsd new file mode 100644 index 000000000..c1911afdf --- /dev/null +++ b/test-suite/schema-generation/group-as/target/group-as-array-invalid-max_metaschema-xmlschema.xsd @@ -0,0 +1,198 @@ + + + + + Metaschema Unit Test: group-as + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + prop + prop field + + + prop: prop field + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/group-as/group-as-array-optional_json-schema.json b/test-suite/schema-generation/group-as/target/group-as-array-optional_metaschema-jsonschema.json similarity index 56% rename from test-suite/schema-generation/group-as/group-as-array-optional_json-schema.json rename to test-suite/schema-generation/group-as/target/group-as-array-optional_metaschema-jsonschema.json index 34648a38b..221bed6c2 100644 --- a/test-suite/schema-generation/group-as/group-as-array-optional_json-schema.json +++ b/test-suite/schema-generation/group-as/target/group-as-array-optional_metaschema-jsonschema.json @@ -1,29 +1,30 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array-optional-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array-optional/1.0-milestone1/metaschema-group-as-schema.json", "$comment" : "Metaschema Unit Test: group-as: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-group-as-metaschema-group-as:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-group-as_parent", "type" : "object", "properties" : { "props" : { "type" : "array", + "minItems" : 1, "items" : - { "$ref" : "#/definitions/prop" }, - "minItems" : 1 } }, + { "$ref" : "#field_metaschema-group-as_prop" } } }, "additionalProperties" : false }, - "prop" : + "metaschema-group-as-metaschema-group-as:prop" : { "title" : "prop", "description" : "prop field", - "$id" : "#/definitions/prop", - "type" : "string" } }, + "$id" : "#field_metaschema-group-as_prop", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-group-as_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/group-as/target/group-as-array-optional_metaschema-xmlschema.xsd b/test-suite/schema-generation/group-as/target/group-as-array-optional_metaschema-xmlschema.xsd new file mode 100644 index 000000000..6987fea3a --- /dev/null +++ b/test-suite/schema-generation/group-as/target/group-as-array-optional_metaschema-xmlschema.xsd @@ -0,0 +1,198 @@ + + + + + Metaschema Unit Test: group-as + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + prop + prop field + + + prop: prop field + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/group-as/group-as-array_json-schema.json b/test-suite/schema-generation/group-as/target/group-as-array_metaschema-jsonschema.json similarity index 58% rename from test-suite/schema-generation/group-as/group-as-array_json-schema.json rename to test-suite/schema-generation/group-as/target/group-as-array_metaschema-jsonschema.json index 74853f9cc..ba548e042 100644 --- a/test-suite/schema-generation/group-as/group-as-array_json-schema.json +++ b/test-suite/schema-generation/group-as/target/group-as-array_metaschema-jsonschema.json @@ -1,31 +1,32 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-array/1.0-milestone1/metaschema-group-as-schema.json", "$comment" : "Metaschema Unit Test: group-as: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-group-as-metaschema-group-as:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-group-as_parent", "type" : "object", "properties" : { "props" : { "type" : "array", + "minItems" : 1, "items" : - { "$ref" : "#/definitions/prop" }, - "minItems" : 1 } }, + { "$ref" : "#field_metaschema-group-as_prop" } } }, "required" : [ "props" ], "additionalProperties" : false }, - "prop" : + "metaschema-group-as-metaschema-group-as:prop" : { "title" : "prop", "description" : "prop field", - "$id" : "#/definitions/prop", - "type" : "string" } }, + "$id" : "#field_metaschema-group-as_prop", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-group-as_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/group-as/target/group-as-array_metaschema-xmlschema.xsd b/test-suite/schema-generation/group-as/target/group-as-array_metaschema-xmlschema.xsd new file mode 100644 index 000000000..4ce4f5bab --- /dev/null +++ b/test-suite/schema-generation/group-as/target/group-as-array_metaschema-xmlschema.xsd @@ -0,0 +1,198 @@ + + + + + Metaschema Unit Test: group-as + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + prop + prop field + + + prop: prop field + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/group-as/target/group-as-by-key_metaschema-xmlschema.xsd b/test-suite/schema-generation/group-as/target/group-as-by-key_metaschema-xmlschema.xsd new file mode 100644 index 000000000..fdbfa0cfa --- /dev/null +++ b/test-suite/schema-generation/group-as/target/group-as-by-key_metaschema-xmlschema.xsd @@ -0,0 +1,218 @@ + + + + + Metaschema Unit Test: group-as + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + prop + prop field + + + prop: prop field + + + + + + + ID + Identifier + + + ID: Identifier + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + A string token following the rules of XML "no colon" names, with no whitespace. (XML names are single alphabetic characters + followed by alphanumeric characters, periods, underscores or dashes.) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/group-as/group-as-misc_json-schema.json b/test-suite/schema-generation/group-as/target/group-as-misc_metaschema-jsonschema.json similarity index 60% rename from test-suite/schema-generation/group-as/group-as-misc_json-schema.json rename to test-suite/schema-generation/group-as/target/group-as-misc_metaschema-jsonschema.json index 3f1d6e2b9..01a74ecb5 100644 --- a/test-suite/schema-generation/group-as/group-as-misc_json-schema.json +++ b/test-suite/schema-generation/group-as/target/group-as-misc_metaschema-jsonschema.json @@ -1,13 +1,13 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-by-key-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-by-key/1.0-milestone1/metaschema-group-as-schema.json", "$comment" : "Metaschema Unit Test: group-as: JSON Schema", "type" : "object", "definitions" : - { "root" : + { "metaschema-group-as-metaschema-group-as:root" : { "title" : "Root", "description" : "...", - "$id" : "#/definitions/root", + "$id" : "#assembly_metaschema-group-as_root", "type" : "object", "properties" : { "information-types" : @@ -16,23 +16,20 @@ "items" : { "title" : "Information Type", "description" : "Contains details about one information type that is stored, processed, or transmitted by the system, such as privacy information, and those defined in NIST SP 800-60.", - "$id" : "#/definitions/information-type", "type" : "object", "properties" : { "uuid" : { "title" : "Information Type Universally Unique Identifier", "description" : "A globally unique identifier that can be used to reference this information type entry elsewhere in an OSCAL document. A UUID should be consistantly used for a given resource across revisions of the document.", "type" : "string", - "pattern" : "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" }, + "pattern" : "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" }, "title" : { "title" : "title field", "description" : "A human readable name for the information type. This title should be meaningful within the context of the system.", - "$id" : "#/definitions/title", "type" : "string" }, "description" : { "title" : "Information Type Description", "description" : "A summary of how this information type is used within the system.", - "$id" : "#/definitions/description", "type" : "string" }, "information-type-ids" : { "type" : "object", @@ -42,13 +39,18 @@ [ { "title" : "Information Type Identifier", "description" : "An identifier qualified by the given identification system used, such as NIST SP 800-60.", - "$id" : "#/definitions/information-type-id", "type" : "object", "properties" : - { "id" : + { "system" : + { "title" : "Information Type Identification System", + "description" : "Specifies the information type identification system used.", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "id" : { "type" : "string" } }, "required" : - [ "id" ], + [ "id", + "system" ], "additionalProperties" : false }, { "not" : @@ -56,53 +58,32 @@ "confidentiality-impact" : { "title" : "Confidentiality Impact Level", "description" : "The expected level of impact resulting from the unauthorized disclosure of information.", - "$id" : "#/definitions/confidentiality-impact", "type" : "object", "properties" : { "base" : - { "title" : "Base Level (Confidentiality, Integrity, or Availability)", - "description" : "The prescribed base (Confidentiality, Integrity, or Availability) security impact level.", - "$id" : "#/definitions/base", - "type" : "string" }, + { "$ref" : "#field_metaschema-group-as_base" }, "selected" : - { "title" : "Selected Level (Confidentiality, Integrity, or Availability)", - "description" : "The selected (Confidentiality, Integrity, or Availability) security impact level.", - "$id" : "#/definitions/selected", - "type" : "string" } }, + { "$ref" : "#field_metaschema-group-as_selected" } }, "additionalProperties" : false }, "integrity-impact" : { "title" : "Integrity Impact Level", "description" : "The expected level of impact resulting from the unauthorized modification of information.", - "$id" : "#/definitions/integrity-impact", "type" : "object", "properties" : { "base" : - { "title" : "Base Level (Confidentiality, Integrity, or Availability)", - "description" : "The prescribed base (Confidentiality, Integrity, or Availability) security impact level.", - "$id" : "#/definitions/base", - "type" : "string" }, + { "$ref" : "#field_metaschema-group-as_base" }, "selected" : - { "title" : "Selected Level (Confidentiality, Integrity, or Availability)", - "description" : "The selected (Confidentiality, Integrity, or Availability) security impact level.", - "$id" : "#/definitions/selected", - "type" : "string" } }, + { "$ref" : "#field_metaschema-group-as_selected" } }, "additionalProperties" : false }, "availability-impact" : { "title" : "Availability Impact Level", "description" : "The expected level of impact resulting from the disruption of access to or use of information or the information system.", - "$id" : "#/definitions/availability-impact", "type" : "object", "properties" : { "base" : - { "title" : "Base Level (Confidentiality, Integrity, or Availability)", - "description" : "The prescribed base (Confidentiality, Integrity, or Availability) security impact level.", - "$id" : "#/definitions/base", - "type" : "string" }, + { "$ref" : "#field_metaschema-group-as_base" }, "selected" : - { "title" : "Selected Level (Confidentiality, Integrity, or Availability)", - "description" : "The selected (Confidentiality, Integrity, or Availability) security impact level.", - "$id" : "#/definitions/selected", - "type" : "string" } }, + { "$ref" : "#field_metaschema-group-as_selected" } }, "additionalProperties" : false } }, "required" : [ "title", @@ -113,10 +94,22 @@ "additionalProperties" : false } } }, "required" : [ "information-types" ], - "additionalProperties" : false } }, + "additionalProperties" : false }, + "metaschema-group-as-metaschema-group-as:base" : + { "title" : "Base Level (Confidentiality, Integrity, or Availability)", + "description" : "The prescribed base (Confidentiality, Integrity, or Availability) security impact level.", + "$id" : "#field_metaschema-group-as_base", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "metaschema-group-as-metaschema-group-as:selected" : + { "title" : "Selected Level (Confidentiality, Integrity, or Availability)", + "description" : "The selected (Confidentiality, Integrity, or Availability) security impact level.", + "$id" : "#field_metaschema-group-as_selected", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, "properties" : { "root" : - { "$ref" : "#/definitions/root" } }, + { "$ref" : "#assembly_metaschema-group-as_root" } }, "required" : [ "root" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/group-as/target/group-as-misc_metaschema-xmlschema.xsd b/test-suite/schema-generation/group-as/target/group-as-misc_metaschema-xmlschema.xsd new file mode 100644 index 000000000..01a74ecb5 --- /dev/null +++ b/test-suite/schema-generation/group-as/target/group-as-misc_metaschema-xmlschema.xsd @@ -0,0 +1,116 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-by-key/1.0-milestone1/metaschema-group-as-schema.json", + "$comment" : "Metaschema Unit Test: group-as: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-group-as-metaschema-group-as:root" : + { "title" : "Root", + "description" : "...", + "$id" : "#assembly_metaschema-group-as_root", + "type" : "object", + "properties" : + { "information-types" : + { "type" : "array", + "minItems" : 1, + "items" : + { "title" : "Information Type", + "description" : "Contains details about one information type that is stored, processed, or transmitted by the system, such as privacy information, and those defined in NIST SP 800-60.", + "type" : "object", + "properties" : + { "uuid" : + { "title" : "Information Type Universally Unique Identifier", + "description" : "A globally unique identifier that can be used to reference this information type entry elsewhere in an OSCAL document. A UUID should be consistantly used for a given resource across revisions of the document.", + "type" : "string", + "pattern" : "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" }, + "title" : + { "title" : "title field", + "description" : "A human readable name for the information type. This title should be meaningful within the context of the system.", + "type" : "string" }, + "description" : + { "title" : "Information Type Description", + "description" : "A summary of how this information type is used within the system.", + "type" : "string" }, + "information-type-ids" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "title" : "Information Type Identifier", + "description" : "An identifier qualified by the given identification system used, such as NIST SP 800-60.", + "type" : "object", + "properties" : + { "system" : + { "title" : "Information Type Identification System", + "description" : "Specifies the information type identification system used.", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "id" : + { "type" : "string" } }, + "required" : + [ "id", + "system" ], + "additionalProperties" : false }, + + { "not" : + { "type" : "string" } } ] } }, + "confidentiality-impact" : + { "title" : "Confidentiality Impact Level", + "description" : "The expected level of impact resulting from the unauthorized disclosure of information.", + "type" : "object", + "properties" : + { "base" : + { "$ref" : "#field_metaschema-group-as_base" }, + "selected" : + { "$ref" : "#field_metaschema-group-as_selected" } }, + "additionalProperties" : false }, + "integrity-impact" : + { "title" : "Integrity Impact Level", + "description" : "The expected level of impact resulting from the unauthorized modification of information.", + "type" : "object", + "properties" : + { "base" : + { "$ref" : "#field_metaschema-group-as_base" }, + "selected" : + { "$ref" : "#field_metaschema-group-as_selected" } }, + "additionalProperties" : false }, + "availability-impact" : + { "title" : "Availability Impact Level", + "description" : "The expected level of impact resulting from the disruption of access to or use of information or the information system.", + "type" : "object", + "properties" : + { "base" : + { "$ref" : "#field_metaschema-group-as_base" }, + "selected" : + { "$ref" : "#field_metaschema-group-as_selected" } }, + "additionalProperties" : false } }, + "required" : + [ "title", + "description", + "confidentiality-impact", + "integrity-impact", + "availability-impact" ], + "additionalProperties" : false } } }, + "required" : + [ "information-types" ], + "additionalProperties" : false }, + "metaschema-group-as-metaschema-group-as:base" : + { "title" : "Base Level (Confidentiality, Integrity, or Availability)", + "description" : "The prescribed base (Confidentiality, Integrity, or Availability) security impact level.", + "$id" : "#field_metaschema-group-as_base", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "metaschema-group-as-metaschema-group-as:selected" : + { "title" : "Selected Level (Confidentiality, Integrity, or Availability)", + "description" : "The selected (Confidentiality, Integrity, or Availability) security impact level.", + "$id" : "#field_metaschema-group-as_selected", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, + "properties" : + { "root" : + { "$ref" : "#assembly_metaschema-group-as_root" } }, + "required" : + [ "root" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_json-schema.json b/test-suite/schema-generation/group-as/target/group-as-singleton-or-array-optional_metaschema-jsonschema.json similarity index 55% rename from test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_json-schema.json rename to test-suite/schema-generation/group-as/target/group-as-singleton-or-array-optional_metaschema-jsonschema.json index 44fa40825..324d206a4 100644 --- a/test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_json-schema.json +++ b/test-suite/schema-generation/group-as/target/group-as-singleton-or-array-optional_metaschema-jsonschema.json @@ -1,33 +1,34 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional/1.0-milestone1/metaschema-group-as-schema.json", "$comment" : "Metaschema Unit Test: group-as: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-group-as-metaschema-group-as:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-group-as_parent", "type" : "object", "properties" : { "props" : { "anyOf" : [ - { "$ref" : "#/definitions/prop" }, + { "$ref" : "#field_metaschema-group-as_prop" }, { "type" : "array", + "minItems" : 1, "items" : - { "$ref" : "#/definitions/prop" }, - "minItems" : 1 } ] } }, + { "$ref" : "#field_metaschema-group-as_prop" } } ] } }, "additionalProperties" : false }, - "prop" : + "metaschema-group-as-metaschema-group-as:prop" : { "title" : "prop", "description" : "prop field", - "$id" : "#/definitions/prop", - "type" : "string" } }, + "$id" : "#field_metaschema-group-as_prop", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-group-as_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/group-as/target/group-as-singleton-or-array-optional_metaschema-xmlschema.xsd b/test-suite/schema-generation/group-as/target/group-as-singleton-or-array-optional_metaschema-xmlschema.xsd new file mode 100644 index 000000000..b9667a82a --- /dev/null +++ b/test-suite/schema-generation/group-as/target/group-as-singleton-or-array-optional_metaschema-xmlschema.xsd @@ -0,0 +1,198 @@ + + + + + Metaschema Unit Test: group-as + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + prop + prop field + + + prop: prop field + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/group-as/group-as-singleton-or-array_json-schema.json b/test-suite/schema-generation/group-as/target/group-as-singleton-or-array_metaschema-jsonschema.json similarity index 56% rename from test-suite/schema-generation/group-as/group-as-singleton-or-array_json-schema.json rename to test-suite/schema-generation/group-as/target/group-as-singleton-or-array_metaschema-jsonschema.json index dc423516a..44c802ba6 100644 --- a/test-suite/schema-generation/group-as/group-as-singleton-or-array_json-schema.json +++ b/test-suite/schema-generation/group-as/target/group-as-singleton-or-array_metaschema-jsonschema.json @@ -1,35 +1,36 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array/1.0-milestone1/metaschema-group-as-schema.json", "$comment" : "Metaschema Unit Test: group-as: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-group-as-metaschema-group-as:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-group-as_parent", "type" : "object", "properties" : { "props" : { "anyOf" : [ - { "$ref" : "#/definitions/prop" }, + { "$ref" : "#field_metaschema-group-as_prop" }, { "type" : "array", + "minItems" : 1, "items" : - { "$ref" : "#/definitions/prop" }, - "minItems" : 1 } ] } }, + { "$ref" : "#field_metaschema-group-as_prop" } } ] } }, "required" : [ "props" ], "additionalProperties" : false }, - "prop" : + "metaschema-group-as-metaschema-group-as:prop" : { "title" : "prop", "description" : "prop field", - "$id" : "#/definitions/prop", - "type" : "string" } }, + "$id" : "#field_metaschema-group-as_prop", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-group-as_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/group-as/target/group-as-singleton-or-array_metaschema-xmlschema.xsd b/test-suite/schema-generation/group-as/target/group-as-singleton-or-array_metaschema-xmlschema.xsd new file mode 100644 index 000000000..98c790b0c --- /dev/null +++ b/test-suite/schema-generation/group-as/target/group-as-singleton-or-array_metaschema-xmlschema.xsd @@ -0,0 +1,198 @@ + + + + + Metaschema Unit Test: group-as + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + prop + prop field + + + prop: prop field + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/json-schema-generation.xspec b/test-suite/schema-generation/json-schema-generation.xspec new file mode 100644 index 000000000..06e2cc9fe --- /dev/null +++ b/test-suite/schema-generation/json-schema-generation.xspec @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + allowed-values/target/allowed-values-basic_metaschema-jsonschema.json + + + + + + + + + token/target/datatypes-token_metaschema-jsonschema.json + + + + + + diff --git a/test-suite/schema-generation/json-value-key/json-value-key-field_json-schema.json b/test-suite/schema-generation/json-value-key/json-value-key-field_json-schema.json deleted file mode 100644 index cc4aa6144..000000000 --- a/test-suite/schema-generation/json-value-key/json-value-key-field_json-schema.json +++ /dev/null @@ -1,49 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/json-value-key-field-schema.json", - "$comment" : "Metaschema Unit Test: json-value-key-field: JSON Schema", - "type" : "object", - "definitions" : - { "parent" : - { "title" : "parent", - "description" : "parent assembly", - "$id" : "#/definitions/parent", - "type" : "object", - "properties" : - { "props" : - { "anyOf" : - [ - { "$ref" : "#/definitions/prop" }, - - { "type" : "array", - "items" : - { "$ref" : "#/definitions/prop" }, - "minItems" : 1 } ] } }, - "additionalProperties" : false }, - "prop" : - { "title" : "Property", - "description" : "A value with a name, attributed to the containing control, subcontrol, part, or group.", - "$id" : "#/definitions/prop", - "type" : "object", - "properties" : - { "id" : - { "type" : "string", - "title" : "Identifier", - "description" : "Unique identifier of the containing object" }, - "ns" : - { "type" : "string", - "title" : "Namespace", - "description" : "A namespace qualifying the name." }, - "class" : - { "type" : "string", - "title" : "Class", - "description" : "Indicating the type or classification of the containing object" } }, - "minProperties" : 1, - "maxProperties" : 4 } }, - "properties" : - { "parent" : - { "$ref" : "#/definitions/parent" } }, - "required" : - [ "parent" ], - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/json-value-key/json-value-key-field_metaschema.xml b/test-suite/schema-generation/json-value-key/json-value-key-field_metaschema.xml index 2e59b0dbd..70a4b4a72 100644 --- a/test-suite/schema-generation/json-value-key/json-value-key-field_metaschema.xml +++ b/test-suite/schema-generation/json-value-key/json-value-key-field_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: json-value-key-field 1.0-milestone1 json-value-key-field http://csrc.nist.gov/ns/metaschema/unit-test/json-value-key-field + http://csrc.nist.gov/ns/metaschema/unit-test/json-value-key-field parent parent assembly @@ -22,7 +21,7 @@ Property A value with a name, attributed to the containing control, subcontrol, part, or group. - + @@ -32,7 +31,7 @@ Name Identifying the purpose and intended use of the property, part or other object.
- + Identifier Unique identifier of the containing object diff --git a/test-suite/schema-generation/json-value-key/json-value-key-field_xml-schema.xsd b/test-suite/schema-generation/json-value-key/json-value-key-field_xml-schema.xsd deleted file mode 100644 index 211969752..000000000 --- a/test-suite/schema-generation/json-value-key/json-value-key-field_xml-schema.xsd +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Metaschema Unit Test: json-value-key-field - 1.0-milestone1 - json-value-key-field - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - Property - A value with a name, attributed to the containing control, subcontrol, part, or group. - - - Property: A value with a name, attributed to the containing control, subcontrol, part, or group. - - - - - - - Name - Identifying the purpose and intended use of the property, part or other object. - - - Name: Identifying the purpose and intended use of the property, part or other object. - - - - - - Identifier - Unique identifier of the containing object - - - Identifier: Unique identifier of the containing object - - - - - - Namespace - A namespace qualifying the name. - - - Namespace: A namespace qualifying the name. - - - - - - Class - Indicating the type or classification of the containing object - - - Class: Indicating the type or classification of the containing object - - - - - - diff --git a/test-suite/schema-generation/json-value-key/json-value-key-label_json-schema.json b/test-suite/schema-generation/json-value-key/json-value-key-label_json-schema.json deleted file mode 100644 index 1bc65ac42..000000000 --- a/test-suite/schema-generation/json-value-key/json-value-key-label_json-schema.json +++ /dev/null @@ -1,54 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/json-value-key-label-schema.json", - "$comment" : "Metaschema Unit Test: json-value-key-label: JSON Schema", - "type" : "object", - "definitions" : - { "parent" : - { "title" : "parent", - "description" : "parent assembly", - "$id" : "#/definitions/parent", - "type" : "object", - "properties" : - { "links" : - { "anyOf" : - [ - { "$ref" : "#/definitions/link" }, - - { "type" : "array", - "items" : - { "$ref" : "#/definitions/link" }, - "minItems" : 1 } ] } }, - "additionalProperties" : false }, - "link" : - { "title" : "Link", - "description" : "A reference to a local or remote resource", - "$id" : "#/definitions/link", - "type" : "object", - "properties" : - { "href" : - { "type" : "string", - "format" : "uri-reference", - "title" : "hypertext reference", - "description" : "A link to a document or document fragment (actual, nominal or projected)" }, - "rel" : - { "type" : "string", - "title" : "Relation", - "description" : "Purpose of the link" }, - "media-type" : - { "type" : "string", - "title" : "Media type", - "description" : "Describes the media type of a linked resource" }, - "text" : - { "type" : "string" } }, - "required" : - [ "text", - "href" ], - "additionalProperties" : false } }, - "properties" : - { "parent" : - { "$ref" : "#/definitions/parent" } }, - "required" : - [ "parent" ], - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/json-value-key/json-value-key-label_metaschema.xml b/test-suite/schema-generation/json-value-key/json-value-key-label_metaschema.xml index e07badcff..ec6fca9c5 100644 --- a/test-suite/schema-generation/json-value-key/json-value-key-label_metaschema.xml +++ b/test-suite/schema-generation/json-value-key/json-value-key-label_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: json-value-key-label 1.0-milestone1 json-value-key-label http://csrc.nist.gov/ns/metaschema/unit-test/json-value-key-label + http://csrc.nist.gov/ns/metaschema/unit-test/json-value-key-label parent parent assembly @@ -31,7 +30,7 @@ hypertext reference A link to a document or document fragment (actual, nominal or projected) - + Relation Purpose of the link diff --git a/test-suite/schema-generation/json-value-key/json-value-key-label_test_valid2_PASS.json b/test-suite/schema-generation/json-value-key/json-value-key-label_test_valid2_PASS.json new file mode 100644 index 000000000..536389038 --- /dev/null +++ b/test-suite/schema-generation/json-value-key/json-value-key-label_test_valid2_PASS.json @@ -0,0 +1,20 @@ +{ + "parent": { + "links": [ + { + "href": "./path", + "text": "value1" + }, + { + "text": "value1", + "href": "https://nist.gov/blah", + "rel": "rel1" + }, + { + "text": "value1", + "href": "https://nist.gov/blah", + "rel": "rel2" + } + ] + } +} diff --git a/test-suite/schema-generation/json-value-key/json-value-key-label_test_valid_PASS.json b/test-suite/schema-generation/json-value-key/json-value-key-label_test_valid_PASS.json new file mode 100644 index 000000000..14d88bdc2 --- /dev/null +++ b/test-suite/schema-generation/json-value-key/json-value-key-label_test_valid_PASS.json @@ -0,0 +1,9 @@ +{ + "parent": { + "links": + { + "href": "#fragment", + "text": "link text" + } + } +} diff --git a/test-suite/schema-generation/json-value-key/json-value-key-label_xml-schema.xsd b/test-suite/schema-generation/json-value-key/json-value-key-label_xml-schema.xsd deleted file mode 100644 index aedc0425f..000000000 --- a/test-suite/schema-generation/json-value-key/json-value-key-label_xml-schema.xsd +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Metaschema Unit Test: json-value-key-label - 1.0-milestone1 - json-value-key-label - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - - Link - A reference to a local or remote resource - - - Link: A reference to a local or remote resource - - - - - - - hypertext reference - A link to a document or document fragment (actual, nominal or projected) - - - hypertext reference: A link to a document or document fragment (actual, nominal or projected) - - - - - - Relation - Purpose of the link - - - Relation: Purpose of the link - - - - - - Media type - Describes the media type of a linked resource - - - Media type: Describes the media type of a linked resource - - - - - - - - A URI reference, such as a relative URL - - - - - - diff --git a/test-suite/schema-generation/json-value-key/readme.md b/test-suite/schema-generation/json-value-key/readme.md new file mode 100644 index 000000000..f34161380 --- /dev/null +++ b/test-suite/schema-generation/json-value-key/readme.md @@ -0,0 +1,57 @@ +# JSON value key + +**Status** - untested, unknown - **TBD** + +These tests are known to have run in the past but current status is not confirmed. + +## Tasks + +- replace `flag-name` with `flag-ref` throughout +- follow `@json-key-flag` assignment downstream in metaschema pipeline + +## Summary + +Assignment of either static or dynamic value keys for fields in JSON data + +Only fields have 'value' properties that typically must be renamed in exposed data. + +### Static value key + +A static assignments sets the string that will be used as the value key. + +### Dynamic value key + +A dynamic assignment binds the key to a flag on the field. Whatever that flag's value is, this value is used as the *key* for the JSON property that will be treated as the value. + +This weirdness is easiest to see by comparing XML to JSON. + +So we declare a repeatable field called "holiday", with a flag and a value. The flag represents the ISO date form of a given date. The value names a holiday that occurs on that date. So, + +```xml +Independence Day 2022 +Veteran's Day 2022 +``` + +The metaschema permits grouping these objects as "holidays", while also promoting the `date` flag to be the value key for each "holiday" object in the JSON: + +```json +"holidays": [ + { "2022-07-04": "Independence Day 2022" } + { "2022-11-11": "Veteran's Day 2022" } +] +``` + +Note: the *value* of the field is always its string (text) value in XML, aka its "content". (Note that in cases of markup-line and markup-multiline, this content may be markup or have markup.) In XML this value needs no explicit label. + +Without this feature promoting a flag to serve as JSON key we could encode, less concisely, + +```json +"holidays": [ + { date: "2022-07-04", name: "Independence Day 2022" }, + { date: "2022-11-11": name: "Veteran's Day 2022" } +] +``` + +We would achieve this by setting the json-value-key to "name" (since "name" is the name we give to the value). + +Special note: assigning a flag this role also implies a new constraint, namely that this value is also distinctive among sibling objects. diff --git a/test-suite/schema-generation/json-value-key/target/json-value-key-field_metaschema-xmlschema.xsd b/test-suite/schema-generation/json-value-key/target/json-value-key-field_metaschema-xmlschema.xsd new file mode 100644 index 000000000..cb2241bbe --- /dev/null +++ b/test-suite/schema-generation/json-value-key/target/json-value-key-field_metaschema-xmlschema.xsd @@ -0,0 +1,248 @@ + + + + + Metaschema Unit Test: json-value-key-field + 1.0-milestone1 + json-value-key-field + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + Property + A value with a name, attributed to the containing control, subcontrol, part, or group. + + + Property: A value with a name, attributed to the containing control, subcontrol, part, or group. + + + + + + + Name + Identifying the purpose and intended use of the property, part or other object. + + + Name: Identifying the purpose and intended use of the property, part or other object. + + + + + + Identifier + Unique identifier of the containing object + + + Identifier: Unique identifier of the containing object + + + + + + Namespace + A namespace qualifying the name. + + + Namespace: A namespace qualifying the name. + + + + + + Class + Indicating the type or classification of the containing object + + + Class: Indicating the type or classification of the containing object + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + A string token following the rules of XML "no colon" names, with no whitespace. (XML names are single alphabetic characters + followed by alphanumeric characters, periods, underscores or dashes.) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/json-value-key/target/json-value-key-label_metaschema-xmlschema.xsd b/test-suite/schema-generation/json-value-key/target/json-value-key-label_metaschema-xmlschema.xsd new file mode 100644 index 000000000..5219d2331 --- /dev/null +++ b/test-suite/schema-generation/json-value-key/target/json-value-key-label_metaschema-xmlschema.xsd @@ -0,0 +1,246 @@ + + + + + Metaschema Unit Test: json-value-key-label + 1.0-milestone1 + json-value-key-label + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + Link + A reference to a local or remote resource + + + Link: A reference to a local or remote resource + + + + + + + hypertext reference + A link to a document or document fragment (actual, nominal or projected) + + + hypertext reference: A link to a document or document fragment (actual, nominal or projected) + + + + + + Relation + Purpose of the link + + + Relation: Purpose of the link + + + + + + Media type + Describes the media type of a linked resource + + + Media type: Describes the media type of a linked resource + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + A URI reference, such as a relative URL + + + + + + A string token following the rules of XML "no colon" names, with no whitespace. (XML names are single alphabetic characters + followed by alphanumeric characters, periods, underscores or dashes.) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/local-declarations/global-and-local_generated-xml-schema.xsd b/test-suite/schema-generation/local-declarations/global-and-local_generated-xml-schema.xsd deleted file mode 100644 index 06d39e62b..000000000 --- a/test-suite/schema-generation/local-declarations/global-and-local_generated-xml-schema.xsd +++ /dev/null @@ -1,150 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - Field defined locally - Has a local definition - - - Field defined locally: Has a local definition - - - - - - - - - - - - Assembly defined locally - Has a local definition - - - Assembly defined locally: Has a local definition - - - - - - - Field defined locally - Has a local definition - - - Field defined locally: Has a local definition - - - - - - - - - - - - - - - - Flag defined locally - Has a local definition - - - Flag defined locally: Has a local definition - - - - - - Flag defined globally - Has a global definition - - - Flag defined globally: Has a global definition - - - - - - - Field defined globally - Has a global definition - - - Field defined globally: Has a global definition - - - - - - - - - Assembly defined globally - Has a global definition - - - Assembly defined globally: Has a global definition - - - - - - - Field defined locally - Has a local definition - - - Field defined locally: Has a local definition - - - - - - - - - - diff --git a/test-suite/schema-generation/local-declarations/global-and-local_metaschema.xml b/test-suite/schema-generation/local-declarations/global-and-local_metaschema.xml index 465dc3eef..72769a555 100644 --- a/test-suite/schema-generation/local-declarations/global-and-local_metaschema.xml +++ b/test-suite/schema-generation/local-declarations/global-and-local_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional + http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional parent parent assembly diff --git a/test-suite/schema-generation/local-declarations/global-and-scoped-local_generated-json-schema.json b/test-suite/schema-generation/local-declarations/global-and-scoped-local_generated-json-schema.json deleted file mode 100644 index 9ebd7212e..000000000 --- a/test-suite/schema-generation/local-declarations/global-and-scoped-local_generated-json-schema.json +++ /dev/null @@ -1,70 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional-schema.json", - "$comment" : "Metaschema Unit Test: group-as: JSON Schema", - "type" : "object", - "definitions" : - { "parent" : - { "title" : "parent", - "description" : "parent assembly", - "$id" : "#/definitions/parent", - "type" : "object", - "properties" : - { "local-flag" : - { "title" : "Flag defined locally", - "description" : "Has a local definition", - "type" : "string" }, - "global-flag" : - { "title" : "Flag defined globally", - "description" : "Has a global definition", - "type" : "string" }, - "global-field" : - { "$ref" : "#/definitions/global-field" }, - "top-level-local-field" : - { "title" : "Field defined with scope='local', at top level", - "description" : "Should result in a local definition", - "$id" : "#/definitions/top-level-local-field", - "type" : "string" }, - "top-level-local-assembly" : - { "title" : "Assembly defined with scope='local', at top level", - "description" : "Should result as local", - "$id" : "#/definitions/top-level-local-assembly", - "type" : "object", - "properties" : - { "top-level-local-field" : - { "title" : "Field defined with scope='local', at top level", - "description" : "Should result in a local definition", - "$id" : "#/definitions/top-level-local-field", - "type" : "string" }, - "global-field" : - { "$ref" : "#/definitions/global-field" } }, - "additionalProperties" : false }, - "global-assembly" : - { "$ref" : "#/definitions/global-assembly" } }, - "additionalProperties" : false }, - "global-field" : - { "title" : "Field defined globally", - "description" : "Has a global definition", - "$id" : "#/definitions/global-field", - "type" : "string" }, - "global-assembly" : - { "title" : "Assembly defined globally", - "description" : "Has a global definition", - "$id" : "#/definitions/global-assembly", - "type" : "object", - "properties" : - { "local-field2" : - { "title" : "Field defined locally", - "description" : "Has a local definition", - "$id" : "#/definitions/local-field2", - "type" : "string" }, - "global-field" : - { "$ref" : "#/definitions/global-field" } }, - "additionalProperties" : false } }, - "properties" : - { "parent" : - { "$ref" : "#/definitions/parent" } }, - "required" : - [ "parent" ], - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/local-declarations/global-and-scoped-local_generated-xml-schema.xsd b/test-suite/schema-generation/local-declarations/global-and-scoped-local_generated-xml-schema.xsd deleted file mode 100644 index 11475e4ad..000000000 --- a/test-suite/schema-generation/local-declarations/global-and-scoped-local_generated-xml-schema.xsd +++ /dev/null @@ -1,150 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - Field defined with scope='local', at top level - Should result in a local definition - - - Field defined with scope='local', at top level: Should result in a local definition - - - - - - - - - - - Assembly defined with scope='local', at top level - Should result as local - - - Assembly defined with scope='local', at top level: Should result as local - - - - - - - Field defined with scope='local', at top level - Should result in a local definition - - - Field defined with scope='local', at top level: Should result in a local definition - - - - - - - - - - - - - - - - Flag defined locally - Has a local definition - - - Flag defined locally: Has a local definition - - - - - - Flag defined globally - Has a global definition - - - Flag defined globally: Has a global definition - - - - - - - Field defined globally - Has a global definition - - - Field defined globally: Has a global definition - - - - - - - - - Assembly defined globally - Has a global definition - - - Assembly defined globally: Has a global definition - - - - - - - Field defined locally - Has a local definition - - - Field defined locally: Has a local definition - - - - - - - - - - diff --git a/test-suite/schema-generation/local-declarations/global-and-scoped-local_metaschema.xml b/test-suite/schema-generation/local-declarations/global-and-scoped-local_metaschema.xml index 1f30445f9..e7833b975 100644 --- a/test-suite/schema-generation/local-declarations/global-and-scoped-local_metaschema.xml +++ b/test-suite/schema-generation/local-declarations/global-and-scoped-local_metaschema.xml @@ -1,14 +1,13 @@ - + - + Metaschema Unit Test: group-as 1.0-milestone1 metaschema-group-as http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional + http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional parent parent assembly diff --git a/test-suite/schema-generation/local-declarations/modular_metaschema.xml b/test-suite/schema-generation/local-declarations/modular_metaschema.xml index 9029a2a41..4145c0e6f 100644 --- a/test-suite/schema-generation/local-declarations/modular_metaschema.xml +++ b/test-suite/schema-generation/local-declarations/modular_metaschema.xml @@ -1,13 +1,12 @@ - - + + OSCAL Control Catalog Format 1.0.0-milestone3 oscal-catalog http://csrc.nist.gov/ns/metaschema/test + http://csrc.nist.gov/ns/metaschema/test

For exercising Metaschema semantics with respect to modular assembly and composition.

diff --git a/test-suite/schema-generation/local-declarations/modular_xml-schema.xsd b/test-suite/schema-generation/local-declarations/modular_xml-schema.xsd deleted file mode 100644 index db76cdd16..000000000 --- a/test-suite/schema-generation/local-declarations/modular_xml-schema.xsd +++ /dev/null @@ -1,169 +0,0 @@ - - - - - OSCAL Control Catalog Format - 1.0.0-milestone3 - oscal-catalog - -

For exercising Metaschema semantics with respect to modular assembly and composition.

-
- root-assembly -
-
- - - - Assembly defined in a module - XXX - - - Assembly defined in a module: XXX - - - - - - - - Field, defined in a module as 'local' - XXX - - - Field, defined in a module as 'local': XXX - - - - - - - - - - - Locally defined field - XXX - - - Locally defined field: XXX - - - - - - - - - - - Locally defined flag - XXX - - - Locally defined flag: XXX - - - - - - - Field, defined in a module (global by default) - XXX - - - Field, defined in a module (global by default): XXX - - - - - - - - - - Nominal root - XXX - - - Nominal root: XXX - - - - - - - - Field, defined at top level as 'local' - XXX - - - Field, defined at top level as 'local': XXX - - - - - - - - - - - Locally defined field - XXX - - - Locally defined field: XXX - - - - - - - - - - - Flag, defined at top level - XXX - - - Flag, defined at top level: XXX - - - - - - Locally defined flag - XXX - - - Locally defined flag: XXX - - - - - - - Field, defined at top level (global by default) - XXX - - - Field, defined at top level (global by default): XXX - - - - - -
diff --git a/test-suite/schema-generation/local-declarations/modules/module_metaschema.xml b/test-suite/schema-generation/local-declarations/modules/module_metaschema.xml index 5969e874d..f33c9fd29 100644 --- a/test-suite/schema-generation/local-declarations/modules/module_metaschema.xml +++ b/test-suite/schema-generation/local-declarations/modules/module_metaschema.xml @@ -1,15 +1,13 @@ - + - + OSCAL Control Catalog Format 1.0.0-milestone3 oscal-catalog http://csrc.nist.gov/ns/metaschema/test + http://csrc.nist.gov/ns/metaschema/test

For exercising Metaschema semantics with respect to modular assembly and composition.

diff --git a/test-suite/schema-generation/local-declarations/readme.md b/test-suite/schema-generation/local-declarations/readme.md new file mode 100644 index 000000000..17a71340c --- /dev/null +++ b/test-suite/schema-generation/local-declarations/readme.md @@ -0,0 +1,7 @@ +# Local definitions + +*Not* declarations + +**Status** - untested, unknown - + +These tests are known to have run in the past but current status is not confirmed. diff --git a/test-suite/schema-generation/local-declarations/global-and-local_generated-json-schema.json b/test-suite/schema-generation/local-declarations/target/global-and-local_metaschema-jsonschema.json similarity index 63% rename from test-suite/schema-generation/local-declarations/global-and-local_generated-json-schema.json rename to test-suite/schema-generation/local-declarations/target/global-and-local_metaschema-jsonschema.json index 27fc97139..27230ae64 100644 --- a/test-suite/schema-generation/local-declarations/global-and-local_generated-json-schema.json +++ b/test-suite/schema-generation/local-declarations/target/global-and-local_metaschema-jsonschema.json @@ -1,29 +1,32 @@ { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional-schema.json", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional/1.0-milestone1/metaschema-group-as-schema.json", "$comment" : "Metaschema Unit Test: group-as: JSON Schema", "type" : "object", "definitions" : - { "parent" : + { "metaschema-group-as-metaschema-group-as:parent" : { "title" : "parent", "description" : "parent assembly", - "$id" : "#/definitions/parent", + "$id" : "#assembly_metaschema-group-as_parent", "type" : "object", "properties" : { "local-flag" : { "title" : "Flag defined locally", "description" : "Has a local definition", - "type" : "string" }, + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, "global-flag" : { "title" : "Flag defined globally", "description" : "Has a global definition", - "type" : "string" }, + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, "local-field" : { "title" : "Field defined locally", "description" : "Has a local definition", - "type" : "string" }, + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, "global-field" : - { "$ref" : "#/definitions/global-field" }, + { "$ref" : "#field_metaschema-group-as_global-field" }, "local-assemblies" : { "anyOf" : [ @@ -34,9 +37,10 @@ { "local-field2" : { "title" : "Field defined locally", "description" : "Has a local definition", - "type" : "string" }, + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, "global-field" : - { "$ref" : "#/definitions/global-field" } }, + { "$ref" : "#field_metaschema-group-as_global-field" } }, "additionalProperties" : false }, { "type" : "array", @@ -49,34 +53,37 @@ { "local-field2" : { "title" : "Field defined locally", "description" : "Has a local definition", - "type" : "string" }, + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, "global-field" : - { "$ref" : "#/definitions/global-field" } }, + { "$ref" : "#field_metaschema-group-as_global-field" } }, "additionalProperties" : false } } ] }, "global-assembly" : - { "$ref" : "#/definitions/global-assembly" } }, + { "$ref" : "#assembly_metaschema-group-as_global-assembly" } }, "additionalProperties" : false }, - "global-field" : + "metaschema-group-as-metaschema-group-as:global-field" : { "title" : "Field defined globally", "description" : "Has a global definition", - "$id" : "#/definitions/global-field", - "type" : "string" }, - "global-assembly" : + "$id" : "#field_metaschema-group-as_global-field", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "metaschema-group-as-metaschema-group-as:global-assembly" : { "title" : "Assembly defined globally", "description" : "Has a global definition", - "$id" : "#/definitions/global-assembly", + "$id" : "#assembly_metaschema-group-as_global-assembly", "type" : "object", "properties" : { "local-field2" : { "title" : "Field defined locally", "description" : "Has a local definition", - "type" : "string" }, + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, "global-field" : - { "$ref" : "#/definitions/global-field" } }, + { "$ref" : "#field_metaschema-group-as_global-field" } }, "additionalProperties" : false } }, "properties" : { "parent" : - { "$ref" : "#/definitions/parent" } }, + { "$ref" : "#assembly_metaschema-group-as_parent" } }, "required" : [ "parent" ], "additionalProperties" : false, diff --git a/test-suite/schema-generation/local-declarations/target/global-and-local_metaschema-xmlschema.xsd b/test-suite/schema-generation/local-declarations/target/global-and-local_metaschema-xmlschema.xsd new file mode 100644 index 000000000..b65625ec0 --- /dev/null +++ b/test-suite/schema-generation/local-declarations/target/global-and-local_metaschema-xmlschema.xsd @@ -0,0 +1,295 @@ + + + + + Metaschema Unit Test: group-as + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + Field defined locally + Has a local definition + + + Field defined locally: Has a local definition + + + + + + + + + + Assembly defined locally + Has a local definition + + + Assembly defined locally: Has a local definition + + + + + + + Field defined locally + Has a local definition + + + Field defined locally: Has a local definition + + + + + + + + + + + + + + Flag defined locally + Has a local definition + + + Flag defined locally: Has a local definition + + + + + + Flag defined globally + Has a global definition + + + Flag defined globally: Has a global definition + + + + + + + Field defined globally + Has a global definition + + + Field defined globally: Has a global definition + + + + + + + Assembly defined globally + Has a global definition + + + Assembly defined globally: Has a global definition + + + + + + + Field defined locally + Has a local definition + + + Field defined locally: Has a local definition + + + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/local-declarations/target/global-and-scoped-local_metaschema-jsonschema.json b/test-suite/schema-generation/local-declarations/target/global-and-scoped-local_metaschema-jsonschema.json new file mode 100644 index 000000000..495d60673 --- /dev/null +++ b/test-suite/schema-generation/local-declarations/target/global-and-scoped-local_metaschema-jsonschema.json @@ -0,0 +1,75 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional/1.0-milestone1/metaschema-group-as-schema.json", + "$comment" : "Metaschema Unit Test: group-as: JSON Schema", + "type" : "object", + "definitions" : + { "metaschema-group-as-metaschema-group-as:parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#assembly_metaschema-group-as_parent", + "type" : "object", + "properties" : + { "local-flag" : + { "title" : "Flag defined locally", + "description" : "Has a local definition", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "global-flag" : + { "title" : "Flag defined globally", + "description" : "Has a global definition", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "global-field" : + { "$ref" : "#field_metaschema-group-as_global-field" }, + "top-level-local-field" : + { "$ref" : "#field_metaschema-group-as_top-level-local-field" }, + "top-level-local-assembly" : + { "$ref" : "#assembly_metaschema-group-as_top-level-local-assembly" }, + "global-assembly" : + { "$ref" : "#assembly_metaschema-group-as_global-assembly" } }, + "additionalProperties" : false }, + "metaschema-group-as-metaschema-group-as:top-level-local-field" : + { "title" : "Field defined with scope='local', at top level", + "description" : "Should result in a local definition", + "$id" : "#field_metaschema-group-as_top-level-local-field", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "metaschema-group-as-metaschema-group-as:top-level-local-assembly" : + { "title" : "Assembly defined with scope='local', at top level", + "description" : "Should result as local", + "$id" : "#assembly_metaschema-group-as_top-level-local-assembly", + "type" : "object", + "properties" : + { "top-level-local-field" : + { "$ref" : "#field_metaschema-group-as_top-level-local-field" }, + "global-field" : + { "$ref" : "#field_metaschema-group-as_global-field" } }, + "additionalProperties" : false }, + "metaschema-group-as-metaschema-group-as:global-field" : + { "title" : "Field defined globally", + "description" : "Has a global definition", + "$id" : "#field_metaschema-group-as_global-field", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "metaschema-group-as-metaschema-group-as:global-assembly" : + { "title" : "Assembly defined globally", + "description" : "Has a global definition", + "$id" : "#assembly_metaschema-group-as_global-assembly", + "type" : "object", + "properties" : + { "local-field2" : + { "title" : "Field defined locally", + "description" : "Has a local definition", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "global-field" : + { "$ref" : "#field_metaschema-group-as_global-field" } }, + "additionalProperties" : false } }, + "properties" : + { "parent" : + { "$ref" : "#assembly_metaschema-group-as_parent" } }, + "required" : + [ "parent" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/local-declarations/target/global-and-scoped-local_metaschema-xmlschema.xsd b/test-suite/schema-generation/local-declarations/target/global-and-scoped-local_metaschema-xmlschema.xsd new file mode 100644 index 000000000..86c5bc0ee --- /dev/null +++ b/test-suite/schema-generation/local-declarations/target/global-and-scoped-local_metaschema-xmlschema.xsd @@ -0,0 +1,290 @@ + + + + + Metaschema Unit Test: group-as + 1.0-milestone1 + metaschema-group-as + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + + + + Flag defined locally + Has a local definition + + + Flag defined locally: Has a local definition + + + + + + Flag defined globally + Has a global definition + + + Flag defined globally: Has a global definition + + + + + + + Field defined with scope='local', at top level + Should result in a local definition + + + Field defined with scope='local', at top level: Should result in a local definition + + + + + + + Assembly defined with scope='local', at top level + Should result as local + + + Assembly defined with scope='local', at top level: Should result as local + + + + + + + + + + Field defined globally + Has a global definition + + + Field defined globally: Has a global definition + + + + + + + Assembly defined globally + Has a global definition + + + Assembly defined globally: Has a global definition + + + + + + + Field defined locally + Has a local definition + + + Field defined locally: Has a local definition + + + + + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/local-declarations/target/modular_metaschema-jsonschema.json b/test-suite/schema-generation/local-declarations/target/modular_metaschema-jsonschema.json new file mode 100644 index 000000000..7f263253d --- /dev/null +++ b/test-suite/schema-generation/local-declarations/target/modular_metaschema-jsonschema.json @@ -0,0 +1,84 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/test/1.0.0-milestone3/oscal-catalog-schema.json", + "$comment" : "OSCAL Control Catalog Format: JSON Schema", + "type" : "object", + "definitions" : + { "oscal-catalog-oscal-catalog:root" : + { "title" : "Nominal root", + "description" : "XXX", + "$id" : "#assembly_oscal-catalog_root", + "type" : "object", + "properties" : + { "top-level-flag" : + { "title" : "Flag, defined at top level", + "description" : "XXX", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "local-flag" : + { "title" : "Locally defined flag", + "description" : "XXX", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "top-level-global-field" : + { "$ref" : "#field_oscal-catalog_top-level-global-field" }, + "top-level-local-field" : + { "$ref" : "#field_oscal-catalog_top-level-local-field" }, + "local-field" : + { "title" : "Locally defined field", + "description" : "XXX", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, + "additionalProperties" : false }, + "oscal-catalog-oscal-catalog:top-level-global-field" : + { "title" : "Field, defined at top level (global by default)", + "description" : "XXX", + "$id" : "#field_oscal-catalog_top-level-global-field", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "oscal-catalog-oscal-catalog:top-level-local-field" : + { "title" : "Field, defined at top level as 'local'", + "description" : "XXX", + "$id" : "#field_oscal-catalog_top-level-local-field", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "oscal-catalog-oscal-catalog:module-assembly" : + { "title" : "Assembly defined in a module", + "description" : "XXX", + "$id" : "#assembly_oscal-catalog_module-assembly", + "type" : "object", + "properties" : + { "local-flag" : + { "title" : "Locally defined flag", + "description" : "XXX", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "module-global-field" : + { "$ref" : "#field_oscal-catalog_module-global-field" }, + "module-top-level-local-field" : + { "$ref" : "#field_oscal-catalog_module-top-level-local-field" }, + "module-local-field" : + { "title" : "Locally defined field", + "description" : "XXX", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, + "additionalProperties" : false }, + "oscal-catalog-oscal-catalog:module-global-field" : + { "title" : "Field, defined in a module (global by default)", + "description" : "XXX", + "$id" : "#field_oscal-catalog_module-global-field", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "oscal-catalog-oscal-catalog:module-top-level-local-field" : + { "title" : "Field, defined in a module as 'local'", + "description" : "XXX", + "$id" : "#field_oscal-catalog_module-top-level-local-field", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" } }, + "properties" : + { "root-assembly" : + { "$ref" : "#assembly_oscal-catalog_root" } }, + "required" : + [ "root-assembly" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/local-declarations/target/modular_metaschema-xmlschema.xsd b/test-suite/schema-generation/local-declarations/target/modular_metaschema-xmlschema.xsd new file mode 100644 index 000000000..57f9e93bf --- /dev/null +++ b/test-suite/schema-generation/local-declarations/target/modular_metaschema-xmlschema.xsd @@ -0,0 +1,313 @@ + + + + + OSCAL Control Catalog Format + 1.0.0-milestone3 + oscal-catalog + +

For exercising Metaschema semantics with respect to modular assembly and composition.

+
+ root-assembly +
+
+ + + + + Nominal root + XXX + + + Nominal root: XXX + + + + + + + + + Locally defined field + XXX + + + Locally defined field: XXX + + + + + + + + + Flag, defined at top level + XXX + + + Flag, defined at top level: XXX + + + + + + Locally defined flag + XXX + + + Locally defined flag: XXX + + + + + + + Field, defined at top level (global by default) + XXX + + + Field, defined at top level (global by default): XXX + + + + + + + Field, defined at top level as 'local' + XXX + + + Field, defined at top level as 'local': XXX + + + + + + + Assembly defined in a module + XXX + + + Assembly defined in a module: XXX + + + + + + + + + Locally defined field + XXX + + + Locally defined field: XXX + + + + + + + + + Locally defined flag + XXX + + + Locally defined flag: XXX + + + + + + + Field, defined in a module (global by default) + XXX + + + Field, defined in a module (global by default): XXX + + + + + + + Field, defined in a module as 'local' + XXX + + + Field, defined in a module as 'local': XXX + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + +
diff --git a/test-suite/schema-generation/run-tests.sh b/test-suite/schema-generation/run-tests.sh index 75802df3b..da09fd671 100755 --- a/test-suite/schema-generation/run-tests.sh +++ b/test-suite/schema-generation/run-tests.sh @@ -9,7 +9,7 @@ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)/../../scripts/i # configuration UNIT_TESTS_DIR=$(get_abs_path "${METASCHEMA_SCRIPT_DIR}/../test-suite/schema-generation") -METASCHEMA_SCHEMA=$(get_abs_path "${METASCHEMA_SCRIPT_DIR}/../toolchains/xslt-M4/validate/metaschema.xsd") +METASCHEMA_SCHEMA=$(get_abs_path "${METASCHEMA_SCRIPT_DIR}/../schema/xml/metaschema.xsd") DEBUG="false" # Option defaults @@ -208,7 +208,7 @@ fi # compile the schematron metaschema_lib=$(get_abs_path "${METASCHEMA_SCRIPT_DIR}/../toolchains/xslt-M4/validate") -schematron="$metaschema_lib/metaschema-check.sch" +schematron="$metaschema_lib/metaschema-composition-check.sch" compiled_schematron="${SCRATCH_DIR}/metaschema-schematron-compiled.xsl" build_schematron "$schematron" "$compiled_schematron" diff --git a/test-suite/schema-generation/schemagen-test-helper.xsl b/test-suite/schema-generation/schemagen-test-helper.xsl new file mode 100644 index 000000000..0f51d1072 --- /dev/null +++ b/test-suite/schema-generation/schemagen-test-helper.xsl @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + ... + + + + + + + + + + + diff --git a/test-suite/schema-generation/scratchdir/local-declarations/global-and-local.svrl b/test-suite/schema-generation/scratchdir/local-declarations/global-and-local.svrl deleted file mode 100644 index ff18433d5..000000000 --- a/test-suite/schema-generation/scratchdir/local-declarations/global-and-local.svrl +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test-suite/schema-generation/scratchdir/local-declarations/global-and-local_generated-json-schema.json b/test-suite/schema-generation/scratchdir/local-declarations/global-and-local_generated-json-schema.json deleted file mode 100644 index 931da3daa..000000000 --- a/test-suite/schema-generation/scratchdir/local-declarations/global-and-local_generated-json-schema.json +++ /dev/null @@ -1,70 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional-schema.json", - "$comment" : "Metaschema Unit Test: group-as: JSON Schema", - "type" : "object", - "definitions" : - { "parent" : - { "title" : "parent", - "description" : "parent assembly", - "$id" : "#/definitions/parent", - "type" : "object", - "properties" : - { "local-flag" : - { "title" : "Flag defined locally", - "description" : "Has a local definition", - "type" : "string" }, - "global-flag" : - { "title" : "Flag defined globally", - "description" : "Has a global definition", - "type" : "string" }, - "local-field" : - { "title" : "Field defined locally", - "description" : "Has a local definition", - "$id" : "#/definitions/local-field", - "type" : "string" }, - "global-field" : - { "$ref" : "#/definitions/global-field" }, - "local-assembly" : - { "title" : "Assembly defined locally", - "description" : "Has a local definition", - "$id" : "#/definitions/local-assembly", - "type" : "object", - "properties" : - { "local-field2" : - { "title" : "Field defined locally", - "description" : "Has a local definition", - "$id" : "#/definitions/local-field2", - "type" : "string" }, - "global-field" : - { "$ref" : "#/definitions/global-field" } }, - "additionalProperties" : false }, - "global-assembly" : - { "$ref" : "#/definitions/global-assembly" } }, - "additionalProperties" : false }, - "global-field" : - { "title" : "Field defined globally", - "description" : "Has a global definition", - "$id" : "#/definitions/global-field", - "type" : "string" }, - "global-assembly" : - { "title" : "Assembly defined globally", - "description" : "Has a global definition", - "$id" : "#/definitions/global-assembly", - "type" : "object", - "properties" : - { "local-field2" : - { "title" : "Field defined locally", - "description" : "Has a local definition", - "$id" : "#/definitions/local-field2", - "type" : "string" }, - "global-field" : - { "$ref" : "#/definitions/global-field" } }, - "additionalProperties" : false } }, - "properties" : - { "parent" : - { "$ref" : "#/definitions/parent" } }, - "required" : - [ "parent" ], - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/scratchdir/local-declarations/global-and-local_generated-xml-schema.xsd b/test-suite/schema-generation/scratchdir/local-declarations/global-and-local_generated-xml-schema.xsd deleted file mode 100644 index 06d39e62b..000000000 --- a/test-suite/schema-generation/scratchdir/local-declarations/global-and-local_generated-xml-schema.xsd +++ /dev/null @@ -1,150 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - Field defined locally - Has a local definition - - - Field defined locally: Has a local definition - - - - - - - - - - - - Assembly defined locally - Has a local definition - - - Assembly defined locally: Has a local definition - - - - - - - Field defined locally - Has a local definition - - - Field defined locally: Has a local definition - - - - - - - - - - - - - - - - Flag defined locally - Has a local definition - - - Flag defined locally: Has a local definition - - - - - - Flag defined globally - Has a global definition - - - Flag defined globally: Has a global definition - - - - - - - Field defined globally - Has a global definition - - - Field defined globally: Has a global definition - - - - - - - - - Assembly defined globally - Has a global definition - - - Assembly defined globally: Has a global definition - - - - - - - Field defined locally - Has a local definition - - - Field defined locally: Has a local definition - - - - - - - - - - diff --git a/test-suite/schema-generation/scratchdir/metaschema-collect.xsl b/test-suite/schema-generation/scratchdir/metaschema-collect.xsl deleted file mode 100644 index 2817e49c8..000000000 --- a/test-suite/schema-generation/scratchdir/metaschema-collect.xsl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Warning: circular import of { $uri } skipped - - - Error: No metaschema module is found at { $uri } - Warning: circular import of { $uri } skipped - - - - - - - - - - \ No newline at end of file diff --git a/test-suite/schema-generation/scratchdir/metaschema-compose.xsl b/test-suite/schema-generation/scratchdir/metaschema-compose.xsl deleted file mode 100644 index e76e6dbf4..000000000 --- a/test-suite/schema-generation/scratchdir/metaschema-compose.xsl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - metaschema-collect.xsl - metaschema-reduce1.xsl - metaschema-reduce2.xsl - metaschema-digest.xsl - - - \ No newline at end of file diff --git a/test-suite/schema-generation/scratchdir/metaschema-digest.xsl b/test-suite/schema-generation/scratchdir/metaschema-digest.xsl deleted file mode 100644 index b6f28c122..000000000 --- a/test-suite/schema-generation/scratchdir/metaschema-digest.xsl +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - no - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test-suite/schema-generation/scratchdir/metaschema-metaprocess.xsl b/test-suite/schema-generation/scratchdir/metaschema-metaprocess.xsl deleted file mode 100644 index 9e94b8292..000000000 --- a/test-suite/schema-generation/scratchdir/metaschema-metaprocess.xsl +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - off - - - - - - - - - - - - - - - COMPOSING METASCHEMA { document-uri($source) } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ... applied step { count(.|preceding-sibling::*) }: XSLT { $xslt-spec } ... - - - - - - - - ... applied step { count(.|preceding-sibling::*) }: { name() } ... - - - - - - - - - - - - - \ No newline at end of file diff --git a/test-suite/schema-generation/scratchdir/metaschema-reduce1.xsl b/test-suite/schema-generation/scratchdir/metaschema-reduce1.xsl deleted file mode 100644 index 009414f8e..000000000 --- a/test-suite/schema-generation/scratchdir/metaschema-reduce1.xsl +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - no - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEPING definition for '{ @name }' field from { ancestor::METASCHEMA[1]/@module }: last given - - - - - - - KEEPING definition for '{ @name }' flag from { ancestor::METASCHEMA[1]/@module }: last given - - - - - - - KEEPING definition for '{ @name }' assembly from { ancestor::METASCHEMA[1]/@module }: last given - - - - - - - REMOVING superseded definition for '{ @name }' { - replace(local-name(),'^define-','')} from { ancestor::METASCHEMA[1]/@module - } - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test-suite/schema-generation/scratchdir/metaschema-reduce2.xsl b/test-suite/schema-generation/scratchdir/metaschema-reduce2.xsl deleted file mode 100644 index a45290106..000000000 --- a/test-suite/schema-generation/scratchdir/metaschema-reduce2.xsl +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - no - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Assembly references: { $assembly-references } - - Field references: { $field-references } - - Flag references: { $flag-references } - - - - - - - - - - REMOVING unused assembly definition for '{ @name }' from { ancestor::METASCHEMA[1]/@module - } - - - - - - REMOVING unused field definition for '{ @name }' from { ancestor::METASCHEMA[1]/@module - } - - - - - - REMOVING unused flag definition for '{ @name }' from { ancestor::METASCHEMA[1]/@module - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test-suite/schema-generation/scratchdir/metaschema-schematron-compiled.xsl b/test-suite/schema-generation/scratchdir/metaschema-schematron-compiled.xsl deleted file mode 100644 index c7866a578..000000000 --- a/test-suite/schema-generation/scratchdir/metaschema-schematron-compiled.xsl +++ /dev/null @@ -1,929 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - { $really-who/@ref }:{ local-name($really-who) => upper-case() } - - - - - - { $really-who/@name }:{ substring-after(local-name($really-who),'define-') => upper-case() } - - - - - - - - - ' - - - - - - - - - - - - - - - / - - - - - - *: - - [namespace-uri()=' - - '] - - - - [ - - ] - - - - / - - @ - - - @*[local-name()=' - - ' and namespace-uri()=' - - '] - - - - - - - - / - - - [ - - ] - - - - /@ - - - - - - - / - - - [ - - ] - - - - /@ - - - - - - - - - - - - - - - - - - - - - - - . - - - - U - - U - - - - U. - - n - - - - U. - - _ - - _ - - - - - - - - -   -   -   - - - - - - - - - top-level-and-schema-docs - top-level-and-schema-docs - - - - - - - - definitions-and-name-clashes - definitions-and-name-clashes - - - - - - - - flags_and_keys_and_datatypes - flags_and_keys_and_datatypes - - - - - - - - schema-docs - schema-docs - - - - - - - - - - - - - - - - - - - - warning - - - - Metaschema schema version must be set for any top-level metaschema - - - - - - - - - - - - Unless marked as @abstract='yes', a metaschema should have at least one assembly with a root-name. - - - - - - - - - - - - - - - - - warning - - - - Schema can't import itself - - - - - - - - - - - Can't find a metaschema at - - - - - - - - - - - - - - - - - - Assembly should not be defined as a root when /METASCHEMA/@abstract='yes' - - - - - - - - - - - - - - - - - - - - Definition for ' - - ' clashes in this metaschema: not a good idea. - - - - - - - - warning - - - - Orphan - - ' - - ' is never used in the composed metaschema - - - - - - - - - - - - - - - is assigned a json key, but no 'json-key' is given - - - - - - - - - - Names "STRVALUE", "RICHTEXT" or "PROSE" are reserved. - - - - - - - - - - - - - - - - Unless @max-occurs is 1, a group name must be given with a local assembly definition. - - - - - - - - - - - - - - - - "group-as" should not be given when max-occurs is 1. - - - - - - - - - - - - Cannot group by key since the definition of - - ' - - ' has no json-key specified. Consider adding a json-key to the ' - - ' definition, or using a different 'in-json' setting. - - - - - - - - - - - - When @in-xml='GROUPED', @in-json must be 'ARRAY'. - - - - - - - - - - - - - - - - - - - - - - - Target definition for - - designates a json key, so the invocation should have group-as/@in-json='BY_KEY' - - - - - - - - - - - - Unless @max-occurs is 1, a grouping name (group-as/@name) must be given - - - - - - - - - - - - Only one field may be marked as 'markup-multiline' (without xml wrapping) within a model. - - - - - - - - - - An 'unwrapped' field must have a max occurrence of 1 - - - - - - - - - - - Only 'markup-multiline' fields may be unwrapped in XML. - - - - - - - - - - - - - - - - - A flag declared as a value key must be required (@required='yes') - - - - - - - - - - - - A flag declared as a key must be required (@required='yes') - - - - - - - - - - - - Multiline markup fields must have no flags, unless always used with a wrapper - put your flags on an assembly with an unwrapped multiline field - - - - - - - - - - - - - - - - - - - JSON key indicates no flag on this - - - Should be (one of) - - - - - - - - - - - - - - - - - - - - - - as flag/ - - will be inoperative as the value will be given the field key -- no other flags are given - - - - - - - - - - - JSON value key may be set to a value or a flag's value, but not both. - - - - - - - - - - - flag ' - - ' not found for JSON value key - - - - - - - - - - - - - - - - - Allowed value ' - - ' may only be specified once for flag ' - - '. - - - - - - - - - - - - Value ' - - ' is not a valid token of type - - - - - - - - - - - - - - - - - - - - Only one index or uniqueness assertion may be named ' - - ' - - - - - - - - - - - - - - - - - No ' - - ' index is defined. - - - - - - - - - - - - - - - Index key field target ' - - ' is already declared. - - - - - - - - - - - - - - - - - - warning - - - - Formal name missing from - - - - - - - - - - - - warning - - - - Short description missing from - - - - - - - - - - - - warning - - - - model missing from - - - - - - - - - - - - - - - - - - - - Empty (is likely to distort rendition) - - - - - - - warning - - - - Not much here is there - - - - - - - - - - - - - - - - - - - - diff --git a/test-suite/schema-generation/scratchdir/metaschema-validation-support.xsl b/test-suite/schema-generation/scratchdir/metaschema-validation-support.xsl deleted file mode 100644 index 39a165364..000000000 --- a/test-suite/schema-generation/scratchdir/metaschema-validation-support.xsl +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - metaschema-collect.xsl - metaschema-reduce1.xsl - metaschema-reduce2.xsl - metaschema-digest.xsl - - - - - - - - - - - - - - Cannot compose a document as a METASCHEMA. The document element is "{ $doc/*[1]/name() }" in namespace "{ $doc/*[1]/namespace-uri() }" - - - - - - - - - - \ No newline at end of file diff --git a/test-suite/schema-generation/scratchdir/oscal-datatypes-check.xsl b/test-suite/schema-generation/scratchdir/oscal-datatypes-check.xsl deleted file mode 100644 index 609137610..000000000 --- a/test-suite/schema-generation/scratchdir/oscal-datatypes-check.xsl +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - string - string - NCName - { $nominal-type } - - - - {$value} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test-suite/schema-generation/scratchdir/working/group-as-singleton-or-array-optional-local.svrl b/test-suite/schema-generation/scratchdir/working/group-as-singleton-or-array-optional-local.svrl deleted file mode 100644 index 50ca0d094..000000000 --- a/test-suite/schema-generation/scratchdir/working/group-as-singleton-or-array-optional-local.svrl +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/test-suite/schema-generation/scratchdir/working/group-as-singleton-or-array-optional-local_generated-json-schema.json b/test-suite/schema-generation/scratchdir/working/group-as-singleton-or-array-optional-local_generated-json-schema.json deleted file mode 100644 index be93a4485..000000000 --- a/test-suite/schema-generation/scratchdir/working/group-as-singleton-or-array-optional-local_generated-json-schema.json +++ /dev/null @@ -1,26 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/group-as-singleton-or-array-optional-schema.json", - "$comment" : "Metaschema Unit Test: group-as: JSON Schema", - "type" : "object", - "definitions" : - { "parent" : - { "title" : "parent", - "description" : "parent assembly", - "$id" : "#/definitions/parent", - "type" : "object", - "properties" : - { "prop" : - { "prop" : - { "title" : "prop", - "description" : "prop field", - "$id" : "#/definitions/prop", - "type" : "string" } } }, - "additionalProperties" : false } }, - "properties" : - { "parent" : - { "$ref" : "#/definitions/parent" } }, - "required" : - [ "parent" ], - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/schema-generation/scratchdir/working/group-as-singleton-or-array-optional-local_generated-xml-schema.xsd b/test-suite/schema-generation/scratchdir/working/group-as-singleton-or-array-optional-local_generated-xml-schema.xsd deleted file mode 100644 index 9300254fb..000000000 --- a/test-suite/schema-generation/scratchdir/working/group-as-singleton-or-array-optional-local_generated-xml-schema.xsd +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Metaschema Unit Test: group-as - 1.0-milestone1 - metaschema-group-as - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - prop - prop field - - - prop: prop field - - - - - - - - - diff --git a/test-suite/schema-generation/testing.md b/test-suite/schema-generation/testing.md index 08e3e01b6..7911daf67 100644 --- a/test-suite/schema-generation/testing.md +++ b/test-suite/schema-generation/testing.md @@ -1,8 +1,23 @@ + # Running the unit tests -So far we have unit testing in place for JSON schema generation and for validating correctness of generated schemas by validating instances known to be good or bad. +Each subdirectory contains unit tests for a family of functionalities in Metaschema. They can overlap. + +Within each subdirectory: + +- One or more metaschemas exercise features of Metaschema +- One or more pass/fail test instances show examples of instance documents that either conform to constraints defined by their metaschema (PASS), or violate them (FAIL). +- `target` contains nominal schema results of schema generation, as XSD or JSON Schema. These are *non-normative* and tooling should ordinarily ignore them - they are kept temporarily for alignment purposes (external process validation) +- `actual` is excluded from Git via `.gitignore` so that tools can write schemas into folders named `actual` for testing. -We will be extending this to cover XSD generation, generation of XML and JSON conversion tooling, and the correctness of those conversions. +For testing: +- Generate schemas. +- Validate PASS/FAIL samples against schemas. + +Optionally: +- Compare generated schemas with targets kept in `target` + +## Test metaschema - naming Metaschemas should follow this naming convention. Note the use of underscores as delimiters between parts of this name. @@ -12,10 +27,9 @@ where - `$KEYWORD` is a keyword indicating a particular teste - `$EXPECT` is `PASS` or `FAIL` depending on whether a test instance is known to be valid (it should PASS) or invalid (it should FAIL) - `$TESTSET-$SCOPE_metaschema.xml` is recognized as a Metaschema -`$TESTSET-$SCOPE_test_$KEYWORD_$EXPECT.json is` recognized as a JSON instance to be tested against the Schema produced for the `$TESTSET-$SCOPE` metaschema. +`$TESTSET-$SCOPE_test_$KEYWORD_$EXPECT.json` is recognized as a JSON instance to be tested against the Schema produced for the `$TESTSET-$SCOPE` metaschema. Note that different keywords can be used to distinguish tests expected to be valid or invalid to the metaschema indicated by `$TESTSET-$SCOPE`. diff --git a/test-suite/schema-generation/token/datatypes-token_metaschema_XML-SCHEMA.xsd b/test-suite/schema-generation/token/datatypes-token_metaschema_XML-SCHEMA.xsd deleted file mode 100644 index 5a555deb9..000000000 --- a/test-suite/schema-generation/token/datatypes-token_metaschema_XML-SCHEMA.xsd +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Metaschema Unit Test: Token Datatype - 1.0-milestone2 - metaschema-datatypes-token - parent - - - - - - - parent - parent assembly - - - parent: parent assembly - - - - - - - - A metaschema 'token', a string without spaces suitable for use as a key value) - Corresponds to XML NCName (no-colon name). - - - A metaschema 'token', a string without spaces suitable for use as a key value): Corresponds to XML NCName (no-colon name). - - - - - - - A metaschema 'token', a string without spaces for use as a key value - Corresponds to XML NCName (no-colon name). - - - A metaschema 'token', a string without spaces for use as a key value: Corresponds to XML NCName (no-colon name). - - - - - - A string token following the rules of XML "no colon" names, with no whitespace. (XML names are single alphabetic characters - followed by alphanumeric characters, periods, underscores or dashes.) - - - - - - A single token may not contain whitespace. - - - - - diff --git a/test-suite/schema-generation/token/readme.md b/test-suite/schema-generation/token/readme.md new file mode 100644 index 000000000..e1b13327f --- /dev/null +++ b/test-suite/schema-generation/token/readme.md @@ -0,0 +1,7 @@ +# Token (datatype) + +**Status** - untested, unknown - + +These tests are known to have run in the past but current status is not confirmed. + +See also token datatypes in the `datatypes` folder (and consolidate). diff --git a/test-suite/schema-generation/token/datatypes-token_metaschema_JSON-SCHEMA.json b/test-suite/schema-generation/token/target/datatypes-token_metaschema-jsonschema.json similarity index 67% rename from test-suite/schema-generation/token/datatypes-token_metaschema_JSON-SCHEMA.json rename to test-suite/schema-generation/token/target/datatypes-token_metaschema-jsonschema.json index 37aefbf44..bc74301a7 100644 --- a/test-suite/schema-generation/token/datatypes-token_metaschema_JSON-SCHEMA.json +++ b/test-suite/schema-generation/token/target/datatypes-token_metaschema-jsonschema.json @@ -14,7 +14,7 @@ { "title" : "A metaschema 'token', a string without spaces suitable for use as a key value)", "description" : "Corresponds to XML NCName (no-colon name).", "type" : "string", - "pattern" : "^[_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" }, + "pattern" : "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" }, "token-fields" : { "anyOf" : [ @@ -32,7 +32,7 @@ "description" : "Corresponds to XML NCName (no-colon name).", "$id" : "#field_metaschema-datatypes-token_token-field", "type" : "string", - "pattern" : "^[_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" } }, + "pattern" : "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" } }, "properties" : { "parent" : { "$ref" : "#assembly_metaschema-datatypes-token_parent" } }, diff --git a/test-suite/schema-generation/token/target/datatypes-token_metaschema-xmlschema.xsd b/test-suite/schema-generation/token/target/datatypes-token_metaschema-xmlschema.xsd new file mode 100644 index 000000000..d3f440487 --- /dev/null +++ b/test-suite/schema-generation/token/target/datatypes-token_metaschema-xmlschema.xsd @@ -0,0 +1,217 @@ + + + + + Metaschema Unit Test: Token Datatype + 1.0-milestone2 + metaschema-datatypes-token + parent + + + + + + + parent + parent assembly + + + parent: parent assembly + + + + + + + + A metaschema 'token', a string without spaces suitable for use as a key value) + Corresponds to XML NCName (no-colon name). + + + A metaschema 'token', a string without spaces suitable for use as a key value): Corresponds to XML NCName (no-colon name). + + + + + + + A metaschema 'token', a string without spaces for use as a key value + Corresponds to XML NCName (no-colon name). + + + A metaschema 'token', a string without spaces for use as a key value: Corresponds to XML NCName (no-colon name). + + + + + + A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + + + A string token following the rules of XML "no colon" names, with no whitespace. (XML names are single alphabetic characters + followed by alphanumeric characters, periods, underscores or dashes.) + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + A host name + + + + + + The ip-v4-address type specifies an IPv4 address in + dot decimal notation. + + + + + + + + The ip-v6-address type specifies an IPv6 address + represented in 8 hextets separated by colons. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + diff --git a/test-suite/schema-generation/unit-tests.xml b/test-suite/schema-generation/unit-tests.xml new file mode 100644 index 000000000..6d8afe318 --- /dev/null +++ b/test-suite/schema-generation/unit-tests.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-suite/schema-generation/uuid/datatype-uuid-test-FAIL.xml b/test-suite/schema-generation/uuid/datatype-uuid-test-FAIL.xml deleted file mode 100644 index 12b7feda6..000000000 --- a/test-suite/schema-generation/uuid/datatype-uuid-test-FAIL.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - 7b5d9713-4488-4d71-8e77-85b0b185d71a - xyz - \ No newline at end of file diff --git a/test-suite/schema-generation/uuid/datatypes-uuid_json-schema.json b/test-suite/schema-generation/uuid/datatypes-uuid_json-schema.json deleted file mode 100644 index 27621378a..000000000 --- a/test-suite/schema-generation/uuid/datatypes-uuid_json-schema.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri-schema.json", - "$comment": "Metaschema Unit Test: UUID Datatype: JSON Schema", - "type": "object", - "definitions": { - "parent": { - "title": "parent", - "description": "parent assembly", - "$id": "#/definitions/parent", - "type": "object", - "properties": { - "uuid-flag": { - "title": "Universally Unique Identifier Flag", - "description": "A version 4 UUID per RFC 4122.", - "type": "string", - "pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" - }, - "uuid-fields": { - "anyOf": [ - {"$ref": "#/definitions/uuid-field"}, - { - "type": "array", - "items": {"$ref": "#/definitions/uuid-field"}, - "minItems": 1 - } - ] - } - }, - "required": ["uuid-flag"], - "additionalProperties": false - }, - "uuid-field": { - "title": "Universally Unique Identifier Field", - "description": "A version 4 UUID per RFC 4122.", - "$id": "#/definitions/uuid-field", - "type": "string", - "pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" - } - }, - "properties": { - "parent": {"$ref": "#/definitions/parent"} - }, - "required": ["parent"], - "additionalProperties" : false, - "maxProperties" : 1 -} \ No newline at end of file diff --git a/test-suite/schema-generation/uuid/datatypes-uuid_metaschema.xml b/test-suite/schema-generation/uuid/datatypes-uuid_metaschema.xml deleted file mode 100644 index 443a7b17b..000000000 --- a/test-suite/schema-generation/uuid/datatypes-uuid_metaschema.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - Metaschema Unit Test: UUID Datatype - 1.0-milestone2 - metaschema-datatypes-uuid - http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri - - - parent - parent assembly - parent - - Universally Unique Identifier Flag - A version 4 UUID per RFC 4122. - - - - - - - - - - Universally Unique Identifier Field - A version 4 UUID per RFC 4122. - - - diff --git a/test-suite/schema-generation/uuid/datatypes-uuid_test_valid_PASS.json b/test-suite/schema-generation/uuid/datatypes-uuid_test_valid_PASS.json deleted file mode 100644 index 7426f312b..000000000 --- a/test-suite/schema-generation/uuid/datatypes-uuid_test_valid_PASS.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": { - "uuid-flag": "6b034d60-d2d3-4b64-b0f2-e230efca09d3", - "uuid-fields": [ - "f70e7c83-f063-4928-992b-14617b58cb69", - "4b1344c3-88e2-4435-939a-feb000e554f4", - "398f9ba5-b95d-4fa2-9e33-a12b85d1e182", - "01d5b087-56f9-4379-ba06-a65042edbb6a" - ] - } -} \ No newline at end of file diff --git a/test-suite/schema-generation/uuid/datatypes-uuid_test_version-1-invalid_FAIL.json b/test-suite/schema-generation/uuid/datatypes-uuid_test_version-1-invalid_FAIL.json deleted file mode 100644 index c4460df94..000000000 --- a/test-suite/schema-generation/uuid/datatypes-uuid_test_version-1-invalid_FAIL.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "parent": { - "uuid-flag": "157f7b90-a113-11ea-bb37-0242ac130002" - } -} \ No newline at end of file diff --git a/test-suite/unit-tests.xsd b/test-suite/unit-tests.xsd new file mode 100644 index 000000000..cd63425f3 --- /dev/null +++ b/test-suite/unit-tests.xsd @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Generation succeeded. + + + + + Generation resulted in failure caused by some error. + + + + + + + + + + Content is XML. + + + + + Content is JSON. + + + + + Content is YAML. + + + + + + + + + + The actual content matched the expectect content. + + + + + The actual content did not match the expectect content. + + + + + + + + + + Validation succeeded. + + + + + Validation resulted in failure caused by some content defect or error. + + + + + diff --git a/test-suite/worked-examples/anthology/anthology_metaschema.xml b/test-suite/worked-examples/anthology/anthology_metaschema.xml index dc43a7753..bc300840e 100644 --- a/test-suite/worked-examples/anthology/anthology_metaschema.xml +++ b/test-suite/worked-examples/anthology/anthology_metaschema.xml @@ -1,82 +1,32 @@ - + Anthology Metaschema 1.0 - ανθ + anthology http://csrc.nist.gov/metaschema/ns/anthology http://csrc.nist.gov/metaschema/anthology -

A mini metaschema produced for testing purposes. Use at your own risk.

+

A mini metaschema produced for testing purposes. Use at your own risk.

- - - Anthology - A collection of literary excerpts + A collection of literary excerpts ANTHOLOGY + + fans + How many fans? + + + UUID + Identifying this anthology + @@ -110,28 +60,30 @@ Under 'widget' + Key word A string - - - - - + + + Four-digit year (CE) - - - + + + Title + As represented + + Date As represented @@ -174,11 +126,34 @@ Under 'widget' - + + +
+ + Translation + A single translation of the text given in the piece. + + + Language + An ISO code in lower case, e.g. 'en', 'de', 'jp' + + + + + + + + + + + In a translation, a child must be of the same type of the main contents of the piece. + + + Verse A composition in lines, or an excerpt from such a composition @@ -187,7 +162,6 @@ Under 'widget' - @@ -195,9 +169,7 @@ Under 'widget' - - - + @@ -244,6 +216,8 @@ Under 'widget' Stanza A group of lines within a verse + + @@ -256,18 +230,6 @@ Under 'widget' Short prose or an excerpt
- - Include other - Some other sort of markup altogether - - Language - Describing the notation used - - - - - - Back matter Indexes and appurtenances @@ -297,7 +259,7 @@ Under 'widget' Author A single author cited in the anthology, with relevant info - + @@ -367,23 +329,24 @@ Under 'widget' Dates As a range (birth-death) or floruit - + Birth date If only the year is known use June 30. - + Death date If only the year is known use July 1. - + Floruit date Do not use along with both birth and death - - + + + diff --git a/test-suite/worked-examples/anthology/anthology_metaschema_JSON-SCHEMA.json b/test-suite/worked-examples/anthology/anthology_metaschema_JSON-SCHEMA.json deleted file mode 100644 index 5f4725804..000000000 --- a/test-suite/worked-examples/anthology/anthology_metaschema_JSON-SCHEMA.json +++ /dev/null @@ -1,472 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/metaschema/ns/anthology-schema.json", - "$comment" : "Anthology Metaschema: JSON Schema", - "type" : "object", - "definitions" : - { "anthology" : - { "title" : "Anthology", - "description" : "A collection of literary excerpts", - "$id" : "#/definitions/anthology", - "type" : "object", - "properties" : - { "id" : - { "title" : "Identifier", - "description" : "A distinct code", - "type" : "string" }, - "meta" : - { "$ref" : "#/definitions/meta" }, - "pieces" : - { "anyOf" : - [ - { "$ref" : "#/definitions/piece" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/piece" } } ] }, - "back" : - { "$ref" : "#/definitions/back" } }, - "required" : - [ "meta" ], - "additionalProperties" : false }, - "meta" : - { "title" : "Front matter / metadata", - "description" : "Metadata for the anthology as a ^whole, or for a single piece within it", - "$id" : "#/definitions/meta", - "type" : "object", - "properties" : - { "creators" : - { "anyOf" : - [ - { "$ref" : "#/definitions/creator" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/creator" } } ] }, - "date" : - { "$ref" : "#/definitions/date" }, - "keywords" : - { "anyOf" : - [ - { "title" : "Key word", - "description" : "A string", - "$id" : "#/definitions/meta-keyword", - "type" : "string" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "title" : "Key word", - "description" : "A string", - "$id" : "#/definitions/meta-keyword", - "type" : "string" } } ] }, - "remarks" : - { "$ref" : "#/definitions/remarks" } }, - "additionalProperties" : false }, - "date" : - { "title" : "Date", - "description" : "As represented", - "$id" : "#/definitions/date", - "type" : "object", - "properties" : - { "type" : - { "title" : "Type of date representation", - "description" : "May be given as a formatting code, e.g. 'YYYY' for year only. It is up to implementations to implement logic.", - "type" : "string" }, - "STRVALUE" : - { "type" : "string" } }, - "required" : - [ "STRVALUE" ], - "additionalProperties" : false }, - "creator" : - { "title" : "Creator (author or editor)", - "description" : "The text contents should name the person; the optional who flag links it to the index.", - "$id" : "#/definitions/creator", - "type" : "object", - "properties" : - { "role" : - { "title" : "Role", - "description" : "Contribution of the creator", - "type" : "string", - "enum" : - [ "author", - "editor", - "translator" ] }, - "who" : - { "title" : "Person identifier", - "description" : "Relates a person to the biographical index", - "type" : "string" }, - "STRVALUE" : - { "type" : "string" } }, - "required" : - [ "STRVALUE", - "role" ], - "additionalProperties" : false }, - "remarks" : - { "title" : "Remarks", - "description" : "Pertinent information of any kind.", - "$id" : "#/definitions/remarks", - "type" : "string" }, - "piece" : - { "title" : "Piece", - "description" : "A single anthologized piece; poetry or prose, entire or excerpted", - "$id" : "#/definitions/piece", - "type" : "object", - "properties" : - { "meta" : - { "$ref" : "#/definitions/meta" }, - "verse" : - { "$ref" : "#/definitions/verse" }, - "prose" : - { "$ref" : "#/definitions/prose" }, - "include" : - { "$ref" : "#/definitions/include" } }, - "additionalProperties" : false }, - "verse" : - { "title" : "Verse", - "description" : "A composition in lines, or an excerpt from such a composition", - "$id" : "#/definitions/verse", - "type" : "object", - "properties" : - { "type" : - { "title" : "Verse type", - "description" : "Any specialized form such as Byronic, terza rima, sestina, sonnet", - "type" : "string" }, - "lines" : - { "anyOf" : - [ - { "$ref" : "#/definitions/line" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/line" } } ] }, - "stanzas" : - { "anyOf" : - [ - { "$ref" : "#/definitions/stanza" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/stanza" } } ] } }, - "additionalProperties" : false }, - "line" : - { "title" : "Line of verse", - "description" : "May be metrical", - "$id" : "#/definitions/line", - "type" : "object", - "properties" : - { "feet" : - { "title" : "Meter count(feet)", - "description" : "Count of metrical feet (dimeter, trimeter, tetrameter etc) represented as a natural number", - "type" : "integer" }, - "base" : - { "title" : "Base meter", - "description" : "Identifies the base metrical type, if any", - "type" : "string", - "enum" : - [ "dactyl", - "anapest", - "trochee", - "iamb", - "mixed" ] }, - "RICHTEXT" : - { "type" : "string" } }, - "required" : - [ "RICHTEXT" ], - "additionalProperties" : false }, - "stanza" : - { "title" : "Stanza", - "description" : "A group of lines within a verse", - "$id" : "#/definitions/stanza", - "type" : "object", - "properties" : - { "type" : - { "title" : "Verse type", - "description" : "Any specialized form such as Byronic, terza rima, sestina, sonnet", - "type" : "string" }, - "lines" : - { "anyOf" : - [ - { "$ref" : "#/definitions/line" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/line" } } ] } }, - "additionalProperties" : false }, - "prose" : - { "title" : "Prose", - "description" : "Short prose or an excerpt", - "$id" : "#/definitions/prose", - "type" : "string" }, - "include" : - { "title" : "Include other", - "description" : "Some other sort of markup altogether", - "$id" : "#/definitions/include", - "type" : "object", - "properties" : - { "lang" : - { "type" : "string" } }, - "additionalProperties" : true }, - "back" : - { "title" : "Back matter", - "description" : "Indexes and appurtenances", - "$id" : "#/definitions/back", - "type" : "object", - "properties" : - { "author-index" : - { "$ref" : "#/definitions/author-index" } }, - "additionalProperties" : false }, - "author-index" : - { "title" : "Author index", - "description" : "Information about authors cited in the anthology", - "$id" : "#/definitions/author-index", - "type" : "object", - "properties" : - { "authors" : - { "type" : "object", - "minProperties" : 1, - "additionalProperties" : - { "allOf" : - [ - { "$ref" : "#/definitions/author" }, - - { "not" : - { "type" : "string" } } ] } } }, - "additionalProperties" : false }, - "author" : - { "title" : "Author", - "description" : "A single author cited in the anthology, with relevant info", - "$id" : "#/definitions/author", - "type" : "object", - "properties" : - { "name" : - { "$ref" : "#/definitions/name" }, - "dates" : - { "$ref" : "#/definitions/dates" }, - "publications" : - { "anyOf" : - [ - { "$ref" : "#/definitions/publication" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/publication" } } ] }, - "bio" : - { "$ref" : "#/definitions/bio" } }, - "additionalProperties" : true }, - "name" : - { "title" : "Name", - "description" : "A personal or place name", - "$id" : "#/definitions/name", - "type" : "string" }, - "bio" : - { "title" : "Biographical info", - "description" : "Gives basic facts or colorful detail.", - "$id" : "#/definitions/bio", - "type" : "object", - "properties" : - { "also-known-as" : - { "anyOf" : - [ - { "$ref" : "#/definitions/name" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/name" } } ] }, - "fact-statements" : - { "anyOf" : - [ - { "title" : "Facts", - "description" : "Structured data", - "$id" : "#/definitions/bio-facts", - "type" : "object", - "properties" : - { "dates" : - { "$ref" : "#/definitions/dates" }, - "residences" : - { "anyOf" : - [ - { "title" : "Residency", - "description" : "A range of values in time-space", - "$id" : "#/definitions/bio-facts-residence", - "type" : "object", - "properties" : - { "dates" : - { "title" : "Dates", - "description" : "Start to end", - "$id" : "#/definitions/bio-facts-residence-dates", - "type" : "object", - "properties" : - { "start" : - { "title" : "Start", - "description" : "When initiated", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "end" : - { "title" : "End", - "description" : "When concluded or abandoned", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, - "additionalProperties" : false } }, - "additionalProperties" : false }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "title" : "Residency", - "description" : "A range of values in time-space", - "$id" : "#/definitions/bio-facts-residence", - "type" : "object", - "properties" : - { "dates" : - { "title" : "Dates", - "description" : "Start to end", - "$id" : "#/definitions/bio-facts-residence-dates", - "type" : "object", - "properties" : - { "start" : - { "title" : "Start", - "description" : "When initiated", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "end" : - { "title" : "End", - "description" : "When concluded or abandoned", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, - "additionalProperties" : false } }, - "additionalProperties" : false } } ] } }, - "additionalProperties" : false }, - - { "type" : "array", - "maxItems" : 3, - "minItems" : 1, - "items" : - { "title" : "Facts", - "description" : "Structured data", - "$id" : "#/definitions/bio-facts", - "type" : "object", - "properties" : - { "dates" : - { "$ref" : "#/definitions/dates" }, - "residences" : - { "anyOf" : - [ - { "title" : "Residency", - "description" : "A range of values in time-space", - "$id" : "#/definitions/bio-facts-residence", - "type" : "object", - "properties" : - { "dates" : - { "title" : "Dates", - "description" : "Start to end", - "$id" : "#/definitions/bio-facts-residence-dates", - "type" : "object", - "properties" : - { "start" : - { "title" : "Start", - "description" : "When initiated", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "end" : - { "title" : "End", - "description" : "When concluded or abandoned", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, - "additionalProperties" : false } }, - "additionalProperties" : false }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "title" : "Residency", - "description" : "A range of values in time-space", - "$id" : "#/definitions/bio-facts-residence", - "type" : "object", - "properties" : - { "dates" : - { "title" : "Dates", - "description" : "Start to end", - "$id" : "#/definitions/bio-facts-residence-dates", - "type" : "object", - "properties" : - { "start" : - { "title" : "Start", - "description" : "When initiated", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "end" : - { "title" : "End", - "description" : "When concluded or abandoned", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, - "additionalProperties" : false } }, - "additionalProperties" : false } } ] } }, - "additionalProperties" : false } } ] }, - "colorful-details" : - { "title" : "Colorful details", - "description" : "Unstructured data", - "$id" : "#/definitions/bio-colorful-details", - "type" : "object", - "properties" : - { "dates" : - { "title" : "Dates", - "description" : "This time, a string, so \"Lincoln's Birthday\" is a date.", - "$id" : "#/definitions/bio-colorful-details-dates", - "type" : "string" }, - "remarks" : - { "$ref" : "#/definitions/remarks" } }, - "additionalProperties" : false } }, - "additionalProperties" : false }, - "dates" : - { "title" : "Dates", - "description" : "As a range (birth-death) or floruit", - "$id" : "#/definitions/dates", - "type" : "object", - "properties" : - { "birth" : - { "title" : "Birth date", - "description" : "If only the year is known use June 30.", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "death" : - { "title" : "Death date", - "description" : "If only the year is known use July 1.", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "floruit" : - { "title" : "Floruit date", - "description" : "Do not use along with both birth and death", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, - "additionalProperties" : false }, - "publication" : - { "title" : "Publication", - "description" : "A publication attributed to an author", - "$id" : "#/definitions/publication", - "type" : "object", - "properties" : - { "date" : - { "title" : "Publication date", - "description" : "Date of (first) publication", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "STRVALUE" : - { "type" : "string" } }, - "required" : - [ "STRVALUE" ], - "additionalProperties" : false } }, - "properties" : - { "ANTHOLOGY" : - { "$ref" : "#/definitions/anthology" } }, - "required" : - [ "ANTHOLOGY" ], - "additionalProperties" : false, - "maxProperties" : 1 } \ No newline at end of file diff --git a/test-suite/worked-examples/anthology/anthology_metaschema_XML-SCHEMA.xsd b/test-suite/worked-examples/anthology/anthology_metaschema_XML-SCHEMA.xsd deleted file mode 100644 index 01eeaeeee..000000000 --- a/test-suite/worked-examples/anthology/anthology_metaschema_XML-SCHEMA.xsd +++ /dev/null @@ -1,698 +0,0 @@ - - - - - Anthology Metaschema - 1.0 - ανθ - -

A mini metaschema produced for testing purposes. Use at your own risk.

-
- ANTHOLOGY -
-
- - - - - Anthology - A collection of literary excerpts - - - Anthology: A collection of literary excerpts - - - - - - - - - - Identifier - A distinct code - - - Identifier: A distinct code - - - - - - - Front matter / metadata - Metadata for the anthology as a ^whole, or for a single piece within it - - - Front matter / metadata: Metadata for the anthology as a ^whole, or for a single piece within it - - - - - - - - - Key word - A string - - - Key word: A string - - - - - - - - Remarks - Pertinent information of any kind. - - - Remarks: Pertinent information of any kind. - - - - - - - - - - - Date - As represented - - - Date: As represented - - - - - - - Type of date representation - May be given as a formatting code, e.g. 'YYYY' for year only. It is up to implementations to implement logic. - - - Type of date representation: May be given as a formatting code, e.g. 'YYYY' for year only. It is up to implementations to implement logic. - - - - - - - - - Creator (author or editor) - The text contents should name the person; the optional who flag links it to the index. - - - Creator (author or editor): The text contents should name the person; the optional who flag links it to the index. - - - - - - - Role - Contribution of the creator - - - Role: Contribution of the creator - - - - - - Person identifier - Relates a person to the biographical index - - - Person identifier: Relates a person to the biographical index - - - - - - - - - Piece - A single anthologized piece; poetry or prose, entire or excerpted - - - Piece: A single anthologized piece; poetry or prose, entire or excerpted - - - - - - - - - Prose - Short prose or an excerpt - - - Prose: Short prose or an excerpt - - - - - - - - - - - - - Verse - A composition in lines, or an excerpt from such a composition - - - Verse: A composition in lines, or an excerpt from such a composition - - - - - - - - - - - Verse type - Any specialized form such as Byronic, terza rima, sestina, sonnet - - - Verse type: Any specialized form such as Byronic, terza rima, sestina, sonnet - - - - - - - - - - Meter count(feet) - Count of metrical feet (dimeter, trimeter, tetrameter etc) represented as a natural number - - - Meter count(feet): Count of metrical feet (dimeter, trimeter, tetrameter etc) represented as a natural number - - - - - - Base meter - Identifies the base metrical type, if any - - - Base meter: Identifies the base metrical type, if any - - - - - - - - - Stanza - A group of lines within a verse - - - Stanza: A group of lines within a verse - - - - - - - - Verse type - Any specialized form such as Byronic, terza rima, sestina, sonnet - - - Verse type: Any specialized form such as Byronic, terza rima, sestina, sonnet - - - - - - - Include other - Some other sort of markup altogether - - - Include other: Some other sort of markup altogether - - - - - - - - - - Back matter - Indexes and appurtenances - - - Back matter: Indexes and appurtenances - - - - - - - - - Author index - Information about authors cited in the anthology - - - Author index: Information about authors cited in the anthology - - - - - - - - - Author - A single author cited in the anthology, with relevant info - - - Author: A single author cited in the anthology, with relevant info - - - - - - - - - - - - Identifier - A distinct code - - - Identifier: A distinct code - - - - - - - Name - A personal or place name - - - Name: A personal or place name - - - - - - - Biographical info - Gives basic facts or colorful detail. - - - Biographical info: Gives basic facts or colorful detail. - - - - - - - - Facts - Structured data - - - Facts: Structured data - - - - - - - - Residency - A range of values in time-space - - - Residency: A range of values in time-space - - - - - - - Dates - Start to end - - - Dates: Start to end - - - - - Start - When initiated - - - Start: When initiated - - - - - - End - When concluded or abandoned - - - End: When concluded or abandoned - - - - - - - - - - - - - - - Colorful details - Unstructured data - - - Colorful details: Unstructured data - - - - - - - Dates - This time, a string, so "Lincoln's Birthday" is a date. - - - Dates: This time, a string, so "Lincoln's Birthday" is a date. - - - - - - - - Remarks - Pertinent information of any kind. - - - Remarks: Pertinent information of any kind. - - - - - - - - - - - - - - Dates - As a range (birth-death) or floruit - - - Dates: As a range (birth-death) or floruit - - - - - Birth date - If only the year is known use June 30. - - - Birth date: If only the year is known use June 30. - - - - - - Death date - If only the year is known use July 1. - - - Death date: If only the year is known use July 1. - - - - - - Floruit date - Do not use along with both birth and death - - - Floruit date: Do not use along with both birth and death - - - - - - - Publication - A publication attributed to an author - - - Publication: A publication attributed to an author - - - - - - - Publication date - Date of (first) publication - - - Publication date: Date of (first) publication - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The content model is the same as blockElementType, but line endings need - to be preserved, since this is preformatted. - - - - - - - - - The content model is the same as blockElementType, but line endings need - to be preserved, since this is preformatted. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/test-suite/worked-examples/anthology/good-stuff-json.xml b/test-suite/worked-examples/anthology/good-stuff-json.xml deleted file mode 100644 index 1efdd1b51..000000000 --- a/test-suite/worked-examples/anthology/good-stuff-json.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - editor - Wendell Piez - - - poetry - verse - - -# Demo anthology - -Compiled for purposes of testing and demonstrating validations against constraints - defined by NIST Metaschema. - - - - - author - #w.h.auden - W.H. Auden - - - 1954 - - - - quatrain - - - 4 - trochee - Guard, Civility, with guns - - - 4 - iamb - Your modes and your declensions: - - - 4 - trochee - Any lout can spear with ease - - - 4 - trochee - Singular Archimedes. - - - - - - - - - Wystan Hugh Auden - - 1907-02-21 - 1973-09-29 - - - - - - 1907-02-21 - 1973-09-29 - - - - - - - - - - diff --git a/test-suite/worked-examples/anthology/good-stuff.xml b/test-suite/worked-examples/anthology/good-stuff.xml index cec6cb0b4..2b12a32ba 100644 --- a/test-suite/worked-examples/anthology/good-stuff.xml +++ b/test-suite/worked-examples/anthology/good-stuff.xml @@ -1,22 +1,67 @@ - - - + - Wendell Piez + Anne Editor poetry verse - +

Demo anthology

-

Compiled for purposes of testing and demonstrating validations against constraints - defined by NIST Metaschema.

+

Compiled for purposes of testing and demonstrating validations defined by NIST + Metaschema.

+ + + Archimedes + + +

δῶς μοι πᾶ στῶ καὶ τὰν γᾶν κινάσω

+ +
+ + +

Give me someplace to stand and I'll move the earth.

+
+
+ + +

Gib mir was Stehplatz und die Erde bewege ich.

+
+
+ + +

Donnez-moi un point d’appui et je soulèverai le monde.

+
+
+
+ + + + Tim Berners-Lee + + +

Computer Science in the 1960s to 80s spent a lot of effort making languages that were + as powerful as possible. Nowadays we have to appreciate the reasons for picking not + the most powerful solution but the least powerful. The reason for this is that the + less powerful the language, the more you can do with the data stored in that + language. If you write it in a simple declarative form, anyone can write a program + to analyze it in many ways. The Semantic Web is an attempt, largely, to map large + quantities of existing data onto a common language so that the data can be analyzed + in ways never dreamed of by its creators. If, for example, a web page with weather + data has RDF describing that data, a user can retrieve it as a table, perhaps + average it, plot it, deduce things from it in combination with other information. At + the other end of the scale is the weather information portrayed by the cunning Java + applet. While this might allow a very cool user interface, it cannot be analyzed at + all. The search engine finding the page will have no idea of what the data is or + what it is about. The only way to find out what a Java applet means is to set it + running in front of a person.

+
+
W.H. Auden @@ -24,30 +69,24 @@ Guard, Civility, with guns - Your modes and your declensions: + Your modes and your declensions: Any lout can spear with ease Singular Archimedes. - - - Header - - + + Archimedes + + + + Tim Berners-Lee + Wystan Hugh Auden - - - - - - -
\ No newline at end of file +
diff --git a/test-suite/worked-examples/anthology/preview/anthology_metaschema-json-map.html b/test-suite/worked-examples/anthology/preview/anthology_metaschema-json-map.html deleted file mode 100644 index bc1808fc6..000000000 --- a/test-suite/worked-examples/anthology/preview/anthology_metaschema-json-map.html +++ /dev/null @@ -1,671 +0,0 @@ - -
Anthology Metaschema1.0
- - anthology - [0 or 1]: { ... } - - -
-

- - id: NCName - [0 or 1] - , -

-
- - meta - [1]: { ... }, - - -
-
- - creators: [0 or 1] - [ ... ] - - -
-
-

- 'creator' objects - [0 to ∞]: { -

-
-

- - role: string - [1] - , -

-

- - who: string - [0 or 1] - , -

-

- - STRVALUE: string - [0 or 1] -

-
-

- } -

-
-
-

- ], -

-
-
- - date - [0 or 1]: { ... }, - - -
-

- - type: string - [0 or 1] - , -

-

- - STRVALUE: string - [0 or 1] -

-
-

- }, -

-
-
- - keywords: [0 or 1] - [ ... ] - - -
-

- - 'keyword' strings: string - [0 to ∞] -

-
-

- ], -

-
-

- - remarks: string - [0 or 1] -

-
-

- }, -

-
-
- - pieces: [0 or 1] - [ ... ] - - -
-
-

- 'piece' objects - [0 to ∞]: { -

-
-
- - meta - [0 or 1]: { ... }, - - -
-
- - creators: [0 or 1] - [ ... ] - - -
-
-

- 'creator' objects - [0 to ∞]: { -

-
-

- - role: string - [1] - , -

-

- - who: string - [0 or 1] - , -

-

- - STRVALUE: string - [0 or 1] -

-
-

- } -

-
-
-

- ], -

-
-
- - date - [0 or 1]: { ... }, - - -
-

- - type: string - [0 or 1] - , -

-

- - STRVALUE: string - [0 or 1] -

-
-

- }, -

-
-
- - keywords: [0 or 1] - [ ... ] - - -
-

- - 'keyword' strings: string - [0 to ∞] -

-
-

- ], -

-
-

- - remarks: string - [0 or 1] -

-
-

- }, -

-
-
-

- A choice:

-
-
- - verse - [0 or 1]: { ... }, - - -
-

- - type: string - [0 or 1] - , -

-
-

- A choice:

-
-
- - lines: [0 or 1] - [ ... ] - - -
-
-

- 'line' objects - [0 to ∞]: { -

-
-

- - feet: integer - [0 or 1] - , -

-

- - base: string - [0 or 1] - , -

-

- - RICHTEXT: markup-line - [0 or 1] -

-
-

- } -

-
-
-

- ], -

-
-
-
-
- - stanzas: [0 or 1] - [ ... ] - - -
-
-

- 'stanza' objects - [0 to ∞]: { -

-
-

- - type: string - [0 or 1] - , -

-
- - lines: [0 or 1] - [ ... ] - - -
-
-

- 'line' objects - [0 to ∞]: { -

-
-

- - feet: integer - [0 or 1] - , -

-

- - base: string - [0 or 1] - , -

-

- - RICHTEXT: markup-line - [0 or 1] -

-
-

- } -

-
-
-

- ] -

-
-
-

- } -

-
-
-

- ] -

-
-
-
-
-

- }, -

-
-
-
-

- - prose: string - [0 or 1] -

-
-
-
-

- } -

-
-
-

- ], -

-
-
- - back - [0 or 1]: { ... } - - -
-
- - author-index - [0 or 1]: { ... } - - -
-
- - authors - [0 or 1]: { ... } - - -
-
- - {{ id }} - [0 to ∞]: { ... } - - -
-

- - name: string - [0 or 1] - , -

-
- - dates - [0 or 1]: { ... }, - - -
-

- - birth: date - [0 or 1] - , -

-

- - death: date - [0 or 1] - , -

-

- - floruit: date - [0 or 1] - , -

-

- - range: empty - [0 or 1] -

-
-

- }, -

-
-
- - publications: [0 or 1] - [ ... ] - - -
-
-

- 'publication' objects - [0 to ∞]: { -

-
-

- - date: date - [0 or 1] - , -

-

- - STRVALUE: string - [0 or 1] -

-
-

- } -

-
-
-

- ], -

-
-
- - bio - [0 or 1]: { ... } - - -
-
- - also-known-as: [0 or 1] - [ ... ] - - -
-

- - 'name' strings: string - [0 to ∞] -

-
-

- ], -

-
-
- - fact-statements: [0 or 1] - [ ... ] - - -
-
-

- 'facts' objects - [0 to 3]: { -

-
-
- - dates - [0 or 1]: { ... }, - - -
-

- - birth: date - [0 or 1] - , -

-

- - death: date - [0 or 1] - , -

-

- - floruit: date - [0 or 1] - , -

-

- - range: empty - [0 or 1] -

-
-

- }, -

-
-
- - residences: [0 or 1] - [ ... ] - - -
-
-

- 'residence' objects - [0 to ∞]: { -

-
-
- - dates - [0 or 1]: { ... } - - -
-

- - start: date - [0 or 1] - , -

-

- - end: date - [0 or 1] - , -

-

- - STRVALUE: empty - [0 or 1] -

-
-

- } -

-
-
-

- } -

-
-
-

- ] -

-
-
-

- } -

-
-
-

- ], -

-
-
- - colorful-details - [0 or 1]: { ... } - - -
-

- - dates: string - [0 or 1] - , -

-

- - remarks: string - [0 or 1] -

-
-

- } -

-
-
-

- } -

-
-
-

- } -

-
-
-

- } -

-
-
-

- } -

-
-
-

- } -

-
-
-

- } -

-
-
diff --git a/test-suite/worked-examples/anthology/valid-flag-check.xml b/test-suite/worked-examples/anthology/valid-flag-check.xml deleted file mode 100644 index cd3d1c0b7..000000000 --- a/test-suite/worked-examples/anthology/valid-flag-check.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Rochester NY - - - - - \ No newline at end of file diff --git a/test-suite/worked-examples/everything-metaschema/everything-handmade.xsd b/test-suite/worked-examples/everything-metaschema/everything-handmade.xsd deleted file mode 100644 index 3cdeaaae4..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything-handmade.xsd +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - NIST Metaschema Everything - 1.0 - everything - - - - - - - - - - Every Thing - Nothing left out. - - - Every Thing: Nothing left out. - - - - - - - - - - - - - - - - - - One String - Not more than one. - - - One String: Not more than one. - - - - - - - - - - - Customized Field - A declaration that can be overridden locally. - - - Customized Field: A declaration that can be overridden locally. - - - - - - - - - - - - - -

thousand

-
-
-
-
-
-
-
-
diff --git a/test-suite/worked-examples/everything-metaschema/everything-metaschema_METATRON.sch b/test-suite/worked-examples/everything-metaschema/everything-metaschema_METATRON.sch deleted file mode 100644 index a0091ad38..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything-metaschema_METATRON.sch +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - Where ancestor::everything:stanza/@type='couplet', is expected to have exactly 2 occurrences of line - - Where ancestor::everything:stanza/@type='tercet', is expected to have exactly 3 occurrences of line - - Where ancestor::everything:stanza/@type='quatrain', is expected to have exactly 4 occurrences of line - - - Where @type='type', is expected to be (one of) 'start', 'end', not '' - - - - - - is expected to be (one of) 'Alpha', 'Beta', 'Gamma', not '' - - - - - - Where (empty( self::everything:expectation[@type='oneof'] )), is expected to be unique within the containing - - - - - is expected to be (one of) 'date', 'color', 'wholeNo', 'ID', not '' - - - - is expected to match regular expression '^\S' - - - Where ancestor::everything:widget/@banner-type='date', is expected to take the form of datatype date' - - Where ancestor::everything:widget/@banner-type='color', is expected to be (one of) 'red', 'blue', 'green', not '' - - Where ancestor::everything:widget/@banner-type='wholeNo', is expected to match regular expression '^\d+$' - - - - is expected to be (one of) 'couplet', 'tercet', 'quatrain', not '' - - - - is expected to be (one of) 'type', 'date', 'roleref', 'oneof', not '' - - - - is expected to take the form of datatype decimal' - - - - is expected to take the form of datatype decimal' - - - Where @who='ghost', is expected to be (one of) 'Boo!', not '' - - Where @class='has-a', is expected to match regular expression 'a|A' - - Where (empty( self::everything:line[@who='ghost'] )), is expected to be (one of) 'Boo!', not '' - - Where (empty( self::everything:line[@class='has-a'] )), is expected to match regular expression 'a|A' - - - - - - Where ancestor::everything:expectation/@type='date', is expected to take the form of datatype date' - - - Where ancestor::everything:expectation/@type='roleref', is expected to correspond to an entry in the '' index within the containing - - - - - - - - - - string - string - NCName - { $nominal-type } - - - - {$value} - - - - - - - - - - diff --git a/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup.sch b/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup.sch deleted file mode 100644 index ccb6354d8..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup.sch +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - Here be - - - - - - - - - - - - - - Ghost only says Boo! - Ghost only says Boo! - - - Colors must be red or pink - - - - - when @type='type', an expectation value should be one of 'start', 'end' - - - 'role-index' index returns nothing for key '': this everything has no role with this @role-id - - - - Biggish - - - - \ No newline at end of file diff --git a/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup2.sch b/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup2.sch deleted file mode 100644 index 65c43baa7..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup2.sch +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - /. '' is expected to be one of 'date', 'color', 'wholeNo', 'ID' - - - - /@banner '' is expected to match regular expression '^\d+$' - Where @banner-type='color', /@banner '' is expected to be one of 'red', 'blue', 'green' - Where @banner-type='wholeNo', /@banner '' is expected to match regular expression '^\d+$' - - - - /. '' is expected to be one of 'couplet', 'tercet', 'quatrain' - - - Where @type='couplet', / everything:line is expected to occur exactly 2 times - Where @type='tercet', / everything:line is expected to occur exactly 3 times - Where @type='quatrain', / everything:line is expected to occur exactly 4 times - - - - /. '' is expected to be one of 'type', 'date', 'roleref', 'oneof' - - - Where @type='type', /data() '' is expected to be one of 'start', 'end' - - - - /. '' is expected to be one of 'Alpha', 'Beta', 'Gamma' - - - diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema-hand-schema.json b/test-suite/worked-examples/everything-metaschema/everything_metaschema-hand-schema.json deleted file mode 100644 index e8be4f98d..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything_metaschema-hand-schema.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://csrc.nist.gov/metaschema/ns/everything-schema.json", - "$comment": "NIST Metaschema Everything: JSON Schema", - "type": "object", - "definitions": { - "ANYTHING": { - "title": "Any Thing", - "description": "Any old thing.", - "$id": "#anythingXX", - "type": "object", - "properties": { - "todays-date": { - "title": "Today's Date", - "description": "Not before yesterday.", - "type": "string", - "pattern": "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" - } - }, - "additionalProperties": false - }, - "EVERYTHING": { - "title": "Every Thing", - "description": "Nothing left out.", - "$id": "#/definitions/everything", - "type": "object", - "properties": { - "todays-date": { - "title": "Today's Date", - "description": "Not before yesterday.", - "type": "string", - "pattern": "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" - }, - "required-integer": { - "title": "Required Integer", - "description": "An integer.", - "type": "integer" - } - }, - "required": [ - "required-integer", - "required-local-field", - "singleton" - ], - "additionalProperties": false - }, - "singleton": { - "title": "Singleton assembly", - "description": "One of a kind.", - "$id": "#/definitions/singleton", - "type": "object", - "properties": { - "todays-date": { - "title": "Today's Date", - "description": "Not before yesterday.", - "type": "string", - "pattern": "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" - } - }, - "required": ["title"], - "additionalProperties": false - }, - "section": { - "title": "Section", - "description": ".", - "$id": "#/definitions/section", - "type": "object", - "properties": { - "class": { - "title": "Class", - "description": ".", - "type": "string" - } - }, - "additionalProperties": false - }, - "color": { - "title": "Color", - "description": "Name and code", - "$id": "#/definitions/color", - "type": "object", - "properties": { - "STRVALUE": {"type": "string"} - }, - "required": ["STRVALUE"], - "additionalProperties": false - }, - "point": { - "title": "Point", - "description": "Point location", - "$id": "#/definitions/point", - "type": "object", - "properties": { - "x": { - "title": "X", - "description": "Abscissa", - "type": "number", - "pattern": "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" - }, - "y": { - "title": "Y", - "description": "ordinate", - "type": "number", - "pattern": "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" - } - }, - "additionalProperties": false - }, - "role": { - "title": "Role", - "description": ".", - "$id": "#/definitions/role", - "type": "object", - "additionalProperties": false - }, - "line": { - "title": "Line of verse", - "description": "Could be terse", - "$id": "#/definitions/line", - "type": "string" - }, - "title": { - "title": "Title", - "description": ".", - "$id": "#/definitions/title", - "type": "string" - }, - "prose": { - "title": "Prose", - "description": "A placeholder for prose in an explicit model.", - "$id": "#/definitions/prose", - "type": "string" - }, - "remarks": { - "title": "Prose", - "description": "A block o' prose.", - "$id": "#/definitions/remarks", - "type": "string" - }, - "named-value": { - "title": "Named value", - "description": "A field with a json value flag", - "$id": "#/definitions/named-value", - "type": "object", - "properties": { - "class": { - "title": "Class", - "description": "Some class.", - "type": "string" - } - }, - "minProperties": 1, - "maxProperties": 2 - }, - "one-string": { - "title": "One String", - "description": "Not more than one.", - "$id": "#/definitions/one-string", - "type": "object", - "properties": { - "todays-date": { - "title": "Today's Date", - "description": "Not before yesterday.", - "type": "string", - "pattern": "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" - }, - "required-ncname": { - "title": "Required NCName", - "description": "A no-colon name.", - "type": "string" - }, - "STRVALUE": {"type": "string"} - }, - "required": ["STRVALUE"], - "additionalProperties": false, - "enum": [ - "Alpha", - "Beta", - "Gamma" - ] - } - }, - "oneOf": [ - { - "properties": { - "ANYTHING": {"$ref": "#/definitions/ANYTHING"} - }, - "required": ["ANYTHING"] - }, - { - "properties": { - "EVERYTHING": {"$ref": "#/definitions/EVERYTHING"} - }, - "required": ["EVERYTHING"] - } - ] -} \ No newline at end of file diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema.xml b/test-suite/worked-examples/everything-metaschema/everything_metaschema.xml index 8c61c21f2..4421bb5de 100644 --- a/test-suite/worked-examples/everything-metaschema/everything_metaschema.xml +++ b/test-suite/worked-examples/everything-metaschema/everything_metaschema.xml @@ -1,14 +1,13 @@ - + - + NIST Metaschema Everything 1.0 everything http://csrc.nist.gov/metaschema/ns/everything - + http://csrc.nist.gov/metaschema/ns/everything +

A mini metaschema produced for testing purposes. Use at your own risk.

@@ -114,9 +113,9 @@ Under 'widget' - + - + @@ -140,7 +139,7 @@ Under 'widget' - + @@ -179,24 +178,16 @@ Under 'widget' - - - - - - Red - Blue - Green - - - - - - - - - - + + + Red + Blue + Green + + + + +
@@ -220,16 +211,9 @@ Under 'widget' - - - - - - - - - - + + +
@@ -251,20 +235,14 @@ Under 'widget'
- - - start - end - - - - - - - - - - + + start + end + + + + + @@ -282,8 +260,8 @@ Under 'widget' Section . - - + + id . @@ -304,42 +282,42 @@ Under 'widget' Color Name and code - + Code The six-digit hex code, so FF0000 for red - - Point - Point location - - - Point ID - A name for the point - - - X - Abscissa - - - Y - ordinate - - - - - - - - - + + Point + Point location + + + Point ID + A name for the point + + + X + Abscissa + + + Y + ordinate + + + + + + + + + Role . - + Role ID A unique identifier for the role @@ -352,7 +330,7 @@ Under 'widget' - + @@ -387,14 +365,10 @@ Under 'widget' Who speaks the line - - - - - - - - + + + + @@ -423,7 +397,7 @@ Under 'widget' Named value A field with a json value flag - + Name @@ -450,12 +424,12 @@ Under 'widget' Not before yesterday. - + Required NCName A no-colon name. - + Class Some class. diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema_COMPOSED.xml b/test-suite/worked-examples/everything-metaschema/everything_metaschema_COMPOSED.xml deleted file mode 100644 index 77048dad7..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything_metaschema_COMPOSED.xml +++ /dev/null @@ -1,416 +0,0 @@ - - NIST Metaschema Everything - 1.0 - everything - http://csrc.nist.gov/metaschema/ns/everything - -

A mini metaschema produced for testing purposes. Use at your own risk.

-
- - Any Thing - Any old thing. - ANYTHING - - - - everything - - - - - Every Thing - Nothing left out. - EVERYTHING - - - Required Integer - An integer. - - - - Required local field - Declared on 'everything' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - everything - - - - - - - - - - - - - - Widget - With knobs and switches. - - Banner type - How should we check the banner (a flag) - - - Date type - Color - Lexically, a whole number (\d+) - A unique identifier - - - - - Banner - A flag, with a dynamic (lexical) type - - - - - - - - - - - - - - - Red - Blue - Green - - - - - - - - - - - - - - Verse stanza - A sequence of lines of determinate length - - Verse type - Be creative - - - Couplet - Tercet - Quatrain - - - - - - - - - - - - - - - - - - - - - - Expectation - Something that may or may not occur in the future. - - Expectation type - Saying something about an expectation. - - - type - date - role reference - a unique set of values - - - - - - - start - end - - - - - - - - - - - - - - Singleton assembly - One of a kind. - SINGLETON - - - - - - - - Section - . - - - id - . - - - Class - . - - - - - - - - - - - - Color - Name and code - - - Code - The six-digit hex code, so FF0000 for red - - - - Point - Point location - - - Point ID - A name for the point - - - X - Abscissa - - - Y - ordinate - - - - - - - - - - - Role - . - - - Role ID - A unique identifier for the role - - - - - - - - - - - - - - - - Line of verse - Could be terse - - - Title - . - - - Prose - A placeholder for prose in an explicit model. - - - Skit - An exchange of lines - - - line of a skit - A single spoken line - - - - Who - Who speaks the line - - - - - - - - - - - - - - - - - - - - - - Prose - A block o' prose. - - - Named value - A field with a json value flag - - - - Name - The name for the value - - - - Greek letter - Not more than one, spelled out, but only ɑ, β and γ - - - - - - - - - - - - Today's Date - Not before yesterday. - - - Required NCName - A no-colon name. - - - Class - Some class. - -
diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema_JSON-SCHEMA.json b/test-suite/worked-examples/everything-metaschema/everything_metaschema_JSON-SCHEMA.json deleted file mode 100644 index b171a27cf..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything_metaschema_JSON-SCHEMA.json +++ /dev/null @@ -1,250 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/metaschema/ns/everything-schema.json", - "$comment" : "NIST Metaschema Everything: JSON Schema", - "type" : "object", - "definitions" : - { "ANYTHING" : - { "title" : "Any Thing", - "description" : "Any old thing.", - "type" : "object", - "properties" : - { "todays-date" : - { "title" : "Today's Date", - "description" : "Not before yesterday.", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "EVERYTHING" : - { "$ref" : "#/definitions/EVERYTHING" } }, - "additionalProperties" : false }, - "EVERYTHING" : - { "title" : "Every Thing", - "description" : "Nothing left out.", - "type" : "object", - "properties" : - { "todays-date" : - { "title" : "Today's Date", - "description" : "Not before yesterday.", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "required-integer" : - { "title" : "Required Integer", - "description" : "An integer.", - "type" : "integer" }, - "required-local-field" : - { "title" : "Required local field", - "description" : "Declared on 'everything'", - "type" : "string" }, - "one-string" : - { "$ref" : "#/definitions/one-string" }, - "epigraph" : - { "anyOf" : - [ - { "$ref" : "#/definitions/line" }, - - { "type" : "array", - "minItems" : 2, - "items" : - { "$ref" : "#/definitions/line" } } ] }, - "colors" : - { "type" : "object", - "minProperties" : 1, - "additionalProperties" : - { "allOf" : - [ - { "type" : "object", - "$ref" : "#/definitions/color" }, - - { "not" : - { "type" : "string" } } ] } }, - "lattice" : - { "type" : "object", - "minProperties" : 1, - "additionalProperties" : - { "allOf" : - [ - { "type" : "object", - "$ref" : "#/definitions/point" }, - - { "not" : - { "type" : "string" } } ] } }, - "dramatis-personae" : - { "type" : "object", - "minProperties" : 1, - "additionalProperties" : - { "allOf" : - [ - { "type" : "object", - "$ref" : "#/definitions/role" }, - - { "not" : - { "type" : "string" } } ] } }, - "SINGLETON" : - { "$ref" : "#/definitions/SINGLETON" }, - "sections" : - { "type" : "object", - "minProperties" : 1, - "additionalProperties" : - { "allOf" : - [ - { "type" : "object", - "$ref" : "#/definitions/section" }, - - { "not" : - { "type" : "string" } } ] } }, - "everythings" : - { "anyOf" : - [ - { "$ref" : "#/definitions/EVERYTHING" }, - - { "type" : "array", - "maxItems" : 3, - "minItems" : 2, - "items" : - { "$ref" : "#/definitions/EVERYTHING" } } ] } }, - "required" : - [ "required-integer", - "required-local-field", - "SINGLETON" ], - "additionalProperties" : false }, - "SINGLETON" : - { "title" : "Singleton assembly", - "description" : "One of a kind.", - "type" : "object", - "properties" : - { "todays-date" : - { "title" : "Today's Date", - "description" : "Not before yesterday.", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "title" : - { "$ref" : "#/definitions/title" }, - "remarks" : - { "$ref" : "#/definitions/remarks" } }, - "required" : - [ "title" ], - "additionalProperties" : false }, - "section" : - { "title" : "Section", - "description" : ".", - "type" : "object", - "properties" : - { "class" : - { "title" : "Class", - "description" : ".", - "type" : "string" }, - "title" : - { "$ref" : "#/definitions/title" }, - "named-value" : - { "$ref" : "#/definitions/named-value" }, - "epigraph" : - { "anyOf" : - [ - { "$ref" : "#/definitions/line" }, - - { "type" : "array", - "minItems" : 2, - "items" : - { "$ref" : "#/definitions/line" } } ] }, - "prose" : - { "$ref" : "#/definitions/prose" } }, - "additionalProperties" : false }, - "color" : - { "title" : "Color", - "description" : "Name and code", - "type" : "object", - "properties" : - { "STRVALUE" : - { "type" : "string" } }, - "required" : - [ "STRVALUE" ], - "additionalProperties" : false }, - "point" : - { "title" : "Point", - "description" : "Point location", - "type" : "object", - "properties" : - { "x" : - { "title" : "X", - "description" : "Abscissa", - "type" : "number", - "pattern" : "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" }, - "y" : - { "title" : "Y", - "description" : "ordinate", - "type" : "number", - "pattern" : "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" } }, - "additionalProperties" : false }, - "role" : - { "title" : "Role", - "description" : ".", - "type" : "object", - "properties" : - { "title" : - { "$ref" : "#/definitions/title" }, - "remarks" : - { "$ref" : "#/definitions/remarks" } }, - "additionalProperties" : false }, - "line" : - { "title" : "Line of verse", - "description" : "Could be terse", - "type" : "string" }, - "title" : - { "title" : "Title", - "description" : ".", - "type" : "string" }, - "prose" : - { "title" : "Prose", - "description" : "A placeholder for prose in an explicit model.", - "type" : "string" }, - "remarks" : - { "title" : "Prose", - "description" : "A block o' prose.", - "type" : "string" }, - "named-value" : - { "title" : "Named value", - "description" : "A field with a json value flag", - "type" : "object", - "properties" : - { "class" : - { "title" : "Class", - "description" : "Some class.", - "type" : "string" } }, - "minProperties" : 1, - "maxProperties" : 2 }, - "one-string" : - { "title" : "One String", - "description" : "Not more than one.", - "type" : "object", - "properties" : - { "todays-date" : - { "title" : "Today's Date", - "description" : "Not before yesterday.", - "type" : "string", - "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, - "required-ncname" : - { "title" : "Required NCName", - "description" : "A no-colon name.", - "type" : "string" }, - "STRVALUE" : - { "type" : "string" } }, - "required" : - [ "STRVALUE" ], - "additionalProperties" : false, - "enum" : - [ "Alpha", - "Beta", - "Gamma" ] } }, - "oneOf" : - [ - { "properties" : - { "ANYTHING" : - { "$ref" : "#/definitions/ANYTHING" } }, - "required" : - [ "ANYTHING" ] }, - - { "properties" : - { "EVERYTHING" : - { "$ref" : "#/definitions/EVERYTHING" } }, - "required" : - [ "EVERYTHING" ] } ] } \ No newline at end of file diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema_XML-SCHEMA.xsd b/test-suite/worked-examples/everything-metaschema/everything_metaschema_XML-SCHEMA.xsd deleted file mode 100644 index ded01f052..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything_metaschema_XML-SCHEMA.xsd +++ /dev/null @@ -1,866 +0,0 @@ - - - - - NIST Metaschema Everything - 1.0 - everything - -

A mini metaschema produced for testing purposes. Use at your own risk.

-
- ANYTHING - EVERYTHING -
-
- - - - - Any Thing - Any old thing. - - - Any Thing: Any old thing. - - - - - - - - Today's Date - Not before yesterday. - - - Today's Date: Not before yesterday. - - - - - - - - Every Thing - Nothing left out. - - - Every Thing: Nothing left out. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Today's Date - Not before yesterday. - - - Today's Date: Not before yesterday. - - - - - - Required Integer - An integer. - - - Required Integer: An integer. - - - - - - - Widget - With knobs and switches. - - - Widget: With knobs and switches. - - - - - - - - - Banner type - How should we check the banner (a flag) - - - Banner type: How should we check the banner (a flag) - - - - - - -

Date type

-
-
-
- - - -

Color

-
-
-
- - - -

Lexically, a whole number (\d+)

-
-
-
- - - -

A unique identifier

-
-
-
-
-
-
- - - - Banner - A flag, with a dynamic (lexical) type - - - Banner: A flag, with a dynamic (lexical) type - - -
- - - - Verse stanza - A sequence of lines of determinate length - - - Verse stanza: A sequence of lines of determinate length - - - - - - - - Verse type - Be creative - - - Verse type: Be creative - - - - - - - - -

Couplet

-
-
-
- - - -

Tercet

-
-
-
- - - -

Quatrain

-
-
-
-
-
-
-
-
-
- - - - Expectation - Something that may or may not occur in the future. - - - Expectation: Something that may or may not occur in the future. - - - - - - - Expectation type - Saying something about an expectation. - - - Expectation type: Saying something about an expectation. - - - - - - -

type

-
-
-
- - - -

date

-
-
-
- - - -

role reference

-
-
-
- - - -

a unique set of values

-
-
-
-
-
-
-
-
-
- - - - Singleton assembly - One of a kind. - - - Singleton assembly: One of a kind. - - - - - - - Prose - A block o' prose. - - - Prose: A block o' prose. - - - - - - - - - - Today's Date - Not before yesterday. - - - Today's Date: Not before yesterday. - - - - - - - Section - . - - - Section: . - - - - - - - - - - - - - - - - - id - . - - - id: . - - - - - - Class - . - - - Class: . - - - - - - - Color - Name and code - - - Color: Name and code - - - - - - - Code - The six-digit hex code, so FF0000 for red - - - Code: The six-digit hex code, so FF0000 for red - - - - - - - - - - Role - . - - - Role: . - - - - - - - Prose - A block o' prose. - - - Prose: A block o' prose. - - - - - - - - - - Role ID - A unique identifier for the role - - - Role ID: A unique identifier for the role - - - - - - - - - - - - - Skit - An exchange of lines - - - Skit: An exchange of lines - - - - - - - - - Class - Some class. - - - Class: Some class. - - - - - - - - - - Named value - A field with a json value flag - - - Named value: A field with a json value flag - - - - - - - Class - Some class. - - - Class: Some class. - - - - - - Name - The name for the value - - - Name: The name for the value - - - - - - - - - Greek letter - Not more than one, spelled out, but only ɑ, β and γ - - - Greek letter: Not more than one, spelled out, but only ɑ, β and γ - - - - - - - Today's Date - Not before yesterday. - - - Today's Date: Not before yesterday. - - - - - - Required NCName - A no-colon name. - - - Required NCName: A no-colon name. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema_hand-keys.xsd b/test-suite/worked-examples/everything-metaschema/everything_metaschema_hand-keys.xsd deleted file mode 100644 index 0d54fb9e4..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything_metaschema_hand-keys.xsd +++ /dev/null @@ -1,639 +0,0 @@ - - - - - NIST Metaschema Everything - 1.0 - everything - -

A mini metaschema produced for testing purposes. Use at your own risk.

-
- ANYTHING - EVERYTHING -
-
- - - - - - - - - - Any Thing - Any old thing. - - - Any Thing: Any old thing. - - - - - - - - Today's Date - Not before yesterday. - - - Today's Date: Not before yesterday. - - - - - - - - - - - - Every Thing - Nothing left out. - - - Every Thing: Nothing left out. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Today's Date - Not before yesterday. - - - Today's Date: Not before yesterday. - - - - - - Required Integer - An integer. - - - Required Integer: An integer. - - - - - - - Singleton assembly - One of a kind. - - - Singleton assembly: One of a kind. - - - - - - - Prose - A block o' prose. - - - Prose: A block o' prose. - - - - - - - - - - Today's Date - Not before yesterday. - - - Today's Date: Not before yesterday. - - - - - - - Section - . - - - Section: . - - - - - - - - - - - - - - - - - id - . - - - id: . - - - - - - Class - . - - - Class: . - - - - - - - Color - Name and code - - - Color: Name and code - - - - - - - Code - The six-digit hex code, so FF0000 for red - - - Code: The six-digit hex code, so FF0000 for red - - - - - - - - - - Role - . - - - Role: . - - - - - - - Prose - A block o' prose. - - - Prose: A block o' prose. - - - - - - - - - - Role ID - A unique identifier for the role - - - Role ID: A unique identifier for the role - - - - - - - - - - - - - Named value - A field with a json value flag - - - Named value: A field with a json value flag - - - - - - - Class - Some class. - - - Class: Some class. - - - - - - Name - The name for the value - - - Name: The name for the value - - - - - - - - - One String - Not more than one. - - - One String: Not more than one. - - - - - - - Today's Date - Not before yesterday. - - - Today's Date: Not before yesterday. - - - - - - Required NCName - A no-colon name. - - - Required NCName: A no-colon name. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/test-suite/worked-examples/everything-metaschema/everything_xml-model-map.html b/test-suite/worked-examples/everything-metaschema/everything_xml-model-map.html deleted file mode 100644 index c7aec5cf4..000000000 --- a/test-suite/worked-examples/everything-metaschema/everything_xml-model-map.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - -

<>

-
- <everything - todays-date="date"> [0 or 1] - -
-
-

<one-string - todays-date="date" required-ncname="NCName">string</one-string> [0 or 1] -

-

- - Markup multiline - -

-
- <section> [0 or 1] - -
-
-

<title>markup-line</title> [0 or 1] -

-

- - Markup multiline - -

-

- - Markup multiline - -

-
-
-

</section>

-
-

<everything/> [0 to 3] -

-
-
-

</everything>

-
-
-
-

<one-string - todays-date="date" required-ncname="NCName">string</one-string> [0 or 1] -

-

- - Markup multiline - -

-
- <section> [0 or 1] - -
-
-

<title>markup-line</title> [0 or 1] -

-

- - Markup multiline - -

-

- - Markup multiline - -

-
-
-

</section>

-
-

<everything/> [0 to 3] -

-
</> [0 or 1] -

- - diff --git a/test-suite/worked-examples/everything-metaschema/kitchen-sink.json b/test-suite/worked-examples/everything-metaschema/kitchen-sink.json deleted file mode 100644 index 2765b4eab..000000000 --- a/test-suite/worked-examples/everything-metaschema/kitchen-sink.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "EVERYTHING": { "todays-date": "2020-02-19", - "one-string": "Alpha", - "required-integer": 3, - "required-local-field": "um", - "SINGLETON": { "title": "My Summer Vacation" } } -} \ No newline at end of file diff --git a/toolchains/xslt-M4/README.md b/toolchains/xslt-M4/README.md index c37d16d7b..a4408dfe4 100644 --- a/toolchains/xslt-M4/README.md +++ b/toolchains/xslt-M4/README.md @@ -92,7 +92,7 @@ The XSLT `nist-metaschema-metaprocess.xsl` is a utility XSLT providing a unified ### Metaschema schemas / `validate` folder -Any metaschema, metaschema module, or composed metaschema, should all be valid to the Metaschema XSD `validate/metaschema.xsd` and to the `validate/metaschema-check.sch` Schematron. +Any metaschema, metaschema module, or composed metaschema, should all be valid to the Metaschema XSD `../../../schema/xml/metaschema.xsd` and to the `validate/metaschema-check.sch` Schematron. A composed metaschema is essentially what a metaschema will look like with all imports resolved (last appearing definition prevailing, imports read before main definitions); so a metaschema with no imports maps directly to its own composed expression. In composition, pointers are also written into the metaschema representation to provide useful information for downstream processing in resolving referential ambiguities (resulting from unintended or intended import clashes). diff --git a/toolchains/xslt-M4/compose/make-model-map.xsl b/toolchains/xslt-M4/compose/make-model-map.xsl index 4019b89a2..82160952f 100644 --- a/toolchains/xslt-M4/compose/make-model-map.xsl +++ b/toolchains/xslt-M4/compose/make-model-map.xsl @@ -16,7 +16,7 @@ - + @@ -26,6 +26,8 @@ + + @@ -82,6 +84,7 @@ + @@ -152,16 +155,12 @@ - - + + - - - + @@ -251,14 +250,14 @@ RICHTEXT PROSE - - + + - + diff --git a/toolchains/xslt-M4/compose/metaschema-prune-unused-definitions.xsl b/toolchains/xslt-M4/compose/metaschema-prune-unused-definitions.xsl index b316a1725..221f29ac1 100644 --- a/toolchains/xslt-M4/compose/metaschema-prune-unused-definitions.xsl +++ b/toolchains/xslt-M4/compose/metaschema-prune-unused-definitions.xsl @@ -104,7 +104,7 @@ Seeing { $definitions => string-join(', ') } - + No root found in this metaschema composition. diff --git a/toolchains/xslt-M4/compose/testing/models_metaschema.xml b/toolchains/xslt-M4/compose/testing/models_metaschema.xml index 58169d158..26e8fd937 100644 --- a/toolchains/xslt-M4/compose/testing/models_metaschema.xml +++ b/toolchains/xslt-M4/compose/testing/models_metaschema.xml @@ -1,14 +1,12 @@ - - + NIST Metaschema Everything 1.0 test-model http://csrc.nist.gov/metaschema/ns/everything - + http://csrc.nist.gov/metaschema/ns/everything +

A mini metaschema produced for documentation testing purposes.

This metaschema exercises modeling with a mix of global, modular (local) and inline @@ -146,7 +144,7 @@ Keyed field field field-by-key - + @@ -160,7 +158,7 @@ Dynamic value key field field field-dynamic-value-key - + COLOR @@ -277,7 +275,7 @@ Keyed assembly assembly assembly-by-key - + diff --git a/toolchains/xslt-M4/compose/testing/module_metaschema.xml b/toolchains/xslt-M4/compose/testing/module_metaschema.xml index 5bff76ed0..341decd13 100644 --- a/toolchains/xslt-M4/compose/testing/module_metaschema.xml +++ b/toolchains/xslt-M4/compose/testing/module_metaschema.xml @@ -2,10 +2,7 @@ - + OSCAL TEST Format Module 0.0 oscal-test-m1 diff --git a/toolchains/xslt-M4/compose/testing/working_metaschema.xml b/toolchains/xslt-M4/compose/testing/working_metaschema.xml index c960dae4d..3542b90ea 100644 --- a/toolchains/xslt-M4/compose/testing/working_metaschema.xml +++ b/toolchains/xslt-M4/compose/testing/working_metaschema.xml @@ -2,9 +2,7 @@ - + OSCAL TEST Format 0.0 oscal-test diff --git a/toolchains/xslt-M4/converter-gen/supermodel-to-json.xsl b/toolchains/xslt-M4/converter-gen/supermodel-to-json.xsl index 02aa9bc11..345124115 100644 --- a/toolchains/xslt-M4/converter-gen/supermodel-to-json.xsl +++ b/toolchains/xslt-M4/converter-gen/supermodel-to-json.xsl @@ -1,10 +1,9 @@ @@ -138,13 +137,17 @@ - - - - - - + + + + + + + + + diff --git a/toolchains/xslt-M4/document/common-definitions.xsl b/toolchains/xslt-M4/document/common-definitions.xsl index fb000684a..60bc5bcb6 100644 --- a/toolchains/xslt-M4/document/common-definitions.xsl +++ b/toolchains/xslt-M4/document/common-definitions.xsl @@ -34,6 +34,8 @@ + + @@ -94,12 +96,12 @@

value key { . }

- -

object key flag { @flag-name }

+ +

object key flag { @flag-ref }

- -

value key flag { @flag-name }

+ +

value key flag { @flag-ref }

@@ -157,7 +159,7 @@ - + @@ -168,7 +170,7 @@ - + diff --git a/toolchains/xslt-M4/document/json/json-definitions.xsl b/toolchains/xslt-M4/document/json/json-definitions.xsl index a92b7661c..a18a06db7 100644 --- a/toolchains/xslt-M4/document/json/json-definitions.xsl +++ b/toolchains/xslt-M4/document/json/json-definitions.xsl @@ -76,16 +76,16 @@ exclude-result-prefixes="#all"> - - + + This property provides the (nominal) value for this object as a whole. - - A property whose name is distinct from assigned properties for this object is taken as its (nominal) value, while its key is taken to be the value of the property. + + A property whose name is distinct from assigned properties for this object is taken as its (nominal) value, while its key is taken to be the value of the property. diff --git a/toolchains/xslt-M4/document/json/json-docs-hugo-uswds.xsl b/toolchains/xslt-M4/document/json/json-docs-hugo-uswds.xsl index f1d127623..29fe02f52 100644 --- a/toolchains/xslt-M4/document/json/json-docs-hugo-uswds.xsl +++ b/toolchains/xslt-M4/document/json/json-docs-hugo-uswds.xsl @@ -257,7 +257,7 @@ @@ -294,7 +294,7 @@ - +
@@ -1068,10 +1068,10 @@ - + {{taken as the - + property}} @@ -1080,8 +1080,8 @@ This property provides the (nominal) value for this object as a whole. - - A property whose name is distinct from assigned properties for this object is taken as its (nominal) value, while its key is taken to be the value of the property. + + A property whose name is distinct from assigned properties for this object is taken as its (nominal) value, while its key is taken to be the value of the property. diff --git a/toolchains/xslt-M4/document/metaschema-common-html.xsl b/toolchains/xslt-M4/document/metaschema-common-html.xsl index 5547a6097..57a4e5986 100644 --- a/toolchains/xslt-M4/document/metaschema-common-html.xsl +++ b/toolchains/xslt-M4/document/metaschema-common-html.xsl @@ -178,7 +178,7 @@ flags that must be properties. --> - + \ No newline at end of file diff --git a/toolchains/xslt-M4/document/xml/xml-definitions.xsl b/toolchains/xslt-M4/document/xml/xml-definitions.xsl index 95f282383..e4631518e 100644 --- a/toolchains/xslt-M4/document/xml/xml-definitions.xsl +++ b/toolchains/xslt-M4/document/xml/xml-definitions.xsl @@ -69,7 +69,7 @@ exclude-result-prefixes="#all"> - + diff --git a/toolchains/xslt-M4/document/xml/xml-docs-hugo-uswds.xsl b/toolchains/xslt-M4/document/xml/xml-docs-hugo-uswds.xsl index e207e2d3d..6eb22de0f 100644 --- a/toolchains/xslt-M4/document/xml/xml-docs-hugo-uswds.xsl +++ b/toolchains/xslt-M4/document/xml/xml-docs-hugo-uswds.xsl @@ -268,7 +268,7 @@ flags that must be properties. --> - + diff --git a/toolchains/xslt-M4/file-manifest.md b/toolchains/xslt-M4/file-manifest.md index 1fd405557..1bed749b2 100644 --- a/toolchains/xslt-M4/file-manifest.md +++ b/toolchains/xslt-M4/file-manifest.md @@ -160,7 +160,6 @@ - XProc pipeline version 1.0 (5 steps) -- Runtime dependency: `schema-gen/configure-namespaces.xsl` - Runtime dependency: `schema-gen/make-metaschema-xsd.xsl` #### write-hugo-metaschema-docs.xpl diff --git a/toolchains/xslt-M4/make-metaschema-xsd.xpl b/toolchains/xslt-M4/make-metaschema-xsd.xpl index 20ef8aaad..31ded2849 100644 --- a/toolchains/xslt-M4/make-metaschema-xsd.xpl +++ b/toolchains/xslt-M4/make-metaschema-xsd.xpl @@ -20,16 +20,11 @@ - - + + - - - - - @@ -56,12 +51,6 @@ - - - - - - \ No newline at end of file diff --git a/toolchains/xslt-M4/metapath/metapath-jsonize.xsl b/toolchains/xslt-M4/metapath/metapath-jsonize.xsl index 2062900fd..e5633c68a 100644 --- a/toolchains/xslt-M4/metapath/metapath-jsonize.xsl +++ b/toolchains/xslt-M4/metapath/metapath-jsonize.xsl @@ -22,7 +22,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://csrc.nist.gov/ns/oscal/metaschema/1.0 - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/toolchains/xslt-M4/schema-gen/datatypes-query.xsl b/toolchains/xslt-M4/schema-gen/datatypes-query.xsl deleted file mode 100644 index bd74be25f..000000000 --- a/toolchains/xslt-M4/schema-gen/datatypes-query.xsl +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Copies of simpleType declarations for querying by - routines that need to know about XSD simple types we may use. Any simpleType - we support should be listed here for propagation in tools e.g. Metaschema Schematron. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { @key }: {.} - - - \ No newline at end of file diff --git a/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl b/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl index 217987c13..3a1200277 100644 --- a/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl +++ b/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl @@ -30,6 +30,11 @@ + @@ -41,7 +46,9 @@ + + http://json-schema.org/draft-07/schema# { json-base-uri }/{ schema-version }/{ short-name }-schema.json @@ -52,7 +59,14 @@ object - + + + + + + + + @@ -159,7 +173,7 @@ - + object @@ -172,14 +186,14 @@ - + we require an unspecified property, with any key, to carry the nominal value @@ -193,11 +207,33 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -217,6 +253,7 @@ + @@ -254,7 +291,7 @@ - + - true + true false @@ -315,8 +352,8 @@ - - + + @@ -324,14 +361,14 @@ - - @@ -348,7 +385,7 @@ a string or an array of strings turned off for now until we reinstate collapsing into conversion scripts (2020-09-21) --> - + - - + + + - - - - + @@ -442,11 +471,6 @@ - - - string - - @@ -544,7 +568,7 @@ - + string @@ -619,8 +643,16 @@ - - + + + + + + #/definitions/{$assigned-type} @@ -638,30 +670,31 @@ --> + ../../../schema/json/metaschema-datatypes.json + + - - + - + + - - + + ^(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)$-\-> - + string ^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$ - + --> string ^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})?$ - + string date-time @@ -672,35 +705,35 @@ email ^.+@.+$ - + + string ipv6 ^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3,3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3,3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))$ - + #/definitions/StringDatatype idn-hostname - + string uri ^[a-zA-Z][a-zA-Z0-9+\-.]+:.+$ - + string uri-reference - + string A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC 4122. ^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$ - + string ^(\p{L}|_)(\p{L}|\p{N}|[.\-_])*$ @@ -708,8 +741,7 @@ string ^\S(.*\S)?$ - - + --> diff --git a/toolchains/xslt-M4/schema-gen/make-metaschema-xsd.xsl b/toolchains/xslt-M4/schema-gen/make-metaschema-xsd.xsl index 6ae0e7b45..ac706a1fa 100644 --- a/toolchains/xslt-M4/schema-gen/make-metaschema-xsd.xsl +++ b/toolchains/xslt-M4/schema-gen/make-metaschema-xsd.xsl @@ -6,7 +6,6 @@ xpath-default-namespace="http://csrc.nist.gov/ns/oscal/metaschema/1.0" exclude-result-prefixes="xs math m" version="3.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> @@ -22,9 +21,7 @@ - - - + @@ -34,19 +31,71 @@ - + + - + + - + + ../../../schema/xml/metaschema-markup-multiline.xsd + ../../../schema/xml/metaschema-markup-line.xsd + ../../../schema/xml/metaschema-prose-base.xsd + + + + ../../../schema/xml/metaschema-datatypes.xsd + + + + Base64Datatype + BooleanDatatype + DateDatatype + DateTimeDatatype + DateTimeWithTimezoneDatatype + DateWithTimezoneDatatype + DayTimeDurationDatatype + DecimalDatatype + + + + EmailAddressDatatype + HostnameDatatype + IntegerDatatype + IPV4AddressDatatype + IPV6AddressDatatype + NonNegativeIntegerDatatype + PositiveIntegerDatatype + StringDatatype + TokenDatatype + URIDatatype + URIReferenceDatatype + UUIDDatatype + + + + Base64Datatype + DateTimeDatatype + DateTimeWithTimezoneDatatype + EmailAddressDatatype + NonNegativeIntegerDatatype + PositiveIntegerDatatype + + + + + + + Metaschema composition exception reported{ @problem-type/' (' || . || ')'}: { normalize-space() } + http://csrc.nist.gov/ns/oscal/metaschema/1.0 - + @@ -59,31 +108,17 @@ - - + - + + + + - + @@ -105,6 +140,17 @@ + + + + { local-name()}{ (@info-type | @problem-type)/(' (' || . || ')' ) }: { . } + + + @@ -112,7 +158,8 @@ - + + @@ -137,7 +184,9 @@ A group of '{ @name }' elements - { group-as/@name }: A group of '{ @name }' elements + { group-as/@name } + : A group of '{ @name }' elements + @@ -153,8 +202,9 @@ - - + + + @@ -172,22 +222,12 @@ - - - - - - - string - - + - base - + base + @@ -200,27 +240,17 @@ - - - - - - - string - - - - - - - base - - - - - + + + + + + base + + + + + - - + @@ -253,7 +282,7 @@ - + @@ -286,7 +315,7 @@ - + : @@ -316,7 +345,7 @@ - + @@ -326,7 +355,7 @@ - + @@ -362,13 +391,13 @@ - + - + @@ -380,7 +409,7 @@ maxOccurs="{ if (exists(@max-occurs)) then @max-occurs else 1 }"> - + @@ -394,14 +423,14 @@ - + required - + @@ -418,13 +447,13 @@ - + required - - + + @@ -435,21 +464,28 @@ - type - - - + + + + + + Seeing no oscal-type for datatype '{ $datatype }' + + + + + + @@ -464,14 +500,15 @@ - - memberTypes + + memberTypes + - - base + base + @@ -500,9 +537,9 @@ -

+ -

+
@@ -515,9 +552,11 @@
+ + - { $declaration-prefix }: + { string(.) } @@ -529,10 +568,18 @@ - + + + - - + + diff --git a/toolchains/xslt-M4/schema-gen/oscal-auto-datatypes.xsd b/toolchains/xslt-M4/schema-gen/oscal-auto-datatypes.xsd deleted file mode 100644 index f3316f806..000000000 --- a/toolchains/xslt-M4/schema-gen/oscal-auto-datatypes.xsd +++ /dev/null @@ -1,293 +0,0 @@ - - - - Copies of simpleType declarations for querying by - routines that need to know about XSD simple types we may use. Any simpleType - we support should be listed here for propagation in tools e.g. Metaschema Schematron. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC 4122. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC 4122. - - - - - - - - - - - - - - - - - - - - - - diff --git a/toolchains/xslt-M4/schema-gen/oscal-datatypes.xsd b/toolchains/xslt-M4/schema-gen/oscal-datatypes.xsd deleted file mode 100644 index ec9eb675d..000000000 --- a/toolchains/xslt-M4/schema-gen/oscal-datatypes.xsd +++ /dev/null @@ -1,387 +0,0 @@ - - - - - Copies of simpleType declarations for querying by - routines that need to know about XSD simple types we may use. Any simpleType - we support should be listed here for propagation in tools e.g. Metaschema Schematron. - - - - - - - - - - - - - - - - - - - - - - - OSCAL reference for native type - - - - - - - OSCAL reference for native type - - - - - - - OSCAL reference for native type - - - - - - - OSCAL reference for native type - - - - - - - - - - A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) - - - - - - - The ip-v4-address type specifies an IPv4 address in dot decimal notation. - - - - - - - The ip-v6-address type specifies an IPv6 address represented in 8 hextets separated by colons. - This is based on the pattern provided here: https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses with some customizations. - - - - - - - The xs:dateTime with a required timezone. - - - - - - - The xs:date with a required timezone. - - - - - - - - An email address - - - - - - - A host name - - - - - - - A URI - - - - - - - A URI reference, such as a relative URL - - - - - - - A Type 4 ('random' or 'pseudorandom' UUID per RFC 4122 - - - - - - - - - A string token following the rules of XML "no colon" names, with no whitespace. (XML names are single alphabetic characters - followed by alphanumeric characters, periods, underscores or dashes.) - - - - - - - - - - - A trimmed string, at least one character with no - leading or trailing whitespace. - - - - - - - - - - A trimmed string, at least one character with no - leading or trailing whitespace. - - - - - - - - - - - - - - The xs:date with a required timezone. - - - - - - - - - - - - - - - The xs:dateTime with a required timezone. - - - - - - - - - - - - - - - - - A trimmed string, at least one character with no - leading or trailing whitespace. - - - - - - - - An email address - - - - - Need a better pattern. - - - - - - - - A host name - - - - - - - - - - - A trimmed string, at least one character with no - leading or trailing whitespace. - - - - - - - - The ip-v4-address type specifies an IPv4 address in - dot decimal notation. - - - - - - - - - The ip-v6-address type specifies an IPv6 address - represented in 8 hextets separated by colons. - This is based on the pattern provided here: - https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses - with some customizations. - - - - - - - - - - - - A trimmed string, at least one character with no - leading or trailing whitespace. - - - - - - - - - - A trimmed string, at least one character with no - leading or trailing whitespace. - - - - - - - - A string, but not empty and not whitespace-only - (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) - - - - The OSCAL 'string' datatype restricts the XSD type by prohibiting leading - and trailing whitespace, and something (not only whitespace) is required. - - - - - A trimmed string, at least one character with no - leading or trailing whitespace. - - - - - - - - - A string token following the rules of XML "no - colon" names, with no whitespace. (XML names are single alphabetic - characters followed by alphanumeric characters, periods, underscores or dashes.) - - - - - - - - A single token may not contain whitespace. - - - - - - - - - A URI - - - - - Requires a scheme with colon per RFC 3986. - - - - - - - - A URI reference, such as a relative URL - - - - - - A trimmed URI, at least one character with no - leading or trailing whitespace. - - - - - - - - A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC - 4122. - - - - - A sequence of 8-4-4-4-12 hex digits, with extra - constraints in the 13th and 17-18th places for version 4 and 5 - - - - - - - - diff --git a/toolchains/xslt-M4/schema-gen/readme.md b/toolchains/xslt-M4/schema-gen/readme.md index 0d7d022ee..b0f3fddc7 100644 --- a/toolchains/xslt-M4/schema-gen/readme.md +++ b/toolchains/xslt-M4/schema-gen/readme.md @@ -1,19 +1,18 @@ +# Schema generation +For generating XML Schema (XSD) and JSON Schema artifacts from Metaschema source. -### xsl +Depends on datatype definitions in subdirectory ../../../schema/. -#### configure-namespaces.xsl +## xsl -- XSLT stylesheet version 2.0 (7 templates) -- Runtime parameter `$debug` with default ''no'' - -#### make-json-schema-metamap.xsl +### make-json-schema-metamap.xsl - XSLT stylesheet version 3.0 (63 templates) - **Purpose:** Produce an XPath-JSON document representing JSON Schema declarations from Metaschema source data. The results are conformant to the rules for the XPath 3.1 definition of an XML format capable of being cast (using the xml-to-json() function) into JSON. - **Note:** this XSLT will only be used on its own for development and debugging. It is however imported by `produce-json-converter.xsl` and possibly other stylesheets. -#### make-metaschema-metatron.xsl +### make-metaschema-metatron.xsl - XSLT stylesheet version 3.0 (34 templates) - **Purpose:** Produce an Schematron representing constraints declared in a metaschema @@ -26,7 +25,7 @@ - Compile-time dependency (xsl:import) `../metapath/parse-metapath.xsl` - Compile-time dependency (xsl:import) `metatron-datatype-functions.xsl` -#### make-metaschema-xsd.xsl +### make-metaschema-xsd.xsl - XSLT stylesheet version 3.0 (41 templates) - **Purpose:** Produce an XSD Schema representing constraints declared in a metaschema @@ -34,27 +33,14 @@ - **Output:** An XSD, with embedded documentation - Runtime parameter `$debug` with default ''no'' -#### metatron-datatype-functions.xsl +### metatron-datatype-functions.xsl - XSLT stylesheet version 3.0 (7 templates) - Can be run standalone, but also serves as a utility XSLT to `make-metaschema-metatron.xsl` -### xpl +## xpl #### test-make-metaschema-xsd.xpl - XProc pipeline version 1.0 (5 steps) -- Runtime dependency: `configure-namespaces.xsl` - Runtime dependency: `make-metaschema-xsd.xsl` - -### xsd - -#### oscal-datatypes.xsd - -Includes type definitions to be called into generated schemas. - -This file drives JSON as well as XSD processes and supports processes throughout the library - test when editing! - -#### oscal-prose-module.xsd - -Similarly, this file provides boilerplate declarations supporting markup-line and markup-multiline data structures in any metaschema-defined model using these datatypes. diff --git a/toolchains/xslt-M4/schema-gen/test-make-metaschema-xsd.xpl b/toolchains/xslt-M4/schema-gen/test-make-metaschema-xsd.xpl index 6d55f1950..0a9bb7608 100644 --- a/toolchains/xslt-M4/schema-gen/test-make-metaschema-xsd.xpl +++ b/toolchains/xslt-M4/schema-gen/test-make-metaschema-xsd.xpl @@ -20,16 +20,11 @@
- - + + - - - - - @@ -55,12 +50,6 @@ - - - - - - \ No newline at end of file diff --git a/toolchains/xslt-M4/testing/models-testdata-json.xml b/toolchains/xslt-M4/testing/models-testdata-json.xml deleted file mode 100644 index 398fe13f5..000000000 --- a/toolchains/xslt-M4/testing/models-testdata-json.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - FIELD-1-ONLY - - 1234abcd - true - - fnv1 - FIELD-NAMED-VALUE - - Here's some *markup*: make of it **what you will**! Even if it has ... \* funky characters \` ... and even an ![some picture](img.jpg) - - - 1 - field-groupable 1 - - - a - field-groupable 2 - - - 3 - field-groupable 3 - - - - field-wrappable 1 - field-wrappable 2 - field-wrappable 3 - - - field-by-key 1 - field-by-key 2 - field-by-key 3 - - - - field-dynamic-value-key 1 - - - field-dynamic-value-key 2 - - - field-dynamic-value-key 3 - - - -# Wrapped up prose - -This is prose. All wrapped up. - -# Unwrapped prose - -Here we have unwrapped prose.... - - - ASSEMBLY-1-ONLY / FIELD-1-ONLY - - - - - - - assembly-groupable 1 / field-groupable 1 - - - assembly-groupable 1 / field-groupable 2 - - - assembly-groupable 1 / field-groupable 3 - - - - - - - assembly-groupable 2 / field-groupable 1 - - - assembly-groupable 2 / field-groupable 2 - - - assembly-groupable 2 / field-groupable 3 - - - - - - - assembly-groupable 3 / field-groupable 1 - - - assembly-groupable 3 / field-groupable 2 - - - assembly-groupable 3 / field-groupable 3 - - - - - - - - assembly-wrappable 1 / field-wrappable 1 - assembly-wrappable 1 / field-wrappable 2 - assembly-wrappable 1 / field-wrappable 3 - - - - - assembly-wrappable 2 / field-wrappable 1 - assembly-wrappable 2 / field-wrappable 2 - assembly-wrappable 2 / field-wrappable 3 - - - - - assembly-wrappable 3 / field-wrappable 1 - assembly-wrappable 3 / field-wrappable 2 - assembly-wrappable 3 / field-wrappable 3 - - - - - - - assembly-by-key 1 / field-by-key 1 - assembly-by-key 1 / field-by-key 2 - assembly-by-key 1 / field-by-key 3 - - - - - assembly-by-key 1 / field-by-key 1 - assembly-by-key 1 / field-by-key 2 - assembly-by-key 1 / field-by-key 3 - - - - - assembly-by-key 1 / field-by-key 1 - assembly-by-key 1 / field-by-key 2 - assembly-by-key 1 / field-by-key 3 - - - - - - - nested FIELD-1-ONLY - - - - - diff --git a/toolchains/xslt-M4/testing/models-testdata.json b/toolchains/xslt-M4/testing/models-testdata.json deleted file mode 100644 index 75b88ad42..000000000 --- a/toolchains/xslt-M4/testing/models-testdata.json +++ /dev/null @@ -1,101 +0,0 @@ - - { "EVERYTHING" : - { "field-1only" : - { "STRVALUE" : "FIELD-1-ONLY" }, - "field-base64" : "1234abcd", - "field-boolean" : true, - "field-named-value" : - { "id" : "fnv1", - "CUSTOM-VALUE-KEY" : "FIELD-NAMED-VALUE" }, - "markup-line" : "Here's some *markup*: make of it **what you will**! Even if it has ... \\* funky characters \\` ... and even an ![some picture](img.jpg)", - "groupable-simple-fields" : - [ - { "integer-flag" : "1", - "STRVALUE" : "field-groupable 1" }, - - { "simple-flag" : "a", - "STRVALUE" : "field-groupable 2" }, - - { "integer-flag" : "3", - "STRVALUE" : "field-groupable 3" } ], - "wrapped-fields" : - [ "field-wrappable 1", - "field-wrappable 2", - "field-wrappable 3" ], - "keyed-fields" : - { "fbk1" : "field-by-key 1", - "fbk2" : "field-by-key 2", - "fbk3" : "field-by-key 3" }, - "dynamic-value-key-fields" : - [ - { "fdvk1" : "field-dynamic-value-key 1" }, - - { "fdvk2" : "field-dynamic-value-key 2" }, - - { "fdvk3" : "field-dynamic-value-key 3" } ], - "wrapped-prose" : "\n# Wrapped up prose\n\nThis is prose. All wrapped up.", - "loose-prose" : "\n# Unwrapped prose\n\nHere we have unwrapped prose....", - "ASSEMBLY-1ONLY" : - { "field-1only" : - { "STRVALUE" : "ASSEMBLY-1-ONLY / FIELD-1-ONLY" } }, - "groupable-assemblies" : - [ - { "groupable-simple-fields" : - [ - { "STRVALUE" : "assembly-groupable 1 / field-groupable 1" }, - - { "STRVALUE" : "assembly-groupable 1 / field-groupable 2" }, - - { "STRVALUE" : "assembly-groupable 1 / field-groupable 3" } ] }, - - { "groupable-simple-fields" : - [ - { "STRVALUE" : "assembly-groupable 2 / field-groupable 1" }, - - { "STRVALUE" : "assembly-groupable 2 / field-groupable 2" }, - - { "STRVALUE" : "assembly-groupable 2 / field-groupable 3" } ] }, - - { "groupable-simple-fields" : - [ - { "STRVALUE" : "assembly-groupable 3 / field-groupable 1" }, - - { "STRVALUE" : "assembly-groupable 3 / field-groupable 2" }, - - { "STRVALUE" : "assembly-groupable 3 / field-groupable 3" } ] } ], - "wrapped-assemblies" : - [ - { "wrapped-fields" : - [ "assembly-wrappable 1 / field-wrappable 1", - "assembly-wrappable 1 / field-wrappable 2", - "assembly-wrappable 1 / field-wrappable 3" ] }, - - { "wrapped-fields" : - [ "assembly-wrappable 2 / field-wrappable 1", - "assembly-wrappable 2 / field-wrappable 2", - "assembly-wrappable 2 / field-wrappable 3" ] }, - - { "wrapped-fields" : - [ "assembly-wrappable 3 / field-wrappable 1", - "assembly-wrappable 3 / field-wrappable 2", - "assembly-wrappable 3 / field-wrappable 3" ] } ], - "keyed-assemblies" : - { "abk1" : - { "keyed-fields" : - { "abk1.fbk1" : "assembly-by-key 1 / field-by-key 1", - "abk1.fbk2" : "assembly-by-key 1 / field-by-key 2", - "abk1.fbk3" : "assembly-by-key 1 / field-by-key 3" } }, - "abk2" : - { "keyed-fields" : - { "abk2.fbk1" : "assembly-by-key 1 / field-by-key 1", - "abk2.fbk2" : "assembly-by-key 1 / field-by-key 2", - "abk2.fbk3" : "assembly-by-key 1 / field-by-key 3" } }, - "abk3" : - { "keyed-fields" : - { "abk3.fbk1" : "assembly-by-key 1 / field-by-key 1", - "abk3.fbk2" : "assembly-by-key 1 / field-by-key 2", - "abk3.fbk3" : "assembly-by-key 1 / field-by-key 3" } } }, - "everything-recursive" : - [ - { "field-1only" : - { "STRVALUE" : "nested FIELD-1-ONLY" } } ] } } \ No newline at end of file diff --git a/toolchains/xslt-M4/testing/models_metaschema.xml b/toolchains/xslt-M4/testing/models_metaschema.xml index 928aff415..7ed56698b 100644 --- a/toolchains/xslt-M4/testing/models_metaschema.xml +++ b/toolchains/xslt-M4/testing/models_metaschema.xml @@ -1,5 +1,5 @@ - + - - - - - - - - - - - - The content model is the same as blockElementType, but line endings need - to be preserved, since this is preformatted. - - - - - - - - - The content model is the same as blockElementType, but line endings need - to be preserved, since this is preformatted. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - An insert can be used to identify a placeholder for dynamically inserting text related to a specific object, which is referenced by the object's identifier using an id-ref. This insert mechanism allows the selection of which text value from the object to dynamically include based on the application's display requirements. - - - - The type of object to include from (e.g., parameter, control, component, role, etc.) - - - - - The identity of the object to insert a value for. The identity will be selected from the index of objects of the specified type. The specific value to include is based on the application's display requirements, which will likely use a specific data element associated with the type (e.g., title, identifier, value, etc.) that is appropriate for the application. - - - - - - - - A string, but not empty and not whitespace-only (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) - - - - - - A trimmed string, at least one character with no leading or trailing whitespace. - - - - - diff --git a/toolchains/xslt-M4/testing/testdata-supermodel.xml b/toolchains/xslt-M4/testing/testdata-supermodel.xml deleted file mode 100644 index 4bb9bd933..000000000 --- a/toolchains/xslt-M4/testing/testdata-supermodel.xml +++ /dev/null @@ -1,1538 +0,0 @@ - - - FIELD-1-ONLY - - - overloaded field type! - - - the same overloaded field type by a different name - - - 1234abcd - - - true - - - fnv1 - FIELD-NAMED-VALUE - - - Here's some markup: make of it what you will! Even if it has ... * funky characters ` ... and even an some picture - - - - - 1 - field-groupable 1 - - - a - field-groupable 2 - - - 3 - field-groupable 3 - - - - - field-wrappable 1 - - - field-wrappable 2 - - - field-wrappable 3 - - - - - fbk1 - field-by-key 1 - - - fbk2 - field-by-key 2 - - - fbk3 - field-by-key 3 - - - - - fdvk1 - field-dynamic-value-key 1 - - - fdvk2 - field-dynamic-value-key 2 - - - fdvk3 - field-dynamic-value-key 3 - - - - -

Wrapped up prose

-

This is prose. All wrapped up. -

-
-
- - 123 - - - - 456 - - - 789 - - - abc - - - - - - field - - - - - - - - assembly-groupable 1 / field-groupable 1 - - - assembly-groupable 1 / field-groupable 2 - - - assembly-groupable 1 / field-groupable 3 - - - - - - - assembly-groupable 2 / field-groupable 1 - - - assembly-groupable 2 / field-groupable 2 - - - assembly-groupable 2 / field-groupable 3 - - - - - - - assembly-groupable 3 / field-groupable 1 - - - assembly-groupable 3 / field-groupable 2 - - - assembly-groupable 3 / field-groupable 3 - - - - - - - - - assembly-wrappable 1 / field-wrappable 1 - - - assembly-wrappable 1 / field-wrappable 2 - - - assembly-wrappable 1 / field-wrappable 3 - - - - - - - assembly-wrappable 2 / field-wrappable 1 - - - assembly-wrappable 2 / field-wrappable 2 - - - assembly-wrappable 2 / field-wrappable 3 - - - - - - - assembly-wrappable 3 / field-wrappable 1 - - - assembly-wrappable 3 / field-wrappable 2 - - - assembly-wrappable 3 / field-wrappable 3 - - - - - - - abk1 - - - abk1.fbk1 - assembly-by-key 1 / field-by-key 1 - - - abk1.fbk2 - assembly-by-key 1 / field-by-key 2 - - - abk1.fbk3 - assembly-by-key 1 / field-by-key 3 - - - - - abk2 - - - abk2.fbk1 - assembly-by-key 1 / field-by-key 1 - - - abk2.fbk2 - assembly-by-key 1 / field-by-key 2 - - - abk2.fbk3 - assembly-by-key 1 / field-by-key 3 - - - - - abk3 - - - abk3.fbk1 - assembly-by-key 1 / field-by-key 1 - - - abk3.fbk2 - assembly-by-key 1 / field-by-key 2 - - - abk3.fbk3 - assembly-by-key 1 / field-by-key 3 - - - - -
diff --git a/toolchains/xslt-M4/util/xml-as-json-object.xsl b/toolchains/xslt-M4/util/xml-as-json-object.xsl index f1baefdd7..ffc1fb38d 100644 --- a/toolchains/xslt-M4/util/xml-as-json-object.xsl +++ b/toolchains/xslt-M4/util/xml-as-json-object.xsl @@ -21,6 +21,7 @@ +
@@ -28,32 +29,61 @@
- + - - - - - - + + + + + + + + - + + + + + + { . } + + + + + + { . } + + + + + + { local-name() } + + + + { local-name(.) } + + { name(.) } + + + { namespace-uri(.) } + + + + + + - - - - - - + diff --git a/toolchains/xslt-M4/validate/metaschema-composition-check.sch b/toolchains/xslt-M4/validate/metaschema-composition-check.sch index a116a96d1..77b15e46f 100644 --- a/toolchains/xslt-M4/validate/metaschema-composition-check.sch +++ b/toolchains/xslt-M4/validate/metaschema-composition-check.sch @@ -17,10 +17,10 @@ - + - + @@ -65,8 +65,8 @@ + No appears named "" ... please check Ambiguous reference to '' found in . The reference resolved to define- with the name '' in: . Is this due to a duplicated METASCHEMA/short-name in a module? - @@ -86,18 +86,7 @@ Name clash among sibling elements or attributes with XML name ''. - - - + Duplicate name found for '' in: . Is this due to a duplicated METASCHEMA/short-name in a module? @@ -107,17 +96,6 @@ - @@ -148,20 +126,40 @@ --> Cannot group by key since the definition of '' has no json-key specified. Consider adding a json-key to the '' definition, or using a different 'in-json' setting. - + The definition of '' has a json-key specified. Consider using in-json="BY_KEY". + + + + + + + type is unknown. + Type name '' is deprecated: '' is preferred + + + + Update the datatype to '' + + + + + + + + - A flag declared as a value key must be required (@required='yes') + test="not((@name | @ref) = ../m:json-value-key-flag/@flag-ref) or @required = 'yes'">A flag declared as a value key must be required (@required='yes') A flag declared as a key must be required (@required='yes') + test="not((@name | @ref) = ../m:json-key-flag/@flag-ref) or @required = 'yes'">A flag declared as a key must be required (@required='yes') @@ -172,6 +170,8 @@ Only one field may be marked as 'markup-multiline' (without xml wrapping) within a model. An 'unwrapped' field must have a max occurrence of 1 Only 'markup-multiline' fields may be unwrapped in XML. SEEING '' + + @@ -180,15 +180,13 @@ - + - JSON key indicates no flag on this Should be (one of) + JSON key indicates no flag on this - @flag-ref should be (one of) - - as flag/ will be inoperative as the value will be given the field key -- no other flags are given - JSON value key may be set to a value or a flag's value, but not both. - flag '' not found for JSON value key + + flag '' not found for JSON value key @@ -237,10 +235,10 @@ - + ../compose/metaschema-resolve-use-names.xsl ../compose/metaschema-resolve-sibling-names.xsl ../compose/metaschema-digest.xsl + ../compose/annotate-composition.xsl diff --git a/toolchains/xslt-M4/validate/oscal-datatypes-check.xsl b/toolchains/xslt-M4/validate/oscal-datatypes-check.xsl index 609137610..98e8cde4e 100644 --- a/toolchains/xslt-M4/validate/oscal-datatypes-check.xsl +++ b/toolchains/xslt-M4/validate/oscal-datatypes-check.xsl @@ -1,121 +1,185 @@ - + + Base64Datatype + BooleanDatatype + DateDatatype + DateTimeDatatype + DateTimeWithTimezoneDatatype + DateWithTimezoneDatatype + DayTimeDurationDatatype + DecimalDatatype + EmailAddressDatatype + HostnameDatatype + IntegerDatatype + IPV4AddressDatatype + IPV6AddressDatatype + NonNegativeIntegerDatatype + PositiveIntegerDatatype + StringDatatype + TokenDatatype + URIDatatype + URIReferenceDatatype + UUIDDatatype + Base64Datatype + DateTimeDatatype + DateTimeWithTimezoneDatatype + EmailAddressDatatype + NonNegativeIntegerDatatype + PositiveIntegerDatatype + - - - string - string - NCName - { $nominal-type } - - + {$value} - - - - - - - - + + - - + + + + + - - + + + + + - - + + + + + - - + + + + + - - + + + + + - - + + + + + - - + + + + + - - + + + + + - - + + + + + - - + + + - - + + + + + - + - + - + - - + - + - + - + - + - + - + - + - + - + - + - + - - + + + + - + - + - + diff --git a/toolchains/xslt-M4/validate/produce-datatype-validation-functions.xsl b/toolchains/xslt-M4/validate/produce-datatype-validation-functions.xsl index d900e5e35..f338ea947 100644 --- a/toolchains/xslt-M4/validate/produce-datatype-validation-functions.xsl +++ b/toolchains/xslt-M4/validate/produce-datatype-validation-functions.xsl @@ -19,62 +19,81 @@ - + + + - + + + - + + + {$value} + name="{{($assigned-type,'StringDatatype')[1]}}" expand-text="true">{$value} + + + + + - + - - - - - + + true() - + - + + + + + + true() + + + + + + - + diff --git a/toolchains/xslt-M4/validate/readme.md b/toolchains/xslt-M4/validate/readme.md index 786a4341d..7bd4ea608 100644 --- a/toolchains/xslt-M4/validate/readme.md +++ b/toolchains/xslt-M4/validate/readme.md @@ -3,5 +3,4 @@ Miscellaneous resources supporting validation of Metaschema and related formats. Of particular interest: -- `metaschema.xsd` - The normative XSD defining Metaschema tagging - `metaschema-composition-check.sch` - some rules checking of a Metaschema module in reference to its composed rendition diff --git a/toolchains/xslt-M4/validate/xspec/instances/shadow-importing_metaschema.xml b/toolchains/xslt-M4/validate/xspec/instances/shadow-importing_metaschema.xml index fbb6b57d8..20b6d6cc9 100644 --- a/toolchains/xslt-M4/validate/xspec/instances/shadow-importing_metaschema.xml +++ b/toolchains/xslt-M4/validate/xspec/instances/shadow-importing_metaschema.xml @@ -26,7 +26,7 @@ Boo field Field of boo - +