From dab89fb9ef39d76d31fe549bf18297fbe878436f Mon Sep 17 00:00:00 2001 From: Wendell Piez Date: Mon, 8 Jul 2019 14:06:47 -0400 Subject: [PATCH] More work on datatyping #436 including now in JSON Schema --- build/metaschema/json/json-schema-metamap.xsl | 85 +++++++++++++++++-- build/metaschema/lib/metaschema.xsd | 11 ++- build/metaschema/xml/oscal-datatypes.xsd | 15 ++-- build/metaschema/xml/produce-xsd.xsl | 71 +++++++++++----- 4 files changed, 143 insertions(+), 39 deletions(-) diff --git a/build/metaschema/json/json-schema-metamap.xsl b/build/metaschema/json/json-schema-metamap.xsl index 12056b55ff..a42988bdc9 100644 --- a/build/metaschema/json/json-schema-metamap.xsl +++ b/build/metaschema/json/json-schema-metamap.xsl @@ -329,7 +329,7 @@ object - + string @@ -341,7 +341,9 @@ - string + + string + @@ -351,20 +353,89 @@ integer + 1.0 + + + + integer + 1.0 + 1 + + + + integer + 1.0 + 0 - + + + decimal + float double - percent - - + + number + + + - + + + + + + string + date + + .+[:Z].* + + + string + date-time + + .+T.+(Z|[+-].+) + + + string + email + + .+@.+ + + + string + ipv4 + + ((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]) + + + 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])) + + + string + idn-hostname + + .+ + + + string + uri + + + + string + uri-reference + + + diff --git a/build/metaschema/lib/metaschema.xsd b/build/metaschema/lib/metaschema.xsd index b0dea23435..ad8d8fe082 100644 --- a/build/metaschema/lib/metaschema.xsd +++ b/build/metaschema/lib/metaschema.xsd @@ -398,20 +398,24 @@ + + - + + - - + + + @@ -420,6 +424,7 @@ + diff --git a/build/metaschema/xml/oscal-datatypes.xsd b/build/metaschema/xml/oscal-datatypes.xsd index cac3615420..40f70f7f16 100644 --- a/build/metaschema/xml/oscal-datatypes.xsd +++ b/build/metaschema/xml/oscal-datatypes.xsd @@ -45,16 +45,6 @@ - - - The percent type specifies a percentage from 0 to 100. - - - - - - - @@ -89,6 +79,11 @@ + + + Requires a scheme with colon per RFC 3986 + + diff --git a/build/metaschema/xml/produce-xsd.xsl b/build/metaschema/xml/produce-xsd.xsl index 0be763eff5..a4fa497cc4 100644 --- a/build/metaschema/xml/produce-xsd.xsl +++ b/build/metaschema/xml/produce-xsd.xsl @@ -100,9 +100,14 @@ + + + + + @@ -122,26 +127,48 @@ + + + + + + + + + - - true - - - - - - - + + + + + + + + + + + + + + + + + + + - - + + + + + @@ -210,8 +237,6 @@ - - @@ -223,12 +248,9 @@ - - - - - - + + + @@ -237,6 +259,17 @@ + + + + + + + + + +