<div><div dir="auto">Well someone suggested using oneOf, so I will try again.   They also suggested using a regular expression to validate (with |.* I assume).</div></div><div dir="auto"><br></div><div dir="auto">I will have to do some searching on how optional values are specified.</div><div><br><div class="gmail_quote"><div dir="ltr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">John Carlson</strong> <span dir="ltr"><<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>></span><br>Date: Mon, Oct 22, 2018 at 12:24 PM<br>Subject: Re: [x3d-public] updates to X3D Schema, X3DUOM: refactored names of enumeration lists<br>To: Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>><br></div><br><br><div><div dir="auto">If I recall right, the main change to the JSON schema generator may be optional Values.</div></div><div><br><div class="gmail_quote"></div></div><div><div class="gmail_quote"><div dir="ltr">On Mon, Oct 22, 2018 at 11:48 AM Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Summary: improved support for lists of required/optional enumeration values in X3D Schema, X3DUOM, etc.<br>
<br>
------------------------------------------------------------------------------------<br>
1. Background.<br>
<br>
Wikipedia: Enumerated type<br>
<a href="https://en.wikipedia.org/wiki/Enumerated_type" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Enumerated_type</a><br>
"In computer programming, an enumerated type (also called enumeration, enum, or factor in the R programming language, and a categorical variable in statistics) is a data type consisting of a set of named values called elements, members, enumeral, or enumerators of the type."<br>
<br>
A long-standing challenge in X3DJSAIL implementation of X3D Unified Object Model (X3DUOM) has been enumeration lists of string tokens.  Sometimes values are strictly limited, other times they are extensible.  Since the X3D Architecture specification strives for complete clarity whenever defining them, it will be good to handle these as precisely as possible when validating or producing X3D content..<br>
<br>
For an example node, here is the FontStyle specification excerpted:<br>
===================================================================<br>
<a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/text.html#FontStyle" rel="noreferrer" target="_blank">http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/text.html#FontStyle</a><br>
15.4.1 FontStyle<br>
<br>
FontStyle : X3DFontStyleNode {<br>
   MFString []       family      "SERIF"<br>
   SFString []       language    ""<br>
   MFString []       justify     "BEGIN" ["BEGIN","END","FIRST","MIDDLE",""]<br>
   SFString []       style       "PLAIN" ["PLAIN"|"BOLD"|"ITALIC"|"BOLDITALIC"|""]<br>
  [...snip...]<br>
}<br>
===================================================================<br>
<br>
When you read the specification prose, it quickly becomes clear that 'family' and 'language' can be extended by end users to many font families, while 'justify' and 'style' are strictly restricted in what values are allowed.<br>
<br>
This was hard to keep track of in X3DUOM.  It now has been addressed and support has been provided in two ways:<br>
a. (v4.0) Refactor renaming of simpleType naming conventions in order to support X3DUOM design patterns:<br>
     enumeration Choices (strict sets of string tokens) and<br>
     optional Values (allowed, extendable string tokens).<br>
b. X3DUOM now includes boolean attribute additionalEnumerationValuesAllowed in all SF/MFString fields that refer to such lists.<br>
<br>
------------------------------------------------------------------------------------<br>
<br>
2. Applied a naming convention.  Primary change was simply regularizing the names of existing xs:simpleType definitions in the X3D XML Schema.  These are primarily internal so they might not be used by anything other than X3DJSAIL and X3DJSONLD.  These lists are not formally defined as such in the X3D Architecture, rather they just reflect the values provided there.<br>
<br>
Source schema and derived X3DUOM:<br>
<a href="http://www.web3d.org/specifications/x3d-4.0.xsd" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/x3d-4.0.xsd</a><br>
<a href="http://www.web3d.org/specifications/X3DUnifiedObjectModel-4.0.xml" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/X3DUnifiedObjectModel-4.0.xml</a><br>
<a href="http://www.web3d.org/specifications/X3DUnifiedObjectModel-4.0.json" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/X3DUnifiedObjectModel-4.0.json</a><br>
<br>
Examples from X3D 4.0 XML Schema documentation:<br>
FontStyle        <a href="http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_FontStyle.html" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_FontStyle.html</a><br>
fontFamilyValues <a href="http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_fontFamilyValues.html" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_fontFamilyValues.html</a><br>
justifyChoices   <a href="http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_justifyChoices.html" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_justifyChoices.html</a><br>
fontStyleChoices <a href="http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_fontStyleChoices.html" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_fontStyleChoices.html</a><br>
<br>
Examples from X3DJSAIL documentation:<br>
<a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Text/FontStyleObject.html" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Text/FontStyleObject.html</a><br>
<a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Text/FontStyleObject.html#field.summary" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Text/FontStyleObject.html#field.summary</a><br>
<br>
Current X3DJSAIL work includes stricter checking or warnings (as appropriate) when setting/adding/validating new values.  The improved naming conventions and X3DUOM additionalEnumerationValuesAllowed attributes permit such work to progress further.<br>
<br>
------------------------------------------------------------------------------------<br>
3. These have only been applied to X3D v4.0 schema/X3DUOM in order to allow inspection and comment.<br>
<br>
TODO will apply to v3.0-v3.3 schemas following review.  This has no direct impact on any existing X3D scene content.<br>
<br>
All feedback welcome.  Have fun with X3D Unified Object Model (X3DUOM)!   8)<br>
<br>
all the best, Don<br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149<br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzman</a><br>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div></div>
</div></div>