[x3d-public] Discussions of JSON schema: ProtoInstance USE without name

Don Brutzman brutzman at nps.edu
Sun Dec 6 10:03:33 PST 2020


John I recommend that you keep things simple, and maintain a list of design issues with the JSON schema.

Especially helpful to keep issues from ballooning prematurely.  If in doubt, don't.  XML continues to give us good patterns, we've solved what representations are needed already, next burden will be on schema to best validate those patterns, we get better with each iteration.

No doubt JSON schema can do at least as well as XML Schema, which allows both USE and name field to coexist even though they shouldn't.

p.s. a great Beginner Book that my granddaughter and I enjoy is "Big Dog... Little Dog" by P.D. Eastman. While staying in "Nearby Hotel" Ted and Fred get in the wrong beds, big dog little bed, little dog big bed.  Very uncomfortable.  Little Bird suggests switching beds, off they run back to sleep, and things are much better.  Little Bird gets last word, "why make big problems out of little problems?" Good question indeed.  8)

Likely irrelevant for topics like JSON subschema inheritance-pattern file-distribution anti-redundancy rationalizations (cough cough) but still fun and always good advice.  As ever, thanks for your efforts.


On 12/6/2020 7:19 AM, John Carlson wrote:
> 
> What I am concerned with about @USE and @name is that I perhaps am adding yet another subschema for each node with @name field schema.  That means adding around 50% more subschemas.   Additional schemas means slower processing etc. I might prefer to go back to the original style, where all fields are in the same subschema.  It certainly was easier for the user, albeit incorrect.  We would be no worse off than XML schema, and we still have the opportunity to start with XML so we can go through the schematron.  Discussions of possible JSON schematron or validating with X3DJSAIL or x3dpsail welcome (I'm not ready to discuss es6x3d right now).
> 
> 
> John
> 
> On Sun, Dec 6, 2020 at 9:05 AM John Carlson <yottzumm at gmail.com <mailto:yottzumm at gmail.com>> wrote:
> 
>     Please provide test cases.  I think we will have these 3 subschemas (choose one):
> 
>     @USE required, (no other fields allowed)
>     @name required && @USE required (no other fields allowed)
>     @name required @USE not allowed (other fields allowed)
>     Other options not allowed (must have @USE or @name).  Generally, we will match just one of the subschemas. @containerField is not in JSON.
> 
>     Does this apply for ProtoInstance and all other nodes with @name field, or just ProtoInstance?
> 
>     Let's work through this logically.
> 
>     I'm assuming at some point you will be creating a stylesheet for generating schema, or perhaps preferably, validation code.
> 
>     I think I'm going to wait for draft 8 until Ajv catches up, ns.  I think Ajv 7 may still be in beta.  There's a promising JavaScript validator that might be used instead, but it looks like it may require major changes to code, ns.
> 
>     Thanks,
> 
>     John
> 
>     On Sat, Dec 5, 2020 at 9:56 PM Don Brutzman <brutzman at nps.edu <mailto:brutzman at nps.edu>> wrote:
> 
>         On 12/5/2020 4:00 PM, John Carlson wrote:
>          >
>          > If anyone is using the generated X3D Schema (4.0), let me know.
> 
>         Yes I certainly remain interested John but have a lot of other work on X3D4 that must get resolved first.
> 
>         In general, as we succeeded before, I expect that when we add JSON Schema draft 8 validation to the existing X3D JSON encoding, it will remain a nearly exact match with X3D XML encoding where node/field (element/attribute) data delimiters and some string escaping are the only differences.
> 
>         all the best, Don
>         -- 
>         Don Brutzman  Naval Postgraduate School, Code USW/Br brutzman at nps.edu <mailto: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 <http://faculty.nps.edu/brutzman>
> 

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



More information about the x3d-public mailing list