[dsdl-discuss] Re: Numbers and units

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Thu May 30 2002 - 10:00:55 UTC

Rick Jelliffe wrote:
> From: "Eric van der Vlist" <vdv@dyomedea.com>
>
>
>>Might be, OTH even so, a formal description of the relations between the
>>units would be computable by the validators which would be able for
>>instance to deduce the relation between square inches and square
>>millimeters from the relationc between inches and centimers and the
>>relation between centimeters and millimeters.
>
>
> It is already more complex than Martin was suggesting!

Yes and no. I would say that it's more formal but not necessarly more
complex.

> I think it
> is fair enough to have a schema language that supports scientific
> documents, but that is the realm of MathML and not something that
> I think we have a requirement for.
>
>
>>What I don't like about using attributes for the units is that it's not
>>extensible and that you can't "qualify" the unit.
>
>
> It is completely extensible, because new units can be defined and
> related to a canonical unit.

Really? How would you define a new unit and relate it to a canonical
unit? How do you avoid running into namespaces issues it your units have
simple token names? How do you get support from processors when you
create new units?

It's really these issues that MathML can help us to solve. This wouldn't
necessarly been seen by users, but defining the relation between "cm"
and "inch" in MathML would really help IMO.

.../...
> Sure. But we each need to make clear what the industrial problem we (i.e. our
> national bodies, etc) need to solve. If we want to support DBMS exchanges
> or international banking, that is fine, but it needs to be explicitly stated. Datatyping
> is such a big area that unless we have targets we will waste our time, and not
> provide any viable alternative to W3C.
>
> What concrete problem are you trying to solve?

I should have started with this, but that wasn't as clear before your
answers. I think we should try to define "unit libraries" like we define
"type libraries" and that the knowledge of the relation between the
units would be better captured in formal descriptions serialized as XML
than hidden in the implementations.

That's not necessarly incompatible with writing:

<dsdl:number unit="dollars_per_cubic_dm">15</dsdl:number>

or

<dsdl:number unit="cm">25</dsdl:number>

but I think that this should be a formal description of what
"dollars_per_cubic_dm" and "cm" are and some possibility for
applications to define new units ("dollars_per_cubic_dm" for one doesn't
seem like a "universal" unit).

If we don't do so, each application would have to know the relation
between the unit (for instance to determine is if <dsdl:number
unit="inch">2</dsdl:number> is greater or smaller than <dsdl:number
unit="cm">5</dsdl:number> or if <dsdl:number
unit="centigrad">20</dsdl:number> is smaller or greater than
<dsdl:number unit="fahrenheit">80</dsdl:number>.

Expressing this (or giving the possibility to other to express this) as
MathML instead of writing it in a spec doesn't seem more complex to me
but just more open.

The impact on the syntax you've proposed would only be to find a way to
associate the units with a library.

This could be done in several ways, such as:

1) Using a "unitLibrary" inherited attribute:

  <foo unitLibrary="http://example.org/units/myunits">

        <dsdl:number unit="inch">2</dsdl:number>

  </foo>

2) Using QNames:

  <foo xmlns:un="http://example.org/units/myunits">

        <dsdl:number unit="un:inch">2</dsdl:number>

  </foo>

3) Using elements instead of attributes to qualify them:

   <dsdl:number>
     <dsdl:value>2</dsdl:value>
     <dsdl:unit library="http://example.org/units/myunits">
       inch
     </dsdl:unit>
   </dsdl:number>

>
> One feature of my approach is that precision is completely left to implementations,
> and only single-stage conversions to a canonical value are allowed: this can
> allow high precision and reduce the chances of accumulated error.
> This is one reason I don't want to build-in any knowledge of particular units
> (e.g. what is a month) or relationships (i.e. inches to cm).

That's also to avoid build-in knowledge of particular units that I'd
like to formalize this knowledge!

Eric

--
See you in San Diego.
                                http://conferences.oreillynet.com/os2002/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------
--
DSDL members discussion list
To unsubscribe, please send a message with the
command  "unsubscribe" to dsdl-discuss-request@dsdl.org
(mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)
Received on Thu May 30 06:00:58 2002

This archive was generated by hypermail 2.1.8 : Fri Dec 03 2004 - 14:00:27 UTC