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

Re: An approach to describing the relationships between units-of-measure


uom conversion
Hi Folks,

Things are getting exciting!  

Jeni, I am trying to incorporate your work into this.
At the bottom of this message you will see where I 
am using it.  I have some questions for you there.

Dare, I understand your point about desiring to express
more than just equivalence.  The origin of this work was to
devise a way to express the relationship between UOMs.  
(RDF and OWL do not provide the cability to express
relationships which require a transformation between resources.)
At the moment, it appears that the best way to state the
relationship betwen UOMs is indirectly - by stating
the relationship between a UOM and its base (canonical)
UOM, and then comparing the resulting canonical forms.

/Roger

FACTS

There are 7 categories of units.  Each category has a basic unit:

Category                  Basic Unit       Abbreviation
---------------------------------------------------
Length                      metre              m
Mass                        kilogram           kg
Time                        second             s
Electric current            ampere             A
Temperature                 kelvin             K
Amount of substance         mole               mol
Luminous intensity          candela            cd

kilometre, mile, inches, yard, furlongs, etc are all Length units.

Each Length unit has a well-defined conversion formula to
the base unit (metre).  For example:

   - 1 kilometre = 1000 metres
   - 1 yard = 0.9144 metres
   - 1 mile = 1609.344 metres

USING THE FACTS

The 7 categories of units represents a class of UOMs. 
A property of this class is that there exists a unit 
conversion formula:

<Class id="UOM">
    <uom-conversion>
        <type resource="UOM-Conversion/>
    </uom-conversion>
</Class>

Length is a type of UOM.  The basic unit for all Length UOMs
is metre:

<Class id="Length">
    <subClassOf resource="#UOM"/>
    <baseUOM resource="#metre"/>
</Class>

A kilometre is an instance of the Length class.  There exists
a conversion formula from kilometre to the base (canonical)
metre unit:

<Length id="kilometre">
    <canonicalizer resource="#kilometre-to-metre"/>
</Length>

kilometre-to-metre is an instance of a UOM conversion:

<UOM-Conversion id="kilometre-to-metre">
    <cast from="#kilometre" to="#metre" 
          xmlns="http://www.jenitennison.com/datatypes">
        <value-of select=". div 1000"/>
    </cast>
</UOM-Conversion>

Note that I am using Jeni's datatype work to express the
conversion.  It is not correct, i.e., what does "." mean in
an arbitrary context?  For example, one instance document
might use the kilometre UOM in this fashion:

<River id="Yangtze">
    <length>
        <value>6340</value>
        <units resource="#kilometre"/>
    </length>
</River>

and another instance document might use kilometre 
in this fashion:

<River id="Yangtze">
    <length units="#kilometer">6340</length>
</River>

The conversion formula that I list above:

    <value-of select=". div 1000"/>

works fine (I think) for the second instance but not the
first.  Jeni, do you have suggestions on how to make the
formula more generic?


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.