OpenMath and the OpenMath JavaBeans
OpenMath attempts to create a standard for the electronic communication of mathematics. Its goal is to make mathematical objects and their mathematical meaning accessible across different software packages: including web browsers, educational packages, and specialized math packages such as Maple and Mathematica. JavaBeans attempts to create a programming environment in which "non-programmers" can access the cross platform programming ability of Java. In this sense, both OpenMath and JavaBeans represent attempts to break down barriers to creativity and communication in a digital environment. The marriage of OpenMath and JavaBeans through the creation of a set of OpenMath compliant JavaBeans is a natural extension of the effort to make the communication of mathematical ideas more accessible. The purpose of this web page is to present an overview of the union between OpenMath and JavaBeans and to outline some of the theory that supports this union.
Table of Contents
[Return to: OpenMath and Java for Math Education]
- Table of Contents
- What is OpenMath?
- What are JavaBeans?
- What Makes a JavaBean OpenMath Compliant?
- Why Develop OpenMath Compliant JavaBeans?
- Appendix: The Release 0.5 Beans
- Appendix: Related Links
What is OpenMath?
OpenMath is an evolving standard for the storage, manipulation and transmission of mathematical ideas in an electronic environment. Its development is motivated by the increasing dependence on electronic communication in the research, educational, and industrial communities. The uncoordinated process of tool development for the digital representation of mathematics is leading to an electronic babel in which different software platforms are largely unable to share mathematical output. OpenMath attempts to address this by presenting a standard for the electronic communication of mathematics. Diagrammatically, the overall schema looks like:
OpenMath System Architecture
The following table describes the three layers of this architecture:
Function in an OpenMath Environment:
|Private||The private layer encompasses the program specific (and often proprietary) representation of mathematical objects and as such depends on the particular software package or packages being considered. If, for example, the mathematical entity in question is the unary function f(x) = sin(x), then it would be natural to assume that the private layer representation for Maple would be quite different than the private layer representation for Mathematica or Geometer's Sketchpad. Private layer representations may also be hardware dependent.|
|Abstract||Program specific "phrasebooks" translate data from the internal representations of the private layer into representations of the object that conform to the OpenMath standard. This standard is described in a number of Content Dictionaries (CDs) which are written in XML (eXtensible Markup Language) and are the foundation of the OpenMath standard. Two different programs may share OpenMath objects at this level if the data structures that they use to represent those objects are the same. For example, Java applets running on two different machines would be able to share data at this layer.|
OpenMath decoding/encoding routines translate OpenMath objects into XML or Binary representations. These representations can then be passed between programs to be encoded as OpenMath Objects and ultimately, by way of the phrasebook, into machine specific representations for internal manipulation by the program.
The OpenMath Content Dictionaries:
Written in XML, the OpenMath Content Dictionaries (CD's) contain the information that binds mathematical meaning to the OpenMath objects. There are currently 22 Content Dictionaries which cover topics ranging from basic arithmetic to set operations. Interpreting the CD's and their associated grammar requires familiarity with XML. As an example, from the alg CD for basic algebra, the XML encoding of 'one', the multiplicative identity, looks like:
The OpenMath XML definition of 'one' from the alg CD
The XML OpenMath grammar is described in The OpenMath Standard, a document produced by the OpenMath Esprit Consortium. For anyone interested in learning more about OpenMath system architecture and encoding, this document is a good place to start.
What are JavaBeans?
JavaBeans are software components that can be used for programming in a visual environment. The appearance of a JavaBean will depend on the visual builder being used. In the design window of Sun Microsystems' JavaStudio, beans look like:
The OpenMath PointPlotter Bean
The connectors on the left and right hand sides of the bean correspond to different types of events. The connectors on the left side correspond to events that the bean can respond to or "listen for" and the connector on the right side corresponds to events that the bean can send to other beans. The PointPlotter plotter bean is a visible bean which creates a cartesian axis for plotting points, lines, and polygons. It can listen for seven different classes of events which prompt it to do such things as perform analysis on incoming data and clear the plotting surface. It can send only one class of event: typically an event packaged with data containing ordered pairs corresponding to the points plotted on its surface. If a programmer wanted the PointPlotter bean to respond to a button click telling it to clear its plotting surface, then she would add and "wire up" an EventButton bean as follows:
EventButton "wired to" PointPlotter
In this case, the EventButton bean sends an "actionPerformed" event to the "clearPoints" listener of the PointPlotter bean.
For a detailed description of the JavaBeans programming environment, you can download Sun's JavaBeans API specification from the JavaBeans Spec download page. For an on-line tutorial covering all aspects of bean development and programming with Sun's Bean Development Kit, look at Sun's JavaBeans Tutorial.
What Makes a JavaBean OpenMath Compliant?
JavaBeans are OpenMath compliant if their internal representation of mathematical objects is consistent with the specifications of the OpenMath standard. In order to share information with another OpenMath compliant application, a fully compliant applet or application built from JavaBeans would also need to be able to translate the internal representations of mathematical objects into OpenMath XML or Binary bit streams. This translation to XML or Binary would not be necessary if both applications were Java based as the Java byte-code serves as a surrogate translation encoding. For this reason, if two different applications are Java based the system architecture representing their sharing of information looks like:
OpenMath System Architecture (for two Java Applications)
For detailed information about the OpenMath JavaBeans and the OpenMath Java Library in general, see the PolyMath Development Group's Java OpenMath Library.
Why Develop OpenMath Compliant JavaBeans?
The communication and representation of mathematical ideas requires multidimensional media. For all but the simplest of mathematical statements, a minimum requirement is text that is equipped to handle mathematical symbols. Commonly, at least a basic graphics capability is also required. As the development of electronic math environments has progressed, animation, interactivity and even audio have become recognized as desirable capabilities. With the emerging dominance of the World Wide Web as the primary medium of electronic transmission of multi-media, there has been a strong incentive in all fields to develop web authouring tools that put the full capabilities of the web in the hands of the non-expert. In mathematics, this desire is manifest in two distinct goals. The first is a search for a means to publish on the web mathematical creations that originate in any of the various electronic math environments currently in use by students and researchers. The second is the search for a simple programming medium that would allow students and researchers to create and share, perhaps interactively, digital representations of their mathematical ideas. The OpenMath initiative articulates a third goal: the desire to establish a means for different electronic math environments to share information with each other. Its multi-platform ability makes the Java programming language an important part of the response to each of these endeavours. Through conversion of OpenMath objects into Java byte-code, as illustrated by the modified OpenMath system architecture in the previous section, OpenMath objects can be embedded in web documents and, while not yielding optimum performance, can be shared between platforms as long as both platforms can properly interpret the Java serialization as an OpenMath object. There is a problem however with simplicity. While from a programmer's perspective Java is not a complex programming language, its most useful features are not accessible to anyone who has not invested a considerable amount of time in learning its structure and syntax. The graphical Rapid Application Development (RAD) environment of JavaBeans puts the power of Java at the disposal of users who would like to publish animated or interactive web documents without taking the time to learn conventional Java programming. To work in JavaBeans users require only two things: an understanding of event-based programming logic and familiarity with the set of beans that they are using. In both cases, this knowledge can be acquired quite easily as long as the user has access to a development tool such as JavaStudio which strongly supports the graphical nature of JavaBeans programming.
||From page 5 of The OpenMath Standard (1998), edited by O. Caprotti and A.M. Cohen. This document may be downloaded in various formats from the the Esprit OpenMath standards page.
||From the alg CD by N. Howgrave-Graham, published on 15/7/98. This is a CD of basic algebra concepts that contains only two definitions: a definition of one, the multiplicative identity and a definition of zero, the additive identity. It may be downloaded in various formats from the Esprit OpenMath standards page.
||The OpenMath Standard, edited by O. Caprotti and A.M. Cohen, includes descriptions of the overall OpenMath architecture and grammars for the both the XML and binary encodings of OpenMath objects. It may be downloaded in various formats from the Esprit OpenMath standards page.
||The OpenMath PointPlotter bean is one of the beans in the PolyMath Development Group's 0.5 alpha release of OpenMath Java packages. These packages are described on the PDG's Java OpenMath Library page.
||Adapted from page 5 of The OpenMath Standard (1998), edited by O. Caprotti and A.M. Cohen. This document may be downloaded in various formats from the the Esprit OpenMath standards page.
||Click here for a table of data compliled by Terrance Yu, of the PolyMath Development Group which presents statistics comparing the encoding times and encoded sizes of OMObjects encoded in native Java serialization, XML, and OpenMath binary.