[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Expressing mathematical relationships?


mathematical relationships
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@e...>
Research Engineer, Expway        http://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.