[om] A Proposal for extending OpenMath with XML annotations

Mike Dewar miked at nag.co.uk
Fri Aug 30 12:34:29 CEST 2002


I had a chance to discuss this with Stephen, Olga and Arjeh at a meeting
last week and I wonder if the following isn't a cleaner solution than
some of the other proposals.

Although the question was about XML (specifically presentation MathML)
there is, in principal, no reason why applications wouldn't want to have
data in other formats (JPEGs for presentation, WAV for spoken rendering,
Mathematica input syntax, ...) as attributes and currently the only way
to do that is to encode them as a string with no indication of what the
string contains.  For that matter, we do still have a binary encoding
for OpenMath and an application using that might not be able to handle
XML syntax.

What I would propose is that we add a new basic OpenMath object (as
described in section 3.1.1 of the standard) called e.g. Data (assuming
that doesn't cause confusion with the OMDoc element of the same name)
which has two fields, a type and a value.  These could only appear
inside attributions in the position where we currently have OpenMath
objects (which would still be valid).

The XML encoding of a Data object would have to be valid XML.  For
presentation MathML (Stephen's example) we could have something like:
    <OMATTR>
       <OMATTP>
          <OMS cd="presentation-forms" name="MathML-Presentation"/>
          <OMData type="MathML-Presentation">
            <mrow> <mo>sin</mo> &#8289; <mn>1</mn> </mrow>
          </OMData>
       </OMATTP>
       <OMA> <OMS cd="transc1" name="sin"/> <OMI>1</OMI> </OMA>
    </OMATTR>
where &#8289; is &ApplyFunction; (which could be used if the entity had
been declared).

For things which don't have natural XML encodings the representation
would have to be an OMSTR.  Similarly, in the binary encoding, the
representation of some XML might be a bytearray.

The upside of this is that we could now annotate OpenMath objects with
any kind of structure in any encoding.  The downside is that its a big
change to the standard and in the XML encoding we would no longer have a
strict DTD and probably would need to think more carefully about
namespaces and schemas.

What do people think?

Mike.

On Mon, Aug 12, 2002 at 05:27:25PM -0400, Stephen Watt wrote:
> Dear OpenMathers,
> 
> One of my students -- Clare So -- and I are working on a complete 
> implementation of the Content-MathML//OpenMath correspondence as a set of
> XSLT stylesheets.   Some previous work had provided a good start,
> but there are many tricky details which emerge.
> 
> In particular, when translating a MathML <semantics> element to OpenMath
> it would be natural to use an <OMATTR>.  However, the <OMATTP> objects
> must have valid OpenMath data as their values.   
> 
> We need to be able to include non OpenMath XML in an OpenMath object.
> 
> [ From a forward-looking perspective, we see that it will be important to
>   be able to include XML data from other sources, not just MathML, in 
>   OpenMath objects.   The approach of the "altenc" cd is too primitive
>   (converting the XML to strings, e.g. "&lt;sin/&gt;") because it
>   does not allow tools to manipulate the XML data. ]
> 
> We see two possibilities to handle this:  
> 
> (1) the cleanest would be to invent a new element <OMXML> 
> to enclose arbitrary XML data as an OpenMath object (much like OMS 
> for character data).
> 
> (2) the "backward-compatible" possibility would be to expand the
> definition of <OMATTP> attributions to allow arbitrary xml data as
> the attribute values.
> 
> 
> **** Question 1 ****  Which of these, or what instead, do people prefer?
> 
> To not destabilize our tools, we would prefer method (2).
> 
> Recall that an OpenMath attribution object has the form
> 
>    <OMATTR> <OMATTP> S_1 O_1 S_2 O_2 ...</OMATTP>  E </OMATTR>
> 
> where the S_i keys are <OMS> values and the O_i are arbitrary OpenMath objects.
> 
> We would propose that:
> 
>     If an OMATTP has an OMS key S_i with cd="xml", 
>     then the value O_i can be an arbitrary XML object.
> 
>     In this case the name="...." field of the OMS can be used to
>     capture other information.
> 
> 
> E.g.  The MathML content element
> 
>    <semantics>
>       <apply> <sin/> <cn>1</cn> </apply>
>       <annotation-xml encoding="MathML-Presentation">
>         <mrow> <mo>sin</mo> &ApplyFunction; <mn>1</mn> </mrow>
>       </annotation-xml>
>    </semantics>
> 
> could be encoded ase
> 
>    <OMATTR>
>       <OMATTP>
>          <OMS cd="xml" name="MathML-Presentation"/>
>          <mrow> <mo>sin</mo> &ApplyFunction; <mn>1</mn> </mrow>
>       </OMATTP>
>       <OMA> <OMS cd="transc1" name="sin"/> <OMI>1</OMI> </OMA>
>    </OMATTR>
> 
> 
> 
> **** Question 2 ****
> 
> We need still to be able to name the attributes somehow.  Above we have
> done this with the name= part.
> 
> There is the question as to whether it is best to 
> 
> (i)  use the name= field as a convenient place to hold the character string
>      (i.e. allow any string as a name from the xml "pseudo CD"), or
> 
> (ii) to require that the name= truly be a symbol exported from a true XML cd,
>      and put the string (e.g. "MathML-Presentation") elsewhere. (If so, where?)
> 
> 
> What do people think about these two questions?   (We lean toward 2i.)
> 
> -- Stephen and Clare
> --
> om at openmath.org  -  general discussion on OpenMath
> Post public announcements to om-announce at openmath.org
> Automatic list maintenance software at majordomo at openmath.org
> Mail om-owner at openmath.org for assistance with any problems
> 
> _____________________________________________________________________
> This message has been checked for all known viruses by Star Internet
> delivered through the MessageLabs Virus Scanning Service. For further
> information visit http://www.star.net.uk/stats.asp or alternatively call
> Star Internet for details on the Virus Scanning Service.

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
--
om at openmath.org  -  general discussion on OpenMath
Post public announcements to om-announce at openmath.org
Automatic list maintenance software at majordomo at openmath.org
Mail om-owner at openmath.org for assistance with any problems



More information about the Om mailing list