[x3d-public] x3d.py Re: Tree-to-tree transformation

John Carlson yottzumm at gmail.com
Wed Aug 2 14:02:52 PDT 2023


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.

I don’t known what happens when you separate the object model from the
encoding model, but I would suspect one would validate both.

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.

John

On Wed, Aug 2, 2023 at 3:50 PM Joe D Williams <joedwil at earthlink.net> wrote:

> > One follows X3DUOM and the other doesn’t
>
>
>
> then only one can validate at load time?
>
>
>
> -----Original Message-----
> From: John Carlson <yottzumm at gmail.com>
> Sent: Aug 2, 2023 12:25 PM
> To: Peitso, Loren (CIV) <lepeitso at nps.edu>, X3D Graphics public mailing
> list <x3d-public at web3d.org>
> Subject: Re: [x3d-public] x3d.py Re: Tree-to-tree transformation
>
>
> For example, compare the hand-coded design of x3djsonld.py:
>
>
> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3djsonld.py
>
> to the possibly synthesized from X3DUOM design:
>
>
> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3dinput.py
>
> 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.
>
> 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!
>
> 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.
>
> John
>
> On Wed, Aug 2, 2023 at 1:59 PM John Carlson <yottzumm at gmail.com> wrote:
>
>> I am thinking about X3d.py design.
>>
>> I was not aware if x3d.py had any input, clarification?
>>
>> I’m trying to read this:
>>
>> https://www.web3d.org/x3d/stylesheets/python/python.html
>>
>> 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.
>>
>> I would propose stylesheets for each encoding,  just like we have for
>> converting XML to various encodings, X3dTo….xslt.
>>
>> What’s the counter argument?
>>
>> I welcome any discussion, this is kind of the monolithic kernel versus
>> microkernel idea i realize.  Monolithic won.
>>
>> This is also along the lines of HTMLElement, SVGElement, Node, and
>> Element in ECMAScript.
>>
>> 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.
>>
>> Is this somehow un-pythonic?
>>
>> John
>>
>> On Wed, Aug 2, 2023 at 1:21 PM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> 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?
>>>
>>> John
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230802/3716baea/attachment.html>


More information about the x3d-public mailing list