[kepler-dev] Re: StorageType

Matt Jones jones at nceas.ucsb.edu
Fri Feb 25 15:57:31 PST 2005


Hi Jing,

The type really should be determined from the measurementScale and 
domain (numericDomain and nonNumericDomain).  Using the storage type was 
a hack  that we kept in from our earlier Monarch code -- its very 
unreliable, and is optional, which is why we at times have trouble.  I 
think I wrote about this in a bug for Kepler, but I can't find it.

The default Ptolemy types are fairly coarse grained, so we should get 
fairly far by something simple:

MeasurementScale     numberType        Type
nominal              N/A               string
ordinal              N/A               string
interval/ratio       natural           int or long (depending on bounds)
interval/ratio       whole             int or long (depending on bounds)
interval/ratio       integer           int or long (depending on bounds)
interval/ratio       real              double
datetime                               ?

In the above, you can use bounds and precision to help fine tune which 
of the numeric types to use.

In implementing this, its probably best to separate out the type 
inference code from the rest as much as possible -- a separate method at 
  a minimum, a separate class possibly.   Keep in mind that this code is 
probably going to be somewhat related to semantic type checking that 
Shawn is working on.   When you are finished, could you post a summary 
of the logic you used to the kepler-dev list so we can review it?  Thanks.

Matt


Jing Tao wrote:
> Hi, devs:
> 
> I found an issue that Kepler couldn't figure out the datatype for 
> attributes in an eml document which create by morpho wizard.
> 
> I took a look and found EMLParser in kepler will think 
> attribute/storageType as datatype. But morpho wizard will generate data 
> type in numericDomain/numberType. They are  not match. I am trying to  
> modify EMLParser in kepler and have an  question: which one should be  
> primary location to find the data type - attribute/storageType or numbericDomain/numberType?
> 
> Thanks.
> 
> Jing
> 
> 
> 

-- 
-------------------------------------------------------------------
Matt Jones                                     jones at nceas.ucsb.edu
http://www.nceas.ucsb.edu/    Fax: 425-920-2439    Ph: 907-789-0496
National Center for Ecological Analysis and Synthesis (NCEAS)
University of California Santa Barbara
Interested in ecological informatics? http://www.ecoinformatics.org
-------------------------------------------------------------------



More information about the Kepler-dev mailing list