Constructing objects in MathML and OpenMath is done in similar ways. MathML uses elements termed containers and OpenMath uses elements called constructs. They are both closely related, and most of them are easily interchangeable. The nature of the constructors in both standards is rather different, but their usage is the same.
OpenMath objects can be created by applying a symbol onto a series of arguments. These are the objects created by application and are surrounded by <OMA>...</OMA> elements. In MathML the approach is different. MathML possesses more constructors and they are more specific. It is important to note that OpenMath objects constructed with the <OMA> element may translate to various constructors in MathML.
In OpenMath for instance, defining a list or a matrix would be done by applying the application constructor on the list or matrix symbol followed by the contents of the list or matrix. In MathML however, a list would require the <list>...</list> constructor, and a matrix would need the <matrix>...</matrix> constructor.
Most OpenMath symbols constructed by application are constructed in
MathML using the <apply> constructor. But there are
exceptions which do not map to <apply> tags. It is important
that all exceptions such as matrix
, list
, set
and
others are determined and that the appropriate MathML constructor is
used when translating. Table 3.1 shows what possible MathML
constructors <OMA> can map to.
OpenMath objects can also be constructed using the <OMBIND> element. This consists in binding a symbol to a function with zero or more bound variables. MathML does not have an equivalent, and so symbols which use the binding construct in OpenMath, like lambda or forall, may have different ways of being constructed in MathML. lambda uses a specific constructor in MathML, whereas forall uses the <apply> construct. It is very important in order to ensure proper translation, to determine which OpenMath symbols use the binding constructor and what their MathML equivalent is.
There are objects constructed by attributing a value to an object. These are objects constructed by attribution and employ the <OMATTR> elements. MathML also allows objects to possess attributed values called attributes. The translation is straightforward.
There are other constructors which we do not mention in more detail because there exists a direct mapping between both standards. This is the case of <OMI>, <OMF>, <OMV>, <cn> and <ci>. Table 3.1 shows the relation between them.