XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] What does "optional" mean?

Mike,

Thanks for referencing SQL and the null issue.  Indeed, there were 
wars -- and there would still be if the people who define and use SQL 
were willing to participate in them ;^)

Chris Date, carrying Ted Codd's mantle, and (somewhat less dogmatic) 
Chris' frequent co-author, Hugh Darwen, insist that nulls and 
3-valued logic are a "fatal flaw" in SQL and that "planes will fall 
from the sky" (I think that might have been Ted speaking that line 
orginally).  Well, in the 25 years since the first SQL standard was 
published (and almost 30 years since the first prototypes were 
exposed to the real world), no planes have fallen out of the sky 
because of SQL's nulls or three-valued logic.  For a long while, 
Chris wrote papers attempting to "prove" how every possible 
real-world use of nulls would better be resolved by the use of 
default values.  The "real world" bought his books in droves, and 
kept right on using nulls and 3-valued logic, because it was that 
pragmatism that solved the real-world problems, even though the 
theory and the ratings-improving debates kept us all entertained.

The oft-asked question in SQL is "What does null mean?"  As you 
implied, there have been many answers suggested.  (In fact, there was 
a once-well-known paper that described something like 29 possible 
meanings for a null in a database or programming language 
context.  Sadly, years of searching has not yielded me a copy of that 
paper, even though I read it once about 25 or 26 years ago.  If 
anybody reading this message knows where a copy might be found, 
please let me know!)

Here's what null means in the SQL standard (which is where I *always* 
go when I have a question about the meaning of something in SQL): A 
value is not present.  That's it.  An application might choose to 
assign some meaning to that fact, such as "inapplicable" or "unknown" 
or "irrelevant" or "to be supplied later" or any of several (25?) 
additional meanings.  But, in SQL, all it means is "there's a place 
right here where a value might exist, but there is no value in that place".

I submit that we do not need such wars, or even extended debates, in 
the XML world.  Optional, in XML Schemas, in DTDs, and other 
XML-related standards (at least within the W3C, where most of my 
experience lies), means nothing more than "may be provided or 
omitted".  Any "semantics" associated with the provision or omission 
of something optional might be provided by an application or other 
environment, but I believe that there is not, nor should there be, an 
architecture-wide meaning of "optional" in the XML world -- any more 
than there is in the SQL world.

Hope this helps,
    Jim

P.S., Sadly, I find myself to be one of those people who writes as if 
he believes "Why use 10 words when a hundred will do just fine?".  I 
suppose that I could, and perhaps should, have simply written "What 
Mike said".


At 2/26/2012 09:54 AM, Michael Kay wrote:
>On 26/02/2012 14:11, Costello, Roger L. wrote:
>>Hi Folks,
>>
>>Every schema language (DTD, XSD, RNG) has the notion of optional -- 
>>optional elements and optional attributes.
>>
>>But what does it mean to declare an element or attribute optional?
>>
>Go and read the relational database literature from the early 80s 
>(?) when there was a religious war about the meaning of null, with 
>Ted Codd and co writing papers advocating that there should be four 
>or five different kinds of null with different meanings. Then when 
>you've read them, chuck them in the bin.
>
>Just as the attribute iubce='qwudob' means whatever the sender and 
>recipient agree it should mean, so equally the absence of the iubce 
>attribute means whatever the sender and recipient agree it to mean, 
>which might be "I don't know", or "not applicable", or "I don't 
>think you want to know this", or "you already know this so I'm not 
>telling you again", or perhaps it means exactly the same as iubce='qwudob'.
>
>Michael Kay
>Saxonica

========================================================================
Jim Melton --- Editor of ISO/IEC 9075-* (SQL)     Phone: +1.801.942.0144
   Chair, ISO/IEC JTC1/SC32 and W3C XML Query WG    Fax : +1.801.942.3345
Oracle Corporation        Oracle Email: jim dot melton at oracle dot com
1930 Viscounti Drive      Alternate email: jim dot melton at acm dot org
Sandy, UT 84093-1063 USA  Personal email: SheltieJim at xmission dot com
========================================================================
=  Facts are facts.   But any opinions expressed are the opinions      =
=  only of myself and may or may not reflect the opinions of anybody   =
=  else with whom I may or may not have discussed the issues at hand.  =
========================================================================  



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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS