2008-10-30: The Eclipse XSD Java API has been used to automatically transform the NeXus Meta-DTDs (XML templates) into a generative XML schema for NeXus (called NeXML). The Eclipse Modeling Framework (EMF) has been used to create EObject Java bindings and a validating EMF model editor for the NeXML schema. The system was presented at the meeting of the NeXus International Advisory Committee (NIAC), Oct 2008 in Sydney. A comprehensive webel.com.au technical report is available online.
2007-09-23: A Bragg Institute technical report on the generation of Java NeXusBeans from the NeXus format Meta-DTD XML templates is available online. NeXusBeans: object-oriented software components for the NeXus scattering science data format using Java, UML, and XML Schema technologies, Kelly & Hauser, 2007, Bragg Institute, ANSTO.
2007-04-08: [OBSOLETE] The NeXusBeans beta release is available for download; includes a metamodel-driven NeXusXmlTemplateToNeXusBean generator tool.
2007-02-25: [OBSOLETE] The NeXusBeans alpha release is available for download
The system presented here was originally developed by Dr Darren Kelly and Dr Nick Hauser for the Neutron Beam Instrument program of the OPAL research reactor, for the Bragg Institute of the Australian Nuclear Science and Technology Organisation (ANSTO). It is now independently developed by Dr Darren Kelly and webel.com.au Scientific IT Consultancy. Sponsors are sought for continued development of NeXML for NeXus users and the international scattering science community.
Feedback by email from NeXus users and NIAC members is welcome.
A generative XML Schema and Java bindings for the NeXus format
This is a UML-driven project for automated translation of the NeXus neutron, x-ray, and muon science data format from NeXus "Meta-DTDs" (XML templates) into an XML Schema (XSD) called NeXML, and for generation of Java bindings for the NeXML schema. It also brings Unified Modelling Language (UML)TM modelling of reverse-engineered XML Schema and Java components to NeXus.
This demonstration sub-project is strictly DOWNSTREAM from the offical NeXus home site; it "consumes" artefacts approved by the NeXus International Advisory Committee (NIAC) and translates them automatically into other forms, such as:
- Meta-DTD (XML template) -> XML Schema using the Eclipse XSD API (Java)
- XML Schema (XSD) -> Java EObjects using the Eclipse Modelling Framework (EMF)
- Meta-DTD (XML template) -> HTML using XSL transformation stylesheets
- Meta-DTD (XML template) -> NeXusBean (Java) using the Bragg direct XML2Java converter
- NeXusBean (Java) -> UML (reverse-engineering in Magicdraw UMLTM)
Q: What does NeXML stand for ? Who developed the code and coined the project name ?
A: It stands for "XML tools for NeXus", and is also the name of the automatically generated XML Schema for NeXus. I (Darren Kelly) coined the name and developed the system, with the support of the Bragg Institute and its representing NIAC member Dr Nick Hauser.
Q: How should one pronounce it?
A: Nex-M-L (like "necks-em-el")
Q: Is this yet another NeXus neutron science format spin-off site ?
A: No. This is strictly a dynamic consumer of artefacts available online via the official NeXus site. In many cases the NeXus artefacts are consumed dynamically, before your ears and eyes, by pulling artefacts from the NeXus site and NeXus WiKi and transforming them for you. (In some case transformations are demonstrated on locally stored copies.)
Q: What is the difference between a Java NeXusBean and an EMF EObject bound to the NeXML Schema ?
A: The original NeXusBeans were Java components meeting the JavaBeans setter/getter pattern, and were generated directly from the NeXus XML templates using custom Java forward-engineering code; Java EObjects for NeXML are generated by loading the NeXML schema into the Eclipse Modeling Framework (EMF) system, which uses a genmodel (based on ECore) as a "canonical schema".
Q: If the pre-NIAC08 NeXus "meta-DTD" XML templates are abandoned in favour of XML templates validated against a meta-schema (NeXus Definition Language) can this NeXML system also be migrated ?
A: Yes, quite easily, that is the advantage of a generative, encapsulating approach, and of decoupling the template interpreter from the NeXML Schema generator.
Q: Will the techniques presented here be used to replace the pre-NIAC08 NeXus "meta-DTDs" or the post-NIAC08 NeXus Definition Language (NXDL) templates ?
A: Not yet. This is a demonstration for the benefit of NIAC and NeXus users.
Q: Will the generators used here "feedback" to the NeXus site ?
A: Not yet. The value-adding NeXML strategy will remain strictly downstream from NeXus until further notice and detailed consideration by NIAC.
Q: Do I need to know XSL stylesheets, Java, and Unified Modelling Language (UML)TM to understand this demonstration ?
A: Some of the NeXML approach is presented as XML schema snippets, however to properly understand the Java NeXusBean and EMF EObject concepts, you will need to understand some Java, and to truly appreciate the software engineering and the NeXML Schema, you will need at least some of the lingua franca of IT (I mean UML, of course).