OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Expressing mathematical relationships?

[ Lists Home | Date Index | Thread Index ]

Roger L. Costello wrote:
> Is there any XML technology that is intended for declaratively
> expressing mathematical relationships, e.g., 
> 
>    Din = 2.54*Dcm (Din = distance in inches
>                    Dcm = distance in centimeters)
> 
>    Tc = (5/9)*(Tf-32); (Tc = temperature in degrees Celsius, 
>                         Tf = temperature in degrees Fahrenheit)
> 
>    etc.
> 
> Is MathML intended for this?  How about RuleML?

I don't know about RuleML. MathML should be able to specify such things, however 
you may be introducing complexity beyond that which you would like to have (it 
all depends on what your needs are).

Seeing your other more detailed post on this topic, I thought that you might 
want to base some solution on XPath. For instance:

<foo:PropertyEquivalence from='measure:inch'
                          to='measure:cm'
                          convert='$in_1 * 2.54'/>

<foo:PropertyEquivalence from='measure:cm'
                          to='measure:in'
                          convert='$in_1 div 2.54'/>

would allow you to declare that the following are euquivalent:

<geo:Distance>
   <measure:inch>2</measure:inch>
</geo:Distance>

<geo:Distance>
   <measure:cm>5.08</measure:cm>
</geo:Distance>

You could allow for multiple inputs to your binding:

<foo:PropertyEquivalence
                  from='size:width/measure:meter size:length/measure:meter'
                  to='size:surface/measure:squareMeter'
                  convert='$in_1 * $in_2'/>

and perhaps equivalentize, depending on whether it makes sense in that context:

<flat:Bedroom>
   <size:width><measure:meter>4</measure:meter></size:width>
   <size:length><measure:meter>5</measure:meter></size:length>
</flat:Bedroom>

<flat:Bedroom>
   <size:surface>
     <measure:squareMeter>20</measure:squareMeter>
   </size:surface>
</flat:Bedroom>

so that given the first you could still query for flat:Bedrooms that are larger 
than 20sqm.

You may need to throw in stuff from EXSLT Math if you want more than XPath provides.

-- 
Robin Berjon <robin.berjon@expway.fr>
Research Engineer, Expway        http://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS