WP5 - MathML Use Case
For the
RDF, Web Ontology, Logic and Mathematics part of SWAD-Europe's
workpackage 5 (relating Semantic Web Technologies to XML technologies), I have written an XSLT transform that evaluates MathML equations on "CompanyReport" files, as provided by danbri.
The
stylesheet
works on a Content MathML file (e.g.
mmlrules.mml) containing computation rules, such as rna = opoa*na/100:
<apply>
<eq/>
<ci>rna</ci>
<apply>
<times/>
<apply><divide/><ci>opoa</ci><ci>na</ci></apply>
<cn>100</cn>
</apply>
</apply>
The stylesheet retrieves a file (e.g.
reports.xml) containing the values of the variables and computes the appropriate results and prints them to standard output:
atr = 1.72139269716302
ca = 52798
etc.
Currently the stylesheet only supports +-/*. While it's easy to add more template to support more of MathML, it's less easy to actually perform complex operations. However using exslt might allow coverage of many ops.
Categories
Posted by mf at March 23, 2004 06:51 PM