[x3d-public] JAXB and X3DJSAIL

John Carlson yottzumm at gmail.com
Fri Apr 19 18:46:03 PDT 2019


Would anyone like to discuss the use of JAXB/Jackson/Moxy/resteasy to  externalize forms of X3D, like JSON and XML?  Specifically, would we like to use JAXB/Jackson/Moxy/resteasy to import/export JSON and XML from a JAXB’ized Java scenegraph—X3DJSAIL (requires annotations, I think)?  Can we implement other encodings with these frameworks?

https://stackoverflow.com/questions/38789307/how-to-serialize-jaxb-object-to-json-with-jaxb-reference-implementation.

Thanks,

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Friday, April 19, 2019 8:27 PM
To: Brutzman, Donald (Don) (CIV); X3D Graphics public mailing list
Cc: X3D Graphics Working Group
Subject: RE: [x3d] X3D agenda 19 APR 2019: tracking X3Dv4 implementationprogress

X3DJSONLD has been mostly in stasis since primary effort has been on X3DPSAIL.  I can offer an alternate XML (DOM) to JSON translation for the second implementation.   JavaScript version JSON -> DOM implemented in both X3DOM and X_ITE.  Need to run through a standards check with X3DOM and X_ITE.  C++ version of JSON -> DOM found in X3DJSONLD source code, but it’s not exactly clear where to find the implementation (somewhere under src/main/cpp).  C++ Code design currently only in a short running JSON -> XML conversion.  Looking for volunteers to work on the C++ version, choose appropriate JSON and XML libraries etc.  Java version found on sourceforge tree under x3d-code/www.web3d.org/x3d/stylesheets/java/src/net.

Other possible tasks: ProtoExpander written for/with XSLT/XML for maximum portability to XML/DOM implementation for X3DOM.

Need to compromise/implement similar JSON loading SAI interface between X3DOM, X_ITE, X3DJSAIL and other browsers.  All current versions translate to DOM from the JSON.  It may be desirable to implement JSON -> scenegraph or JSON -> SAI versions for performance reasons, but I am unfamiliar with the browser interfaces to the scenegraph.  Please discuss JSON import build on top of SAI, interesting subject.  Weigh alternatives between SAI and DOM for performance, validation, long term sustainability, standardization, etc.  Consider writing library to convert DOM to SAI—Done in X3DJSAIL?   Do we want JSON to SAI, but not DOM as an intermediary?  Maybe look at VRML implementations as an example?   Consider using a serializer to convert JSON to SAI.  ThreeSerializer.js may be a good place to start.  Also, DOM loader in X3DJSAIL.

X3DOM version JSON interface:

x3dom.Runtime.prototype.replaceWorld = function(scene) {
x3d_element = x3dom.Runtime.prototype.createX3DFromJS = function(jsobject, optionalURL) {
x3d_element = x3dom.Runtime.prototype.createX3DFromString = function(jsonOrXML, optionalURL) {
promise(x3d_element) = x3dom.Runtime.prototype.createX3DFromURLPromise = function(url, optionalURL) {
x3dom.Runtime.prototype.loadURL = function(url, optionalURL) {

X_ITE version JSON interface:

X3DBrowser.importJS(json_object)

X3DJSAIL JavaScript/Java JSON interface (X3DJSAIL has JSON a loader already!).

var X3DJSONLD = Java.type("net.coderextreme.X3DJSONLD")
var loader = new X3DJSONLD();
var jsobj = loader.readJsonFile(new File("./examples/Nashorn.json"));
var document = loader.loadJsonIntoDocument(jsobj);
var string = loader.serializeDOM(loader.getX3DVersion(jsobj), document);


See: x3d-code/www.web3d.org/x3d/stylesheets/java/nashorn/examples/Nashorn.js Must currently translate JSON -> DOM in Java (uses Java DOM from X3DJSAIL).  Some further testing is required for roundtrip examples.


Where are the JavaScript SAI implementations?  Thanks!

Do we want both SAI -> DOM and DOM -> SAI in addition to JSON -> SAI?

Do we want to use proxies and JavaScript properties for events instead of X3D/DOM events?

Discuss patterns for converting JSON to SAI, please.   Do we really need SAI when we have DOM?   Can DOM take over some of the operations of SAI?  Which ones?

John
========================================================================================
d. JSON file encoding for X3D
- http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding
- Build outputs now in version control, available at
          http://www.web3d.org/x3d/content/examples/build.json.all.log.txt
- X3DJSONLD summary, status needed from John Carlson
- JSON Schema update
          https://json-schema.org still at draft-07
          JSON Schema is a vocabulary that allows you to annotate and validate JSON documents.
"Update as of 31 March 2019.  You may be wondering what in the world is going on with this draft? The short version is: we are entering the home stretch. There are some ideas for simplifying $id that we are considering, and then there will be a final review period for feedback on overall flow and clarity. [...] We expect to publish a new round of drafts (Core, Validation, Hyper-Schema, Relative JSON Pointer) in the next month or two" [...]
- TODO: update X3D JSON schema to match next version, then autogenerate from X3DUOM
- TODO: create X3D JSON specification
- As time permits we may proceed with an X3D JSON Schema update even if draft-07 isn't 100% complete.
- TODO a second supporting implementation (X3DJSAIL has stylesheet export, will add loader).



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190419/7cb262e8/attachment-0001.html>


More information about the x3d-public mailing list