← Prev in month ← Prev in thread

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

From
William Cox <>
Date
2014-10-21T21:01:52+00:00
ID
Thread
Integral types in OBIX wd36 schema and UML figure; schema and spec inconsistent
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:  

        
Web: http://www.CoxSoftwareArchitects.com 

        
+1 862 485 3696 mobile
← Prev in month ← Prev in thread