[x3d-public] X3D JSON Schema updated for axis++ defaults

John Carlson yottzumm at gmail.com
Tue Feb 15 21:59:16 PST 2022


TL;DR

Understood that you want to pursue a Java course.   Would running
JavaScript inside Java be acceptable?   Running against a 4000+ example
archive is a challenge, and below is my collected wisdom.

Python solutions for draft2020-12 are as slow as molasses.   I suggest we
step backwards to draft07 if we pursue a python solution.   Then we can use
the fastjsonschema package.

Ajv is a very fast solution and is my go to solution for JSON schema
validation.   It is my most common approach for validating the sourceforge
archive and Savage.   Ajv supports most of the draft JSON standards.   Ajv
solicits funds for support with my encouragement.  I am just a happy
customer!

Draft07 has the advantage of providing many, many implementations across a
variety of languages.   We will probably not see that much maturity for
many years for any potential upcoming standard.  I thought we had a good
Java solution with Everit and Draft07, but you were wary of it.

Thus, my solution for most people would be to allow them to validate one
JSON document at a time, probably with python or JavaScript at this point.
  I will continue to support the x3dschema and x3dvalidate projects for
projects with a lot of files, or even one-offs with x3dvalidate.

I am working to enhance the JSON schema client/server solution, but running
Ajv as is done currently on the browser will require running JavaScript
interpreter on the client.   If running something like CEF (headless
chrome) is acceptable, we can work on that.   But if you’re running Chrome,
why not Node.js/V8/Deno?   There are alternatives to npm.   With Deno,
security comes by default, and you know which websites you are downloading
modules from, pretty much like the web.  Npm is deprecated with Deno.
Deno also supports TypeScript natively.   These take many question marks
out of the equation for running TypeScript and JavaScript.

There’s commercial solutions with XMLSpy.   If XMLSpy provided production
validators for a license fee less than their editors, that would be greatly
appreciated.

I will monitor the jsonschemafriend Java project until it reaches a mature
solution for draft2020-12.

It seems like there’s room for a JSON schema to Java compiler in the mix.
I’m not sure why we haven’t seen this?

John

On Tue, Feb 15, 2022 at 10:27 PM Brutzman, Donald (Don) (CIV) <
brutzman at nps.edu> wrote:

> John, I can replace the schema in the official repository, but we still
> have a severe difficulty in that there is no build process to check it
> against X3D Examples scenes.  As ever, using Java latest and Ant build
> tasks will be the path to mainstreaming.  We have been blocked by that for
> several years, and JSON Schema is still in draft status.
>
>
>
> Don’t want to sound discouraging, seems like you are close, but these are
> the final hurdles to get past.
>
>
>
> Recent update found on json schema page indicates that they are still
> draft and still progressing.
>
>
>
>    - http://json-schema.org
>
>
>
> 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 https://
> faculty.nps.edu/brutzman
>
>
>
> *From:* John Carlson <yottzumm at gmail.com>
> *Sent:* Wednesday, February 9, 2022 10:43 PM
> *To:* Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; X3D Graphics
> public mailing list <x3d-public at web3d.org>
> *Subject:* Re: [x3d-public] X3D JSON Schema updated for axis++ defaults
>
>
>
> NPS WARNING: *external sender* verify before acting.
>
>
>
> See attached JSON schema to get #comment next to USE (practically
> everywhere in the schema).  Shortened versions of the schema welcome.  I'm
> not quite sure what to do.
>
>
>
> This adds about 3660 lines to the schema.
>
>
>
> If you can suggest a better JSON encoding or X3D JSON schema, that would
> be welcome at this point.
>
>
>
> On Thu, Feb 10, 2022 at 12:29 AM John Carlson <yottzumm at gmail.com> wrote:
>
> Please confirm that you want me to accept @USE with sibling -children
> fields, as shown in recently mentioned Trebuchet.json.
>
>
>
> See below snippet of X3D JSON schema, that I will add back in *many*
> places.  The code to be added is embolden.
>
>
>
> Thanks!
>
>
>
> John
>
>
>
> On Sat, Feb 5, 2022 at 9:06 AM Brutzman, Donald (Don) (CIV) <
> brutzman at nps.edu> wrote:
>
>
>
> 2. Saw a documentation problem:  USE nodes can’t indicate anything besides
> the @USE value (except for containerField value for relevant parent-child
> relationship in XML encoding).  So your following guidance about comments
> is not portable outside of JSON.
>
>     "RigidBody": {
>
>       "type": "object",
>
>       "oneOf": [
>
>         {
>
>           "type": "object",
>
>           "properties": {
>
>             "@class": {
>
>               "type": "string"
>
>             },
>
>             "@USE": {
>
>               "type": "string"
>
> *            },*
>
> *            "-children": {*
>
> *              "type": "array",*
>
> *              "minItems": 1,*
>
> *              "items": {*
>
> *                "type": "object",*
>
> *                "properties": {*
>
> *                  "#comment": {*
>
> *                    "type": "string",*
>
> *                    "$comment": "#comment statements are the only allowed
> in -children node when using a USE field"*
>
> *                  }*
>
> *                },*
>
> *                "additionalProperties": false*
>
>               }
>
>             }
>
>          },
>
>           "required": [
>
>             "@USE"
>
>           ],
>
>           "additionalProperties": false
>
>         },
>
>
>
>
>
>
>
> _______________________________________________
> 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/20220215/55776978/attachment-0001.html>


More information about the x3d-public mailing list