<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jan 15, 2018 4:24 PM, "Don Brutzman" <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 1/15/2018 6:03 AM, John Carlson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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. <br>
</blockquote>
<br>
John, thanks for this thoughtful planning.<br>
<br>
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).<br>
<br>
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.<br>
<br>
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.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
So your conversion ideas all fit together within the table showing what is needed most, X3DJSAIL support for various encodings and programming languages:<br>
<br>
        X3DJSAIL Conversions Support<br>
        <a href="http://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html#Conversions" rel="noreferrer" target="_blank">http://www.web3d.org/specifica<wbr>tions/java/X3dJavaSceneAuthori<wbr>ngInterface.html#Conversions</a><br>
<br>
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<br>
a. Document the suggested syntax you've shared in some examples,<br>
b. Get it runnable so that we can test correctness,<br>
c. We write an X3dToPython.xslt stylesheet to allow testing of all other .x3d examples,<br>
d. Showing X3DJSONLD support,<br>
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)<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">The syntax is limited by PyJNIus right now.   There are plenty of runnable examples in <a href="https://github.com/coderextreme/pythonSAI">https://github.com/coderextreme/pythonSAI</a> . If you have a problem running the programs, we should discuss.  And I should improve my instructions.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
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.<br>
<br>
        Web3D Korea Chapter, Mixed Augmented Reality (MAR) Meetings Seoul 2018<br>
        <a href="http://www.web3d.org/event/web3d-korea-chapter-mixed-augmented-reality-mar-meetings-seoul-2018" rel="noreferrer" target="_blank">http://www.web3d.org/event/web<wbr>3d-korea-chapter-mixed-augment<wbr>ed-reality-mar-meetings-seoul-<wbr>2018</a><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But then we would have dual -toX3d arguments, and your XML is prettier than mine.<br>
</blockquote>
<br>
X3DJSAIL support strives to meet X3D Canonicalization (C14N) upon serialization, and is pretty close.  So X3DJSAIL has that regardless of import path.<br>
<br>
        X3D Canonicalization (C14N) .xml format<br>
        <a href="http://www.web3d.org/documents/specifications/19776-3/V3.3/Part03/concepts.html#X3DCanonicalForm" rel="noreferrer" target="_blank">http://www.web3d.org/documents<wbr>/specifications/19776-3/V3.3/<wbr>Part03/concepts.html#<wbr>X3DCanonicalForm</a><br>
<br>
We also have a Java application for that.<br>
<br>
        X3D Canonicalizer<br>
        <a href="https://svn.code.sf.net/p/x3d/code/www.web3d.org/x3d/tools/canonical/doc/x3dTools.htm" rel="noreferrer" target="_blank">https://svn.code.sf.net/p/x3d/<wbr>code/www.web3d.org/x3d/tools/c<wbr>anonical/doc/x3dTools.htm</a><br>
<br>
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.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I am not tweaking mine as mine is a direct DOM to XML dump.   But we could talk to the JS xmldom folks.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
(Also need to clean up X3DJSAIL's VRML serialization, the whitespace output is pretty ragged.)<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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.<br>
</blockquote>
<br>
OK... but maybe we can think even more strategically for broader X3D impact in many directions...<br>
<br>
Might we refactor X3DJSONLD as an X3D JavaScript Scene Access Interface Library (X3DJSSAIL)?<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
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.<br>
<br>
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 </blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">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 <a href="http://socket.io">socket.io</a> connection for this.   I'd like to see if we can get Leonard or Andreas interested in this project.</div><div dir="auto"><br></div><div dir="auto">these</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> 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.<br>
<br>
More and more interesting possibilities are certainly emerging.<br>
<br>
Have fun with X3D programming!  8)<br>
<br>
all the best, Don<font color="#888888"><br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   <a href="tel:%2B1.831.656.2149" value="+18316562149" target="_blank">+1.831.656.2149</a><br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzma<wbr>n</a><br>
</font></blockquote></div><br></div></div></div>