[x3d-public] Using X3D Object Model XSD and tools outside of X3D

Don Brutzman brutzman at nps.edu
Thu Sep 22 12:09:48 PDT 2016


On 9/20/2016 6:11 PM, yottzumm at gmail.com wrote:
> What is the potential for using the X3D Object Model XSD, “schema” XML and tools to generate an Object Model and related APIs outside of the context of X3D?  I already sent Don and Roy a skype message.  Currently, we are using swagger.io, but I would like to start from an XML or JSON context instead of a YAML context, so translation or another tool is indicated.  Is there a good tool to translate XML Schema or XML Object Model to swagger YAML, and thus providing the way for a REST API and other artifacts in many languages, without having to write XSLT for all of them?n
>
> Also, I am interested in generating SQL or NoSQL (ElasticSearch) Schema from the Object Model.
>
> Just trying to feel out the domain of autogeneration again after years of being away (23 years).
========

On 9/22/2016 2:17 AM, John Carlson wrote:
> Don, given I have my own XML schema, how hard or easy is it to generate my own object model and Java API?  How does this compare to the OpenAPI Specification?  (for REST).   Can the networking group leverage any of this work to create a REST API?
>
> Thanks
========

Your question is much appreciated John.  (Apologies for delayed response, am attending MTS/IEEE OCEANS 2016 Conference.)

It is good to finally begin proceeding with object-oriented code-autogeneration testing of the X3D Object Model.  As testing to date has shown, we think that the interface hierarchy defined in the X3D Abstract Specification will be further shown as viable and correct, with occasional small corrections and refinements to match the rigor of an even-stricter object model.  At the same time, we are being very careful to avoid inserting any constructs that are peculiar to any particular programming language.  Continued testing will help ensure that a language-independent object model is being expressed.

	X3D Part 1: Architecture and base components
	4.4.2.3 Interface hierarchy
	http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#InterfaceHierarchy
	(original Figure 4.2 by Joe Williams)

This generality is not a complete surprise, since perhaps two dozen codebases have implemented the X3D/VRML interface hierarchy.

	http://www.web3d.org/x3d/content/examples/X3dResources.html#Applications

Roy and I have anticipated broader potential usage of the X3D Object Model.  This is why it is expressed in a simple form of XML.  To facilitate conversions, we have also created a simple stylesheet that can be adapted to produce alternate forms.  Reference links and example conversions follow.

	X3D Object Model (autogenerated from X3D XML schema)
	http://www.web3d.org/specifications/X3DObjectModel-3.3.xml

	http://www.web3d.org/x3d/stylesheets/AllX3dElementsAttributesTextTemplate.xslt
	http://www.web3d.org/x3d/stylesheets/AllX3dElementsAttributes3.3.xml
	http://www.web3d.org/x3d/stylesheets/AllX3dElementsAttributes3.3.txt

The template above simply marches through the object model and outputs each element and attribute.  So you have a node/field inventory that is easily checked.

Next.  It will be good to learn more about the relevant parts of both YAML and OpenApI, as you think best.

	https://en.wikipedia.org/wiki/YAML
	http://yaml.org
	http://www.yaml.org/start.html

	https://en.wikipedia.org/wiki/OpenAPI_Specification
	https://openapis.org/specification
	https://openapis.org

SQL/NoSQL are further interesting!  I think it will be important in each of these cases to be clear what the focus is: producing X3D documents, producing validation schema, etc. etc.

Looking ahead.  If you can show example syntax of what kinds out outputs you might like from the X3D Object Model, am happy to help adapt the template stylesheet to autogenerate the goal output.

Thanks for considering the possibilities!  Onward we go.  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



More information about the x3d-public mailing list