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

 


Help: OASIS Mailing Lists Help | MarkMail Help

obix message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: Integral types in OBIX wd36 schema and UML figure; schema and spec inconsistent


All --

Here are the three versions of the UML PNG diagram, one each with the integral type being
  • int
  • integer
  • long
Craig, depending on the decision on the recommendation below, one of these should work. Text still needs alignment, as does the schema.

There's another alternative I hadn't considered:

only the val of Int is long, the others are all int.

Not sure that the potentially smaller sizes justify the confusion...

Thanks!

bill
--

William Cox 

Email: wtcox@CoxSoftwareArchitects.com 

Web: http://www.CoxSoftwareArchitects.com 

+1 862 485 3696 mobile


On 10/21/14 5:01 PM, William Cox wrote:
Toby, Craig, and all --

This is modified from my 16 October email to the list. The most recent UML diagram and schema use "int" for the integral types.

RECOMMENDATION:
  • Change all occurrences of "xs:int" in the schema to "xs:long" consistent with line 516.
  • Correct capitalization on all of 4.3.1 and subsections - note that the type on line 516 is "Int" not "int" as in the text. Table at line 505 has incorrect capitalization in the Type Name column.
  • Consistent with the spec, but does the change to xs:long break anything?
ALTERNATE:
  • Change all occurrences of "xs:int" in the schema to "xs:integer". This is a superset of "xs:long" and line 516 should be changed to something like "an integer with at least 64 bits.
  • Correct capitalization on all of 4.3.1 and subsections - note that the type on line 516 is "Int" not "int" as in the text. Table at line 505 has incorrect capitalization in the Type Name column. (same as above)
  • More mathematically elegant, but does it break applications?
What do you prefer?

Thanks!

bill



INT INTEGER etc

"Int", "int", or "integer"?

We're using XSD types; I've added commas and [number of bits] to the definitions for readability.

From the XML Schema Datatypes Second Edition:

[Definition:] integer is ·derived· from decimal by fixing the value of ·fractionDigits· to be 0 and disallowing the trailing
decimal point. This results in the standard mathematical concept of the integer numbers. The ·value space· of
integer is the infinite set {...,-2,-1,0,1,2,...}. The ·base type· of integer is decimal.

[Definition:] long is ·derived· from integer by setting the value of ·maxInclusive· to be 9,223,372,036,854,775,807 and
·minInclusive· to be -9,223,372,036,854,775,808. The ·base type· of long is integer.

[Definition:] int is ·derived· from long by setting the value of ·maxInclusive· to be 2,147,483,647 and ·minInclusive· to
be -2,147,483,648. The ·base type· of int is long.

The schema uses xs:int, the third definition above - a 32 bit integer. The UML diagram update I sent a few minutes ago uses "int" everywhere for consistency.
So should it be "long" or "int" or "integer"? Depends on what the schema users expect, and the schema is definitive, so the spec should match the schema which should match the spec :-)

For the OBIX type Int, note the type of the attributes min, max, and val.
    <xs:complexType name="Int">
        <xs:complexContent>
            <xs:extension base="Obj">
                <xs:attribute name="min" type="xs:int"/>
                <xs:attribute name="max" type="xs:int"/>
                <xs:attribute ref="unit"/>
                <xs:attribute name="val" type="xs:int" default="0"/>
            </xs:extension>
        </xs:complexContent>
A related issue is on line 516:
ERROR  "4.3.1.2 int" is really muddled. it says "val ... maps to xs:long", NOT xs:int.  So the schema should say xs:long NOT xs:int. And so should the UML.
This is in part a carryover from the short/int/long issues in C.


Thanks!

bill
--

William Cox 

Email: wtcox@CoxSoftwareArchitects.com 

Web: http://www.CoxSoftwareArchitects.com 

+1 862 485 3696 mobile



Attachment: Obj and Subclasses wd37 long.pdf
Description: Adobe PDF document

Attachment: Obj and Subclasses wd37 integer.pdf
Description: Adobe PDF document

Attachment: Obj and Subclasses wd37 int.pdf
Description: Adobe PDF document



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]