[seek-dev] What to do about "nil"

Bertram Ludaescher ludaesch at sdsc.edu
Tue Nov 9 10:52:45 PST 2004


Seems that if an empty string is received (denoting nil) than *any*
number you return is wrong. What data structures are allowed on the
"receiving side"? Seems that for a data type that is "nullable" (or
nillable ;-) one needs a union type

type mynillableType = myComplexType | nil

Isn't such a construct available?


>>>>> "RS" == Rod Spears <rods at ku.edu> writes:
RS> Here is the schema for Latitude per the DarwinCore spec:
RS>     <xsd:element name="DecimalLatitude" 
RS> substitutionGroup="digir:searchableReturnableData" nillable="true">
RS>         <xsd:annotation>
RS>             <xsd:documentation>The latitude of the location from which 
RS> the cataloged item was collected, expressed in decimal 
RS> degrees.</xsd:documentation>
RS>         </xsd:annotation>
RS>         <xsd:simpleType>
RS>             <xsd:restriction base="xsd:decimal">
RS>                 <xsd:minInclusive value="-90.0"/>
RS>                 <xsd:maxInclusive value="90.0"/>
RS>             </xsd:restriction>
RS>         </xsd:simpleType>
RS>     </xsd:element>
RS> Note that the value can be "nil" and it also has a restriction. When the 
RS> value reaches the DarwinCoreDataSource as a string it is either a valid 
RS> number within the range or an empty string (length zero).
RS> Currently, I convert the empty string to "0.0" which is the wrong thing 
RS> to do. The question is what should I do? As Dan suggested I could pick 
RS> an arbitray large number and pass that back, but that assumes the 
RS> consumer will know what to do with that value. I could skip any and all 
RS> rows that have empty Lat or Long values, but that may be bad for 
RS> consumers that want to see that data but don't care if it is nil (empty) 
RS> or not.
RS> Any thoughts?
RS> Rod
RS> _______________________________________________
RS> seek-dev mailing list
RS> seek-dev at ecoinformatics.org
RS> http://www.ecoinformatics.org/mailman/listinfo/seek-dev

More information about the Seek-dev mailing list