[x3d-public] Fwd: updates to X3D Schema, X3DUOM: refactored names of enumeration lists

John Carlson yottzumm at gmail.com
Mon Oct 22 15:05:14 PDT 2018


Well someone suggested using oneOf, so I will try again.   They also
suggested using a regular expression to validate (with |.* I assume).

I will have to do some searching on how optional values are specified.

---------- Forwarded message ---------
From: John Carlson <yottzumm at gmail.com>
Date: Mon, Oct 22, 2018 at 12:24 PM
Subject: Re: [x3d-public] updates to X3D Schema, X3DUOM: refactored names
of enumeration lists
To: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>


If I recall right, the main change to the JSON schema generator may be
optional Values.

On Mon, Oct 22, 2018 at 11:48 AM Brutzman, Donald (Don) (CIV) <
brutzman at nps.edu> wrote:

> Summary: improved support for lists of required/optional enumeration
> values in X3D Schema, X3DUOM, etc.
>
>
> ------------------------------------------------------------------------------------
> 1. Background.
>
> Wikipedia: Enumerated type
> https://en.wikipedia.org/wiki/Enumerated_type
> "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."
>
> 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..
>
> For an example node, here is the FontStyle specification excerpted:
> ===================================================================
>
> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/text.html#FontStyle
> 15.4.1 FontStyle
>
> FontStyle : X3DFontStyleNode {
>    MFString []       family      "SERIF"
>    SFString []       language    ""
>    MFString []       justify     "BEGIN"
> ["BEGIN","END","FIRST","MIDDLE",""]
>    SFString []       style       "PLAIN"
> ["PLAIN"|"BOLD"|"ITALIC"|"BOLDITALIC"|""]
>   [...snip...]
> }
> ===================================================================
>
> 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.
>
> This was hard to keep track of in X3DUOM.  It now has been addressed and
> support has been provided in two ways:
> a. (v4.0) Refactor renaming of simpleType naming conventions in order to
> support X3DUOM design patterns:
>      enumeration Choices (strict sets of string tokens) and
>      optional Values (allowed, extendable string tokens).
> b. X3DUOM now includes boolean attribute
> additionalEnumerationValuesAllowed in all SF/MFString fields that refer to
> such lists.
>
>
> ------------------------------------------------------------------------------------
>
> 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.
>
> Source schema and derived X3DUOM:
> http://www.web3d.org/specifications/x3d-4.0.xsd
> http://www.web3d.org/specifications/X3DUnifiedObjectModel-4.0.xml
> http://www.web3d.org/specifications/X3DUnifiedObjectModel-4.0.json
>
> Examples from X3D 4.0 XML Schema documentation:
> FontStyle
> http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_FontStyle.html
> fontFamilyValues
> http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_fontFamilyValues.html
> justifyChoices
> http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_justifyChoices.html
> fontStyleChoices
> http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_fontStyleChoices.html
>
> Examples from X3DJSAIL documentation:
>
> http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Text/FontStyleObject.html
>
> http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Text/FontStyleObject.html#field.summary
>
> 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.
>
>
> ------------------------------------------------------------------------------------
> 3. These have only been applied to X3D v4.0 schema/X3DUOM in order to
> allow inspection and comment.
>
> TODO will apply to v3.0-v3.3 schemas following review.  This has no direct
> impact on any existing X3D scene content.
>
> All feedback welcome.  Have fun with X3D Unified Object Model (X3DUOM)!
>  8)
>
> all the best, Don
> --
> Don Brutzman  Naval Postgraduate School, Code USW/Br
> brutzman at nps.edu
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
> X3D graphics, virtual worlds, navy robotics
> http://faculty.nps.edu/brutzman
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20181022/60381530/attachment.html>


More information about the x3d-public mailing list