<div dir="auto">In current scenario, one can confirm that inout JSON parses.  I’ve not confirmed against JSON schema yet, but I have python code that does that.  Then one can validate the python program generated and any validation that x3d.py provides.  I’ve not used it yet.</div><div dir="auto"><br></div><div dir="auto">I don’t known what happens when you separate the object model from the encoding model, but I would suspect one would validate both.</div><div dir="auto"><br></div><div dir="auto">I’ve not had a lot of complete success with validating JSON input to X3DJSAIL using X3DJSONLD, but I’m using files generated from X3DJSAIL.  As far as I know, those files pass JSON Schema.  I have not tried validation of the output files in X3D-Edit, but that would be interesting.</div><div dir="auto"><br></div><div dir="auto">John </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 2, 2023 at 3:50 PM Joe D Williams <<a href="mailto:joedwil@earthlink.net">joedwil@earthlink.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12pt"><p style="margin:0.1rem 0;line-height:1.0"><span style="color:#000000;font-family:'Times New Roman';font-size:medium;white-space:normal;float:none;display:inline">> One follows X3DUOM and the other doesn’t</span></p>
<p style="margin:0.1rem 0;line-height:1.0"> </p>
<p style="margin:0.1rem 0;line-height:1.0"><span style="color:#000000;font-family:'Times New Roman';font-size:medium;white-space:normal;float:none;display:inline">then only one can validate at load time?</span></p>
<p style="margin:0.1rem 0;line-height:1.0"> </p>
</div>
<div style="border-left:1px solid #aaa;box-sizing:border-box;padding:10px 0 10px 15px;margin:0">
<p>-----Original Message-----<br>From: John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>><br>Sent: Aug 2, 2023 12:25 PM<br>To: Peitso, Loren (CIV) <<a href="mailto:lepeitso@nps.edu" target="_blank">lepeitso@nps.edu</a>>, X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>Subject: Re: [x3d-public] x3d.py Re: Tree-to-tree transformation</p>
<p style="margin:0.1rem 0;line-height:1.0"> </p>
<div dir="auto">For example, compare the hand-coded design of x3djsonld.py:</div>
<div dir="auto"><br>
<div dir="auto"><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3djsonld.py" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3djsonld.py</a></div>
<div dir="auto"> </div>
<div dir="auto">to the possibly synthesized from X3DUOM design:</div>
<div dir="auto"> </div>
<div dir="auto">
<div><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3dinput.py" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3dinput.py</a></div>
<div dir="auto"> </div>
<div dir="auto">I know we chose the former initially, but I’m preferring program synthesis from X3DUOM at this point to very difficult hand coding to produce python which is not even based on X3DUOM!  I realize that program synthesis will be of equal or greater complexity.</div>
<div dir="auto"> </div>
<div dir="auto">So, I’m going to proceed with yet another program synthesis project in Python.  I know it will probably be a mess!  Jeff H. is welcome to join me!   There are many examples to draw from, including previous Python library generators for X3D!</div>
<div dir="auto"> </div>
<div dir="auto">It’s probably up in the air as to which one is better.  They probably both are equivalently difficult to program and maintain.   One follows X3DUOM and the other doesn’t.</div>
<div dir="auto"> </div>
<div dir="auto">John </div>
</div>
</div></div><div style="border-left:1px solid #aaa;box-sizing:border-box;padding:10px 0 10px 15px;margin:0">
<div><br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Wed, Aug 2, 2023 at 1:59 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:#cccccc">
<div dir="auto">I am thinking about X3d.py design.</div>
<div dir="auto"> </div>
<div dir="auto">I was not aware if x3d.py had any input, clarification?</div>
<div dir="auto"> </div>
<div dir="auto">I’m trying to read this:</div>
<div dir="auto"> </div>
<div dir="auto">
<div><a href="https://www.web3d.org/x3d/stylesheets/python/python.html" rel="noopener" target="_blank">https://www.web3d.org/x3d/stylesheets/python/python.html</a></div>
</div>
<div dir="auto"> </div>
<div dir="auto">It would seem appropriate to have a core X3D abstract python model, call it the python object model or POM, and then add what i call python “view,” “presentation,” or “encoding” models for XML, JSON, X3DOM, VRML, and X_ITE …input/output, perhaps generated by more than one stylesheet.  I think stuffing the encodings into one package is not the right design.  We should follow the standards way of separating abstract architecture from encoding and binding.</div>
<div dir="auto"> </div>
<div dir="auto">I would propose stylesheets for each encoding,  just like we have for converting XML to various encodings, X3dTo….xslt.</div>
<div dir="auto"> </div>
<div dir="auto">What’s the counter argument?</div>
<div dir="auto"> </div>
<div dir="auto">I welcome any discussion, this is kind of the monolithic kernel versus microkernel idea i realize.  Monolithic won.</div>
<div dir="auto"> </div>
<div dir="auto">This is also along the lines of HTMLElement, SVGElement, Node, and Element in ECMAScript.</div>
<div dir="auto"> </div>
<div dir="auto">You can still stuff it all in the same x3d.py file, one can also support XML(), VRML() methods on the abstract model that defer or delegate to encoding models.  I don’t think anything breaks.</div>
<div dir="auto"> </div>
<div dir="auto">Is this somehow un-pythonic?</div>
<div dir="auto"> </div>
<div dir="auto">John </div>
<div><br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Wed, Aug 2, 2023 at 1:21 PM John Carlson <<a href="mailto:yottzumm@gmail.com" rel="noopener" target="_blank">yottzumm@gmail.com</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:#cccccc">Does anyone know good tools for tree-to-tree transformation?  I know ANTLR and XML/XSL/XSLT.  I guess this is pretty much a compiler task.  Are there tools for Classic VRML and JSON?  Python/Perl/ECMAScrpt?
<div dir="auto"> </div>
<div dir="auto">John</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>

<p style="margin:0.1rem 0;line-height:1.0"> </p></blockquote></div></div>