[sc34wg3] Null in the data model

Lars Marius Garshol sc34wg3@isotopicmaps.org
08 Jan 2004 07:43:24 +0100


* TMDM
|
| Null is used to indicate that properties have no value; it does not
| necessarily indicate that the value of the property is unknown. In
| this model null can never be contained in a set.

* Patrick Durusau
| 
| Not really sure what it means to indicate that a property has no
| value but at the same time it may be known? Seems to me that if it
| has no value, by definition the value cannot be known.

This language is there because in RDBMSs NULL is specifically intended
to be interpreted as "the value is unknown". So if you have a person
table and the cell for birth date is NULL in the row representing
Patrick Durusau that means that Patrick has a date of birth, but we
don't know what it is.

Because of this many people tend to interpret NULL as "unknown value",
but that's not how it's used in TMDM. If you have an internal
occurrence, for example, the null in its [resource] property does not
mean that the URI is unknown; it means that there *is* no URI.
 
| Or is this an allusion to possible processing that might make the
| property known? Seems like at any point the value is either known or
| not?

This is really about how to interpret it, and that tends to affect
processing of the value as well. This is related to the issue Geir Ove
raised about whether null actually is equal to itself or not. If it
means "unknown value" it should perhaps not be equal to itself
(chances of the two unknowns being equal are very small), but if it
means "no value" it should be equal to itself. There's no doubt other
similar issues related to the interpretation I can't think of offhand,
as well.
 
| XML Infoset:
| 
| The XML infoset deliberately avoids the use of "null" in favor of
| "unknown" and "no value."
| (http://www.w3.org/TR/2001/REC-xml-infoset-20011024/, see 1
| Introduction, under heading "'Unknown' and 'No Value'")

That's a good point. Maybe we should switch to saying "No value"
explicitly? I'm not sure it would work for the prose, but feedback on
this would be welcome. It certainly might be clearer, and it also
would be more consistent with the XML Infoset.
 
| If we are going to rely upon the XML Infoset, shouldn't we be
| following its practice of "no value" rather than the more
| problematic "null?"

Maybe.

-- 
Lars Marius Garshol, Ontopian         <URL: http://www.ontopia.net >
GSM: +47 98 21 55 50                  <URL: http://www.garshol.priv.no >