[x3d-public] X3DJSAIL/X3DJSONLD. Next steps. JSON as a source encoding. Consider X3DJSSAIL?

John Carlson yottzumm at gmail.com
Mon Jan 15 15:54:48 PST 2018


On Jan 15, 2018 4:24 PM, "Don Brutzman" <brutzman at nps.edu> wrote:

On 1/15/2018 6:03 AM, John Carlson wrote:

> Don, I'd like to start adding JSON as a source file encoding to produce
> XML and Python as well as JavaScript in X3DJSAIL.   I know this is a big
> step for you, but it's a small step for me.   I believe I will need a
> -fromJSON command line argument and a -toPython argument added to Command
> line.  We will need someway to serialize JSON to XML through a Java port of
> X3DJSONLD,  to get to XML from JSON.   Unless you want to use X3DJSONLD's
> DOMserializer in JavaScript.
>

John, thanks for this thoughtful planning.

Am thinking that we get the most benefit by having complementary capable
codebases.  This ecosystem encourages programmers to use code in their
native environment (JavaScript, Java, whatever).

Co-development also lets us test correctness, and lean on (i.e. reuse) each
other's code wherever possible.  Am happy to continue exploring Nashorn jjs
use of Java JavaScript and how to improve it.  Having powerful node.js
types of capabilities natively available within Java is pretty amazing.

Am happy to work on -fromJSON invocation of your code drop from within
X3DJSAIL.  Tell me how to invoke it from Java, and then adding the
CommandLine switch is simple.


First I have to develop the capability in Java.   I think I need to
integrate with Java DOM to translate to your XML.  This is easiest done by
porting X3DJSONLD.js to Java I think.  We already have the JavaScript code
in the code base.


So your conversion ideas all fit together within the table showing what is
needed most, X3DJSAIL support for various encodings and programming
languages:

        X3DJSAIL Conversions Support
        http://www.web3d.org/specifications/java/X3dJavaSceneAuthori
ngInterface.html#Conversions

Am also happy to add a -toPython capability, if you indeed have some kind
of draft X3D Python language binding.  The path to that is probably
a. Document the suggested syntax you've shared in some examples,
b. Get it runnable so that we can test correctness,
c. We write an X3dToPython.xslt stylesheet to allow testing of all other
.x3d examples,
d. Showing X3DJSONLD support,
e. Then get export from within X3DJSAIL, either by invoking your code or
writing a third serializer (it already can generate XML and [Classic]VRML
encodings)


The syntax is limited by PyJNIus right now.   There are plenty of runnable
examples in https://github.com/coderextreme/pythonSAI . If you have a
problem running the programs, we should discuss.  And I should improve my
instructions.


Interestingly we talked about these exact paths for success yesterday
during the C++/C#/C SAI Binding implementation talks by Myeong Won Lee and
Roy Walmsley during yesterdays Korea Chapter session.

        Web3D Korea Chapter, Mixed Augmented Reality (MAR) Meetings Seoul
2018
        http://www.web3d.org/event/web3d-korea-chapter-mixed-augment
ed-reality-mar-meetings-seoul-2018

But then we would have dual -toX3d arguments, and your XML is prettier than
> mine.
>

X3DJSAIL support strives to meet X3D Canonicalization (C14N) upon
serialization, and is pretty close.  So X3DJSAIL has that regardless of
import path.

        X3D Canonicalization (C14N) .xml format
        http://www.web3d.org/documents/specifications/19776-3/V3.3/
Part03/concepts.html#X3DCanonicalForm

We also have a Java application for that.

        X3D Canonicalizer
        https://svn.code.sf.net/p/x3d/code/www.web3d.org/x3d/tools/c
anonical/doc/x3dTools.htm

Anyway we can continue tweaking both of our XML outputs to meet X3D C14N
requirements.  In addition to helpfulness for simple diff-ing, it is also a
prerequisite for XML Security of digital signature and encryption.


I am not tweaking mine as mine is a direct DOM to XML dump.   But we could
talk to the JS xmldom folks.


(Also need to clean up X3DJSAIL's VRML serialization, the whitespace output
is pretty ragged.)

So perhaps a port of X3DJSONLD to Java is indicated.   Would this be easier
> to spread across the classes, or would we use DOM code and import the DOM
> into the concrete classes?   The latter may be simpler, as that's how
> X3DJSONLD is currently structured.   I'm thinking we should have DOM
> feeding the concrete classes for many things.
>

OK... but maybe we can think even more strategically for broader X3D impact
in many directions...

Might we refactor X3DJSONLD as an X3D JavaScript Scene Access Interface
Library (X3DJSSAIL)?


Not really.   It's pretty much a conversion library, and GUI and doesn't do
SAI at all.  We would have to add all the SAI stuff.   I think we can
pursue converting X3DJSAIL to JS as has been done partially before.   We
might think about how the X3DJSAIL stylesheet might support multiple
languages, perhaps by incorporating another XML namespace.   Or looking
into i18n for stylesheets.


Even broader co-development might occur.  Seems like you have many/most of
the challenging parts already accomplished. We then encourage MWL and Roy
to think about how their library might similar grow towards becoming
X3DCSAIL (or somesuch).  A future Python-native library might be X3DPSAIL,
etc. etc.

Also discussed yesterday: a key design benefit is that we don't have to
think about native rendering, and can let the various X3D players worry
about that for us.  Instead


I would like to see if EAI is possible relatively soon and perhaps
incorporate through an http connection from X3DOM and X_ITE.  Thus a web
page would make a request, and EAI would be provided in the response. We
could possibly set up a socket.io connection for this.   I'd like to see if
we can get Leonard or Andreas interested in this project.

these

can be plain old object libraries that allow reading/creating/writing X3D
models in various flavors.  Supports application integration, offline
server-side processing, data-drive Big Data workflows, etc. etc.

More and more interesting possibilities are certainly emerging.

Have fun with X3D programming!  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180115/f33be5a8/attachment-0001.html>


More information about the x3d-public mailing list