This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14840 - [XDM 3.0] Function types in the type hierarchy diagram
Summary: [XDM 3.0] Function types in the type hierarchy diagram
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Data Model 3.0 (show other bugs)
Version: Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Norman Walsh
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2011-11-16 11:28 UTC by Michael Kay
Modified: 2012-02-20 13:39 UTC (History)
1 user (show)

See Also:


Description Michael Kay 2011-11-16 11:28:54 UTC
The type hierarchy diagram used in both XDM and F+O shows the type

function(item()*) as item()*

with four (example) subtypes, namely

function(item()*) as item()
function(item()*) as item()?
function(item()*) as item()+
function(item()) as item()

This is incorrect. (function(P) as Q) is a subtype of (function(R) as S) if R is a subtype of P and Q is a subtype of S. Therefore the last of these four illustrative subtypes is correct.

I'm not a graphical kind of person, so I will leave the correction of this to someone else. I have always thought the whole diagram highly misleading. Even its title is wrong, since our types form a lattice rather than a hierarchy. My vote would be to remove it entirely.
Comment 1 Michael Kay 2011-11-16 11:30:07 UTC
Therefore the last of these four illustrative subtypes is correct.

Comment 2 Jim Melton 2011-11-22 07:48:29 UTC
Thanks for this bug report.  I am the person stuck with updating the type hierarchy diagram(s), so I need to better understand your report.  Are you suggesting that the entire collection (of three) type hierarchy diagrams should be omitted from the documents, or that only a part of diagram 1 should be omitted?  I think you mean the latter, but it's not quite clear to me. 

If it's only the part of diagram 1 that deals with function items, I would be grateful for your guidance about what should be done with the fact that function(*) is, in fact, a kind of item, and that it has a great many subtypes.  Depending on the extent of the changes you might suggest to the part of diagram 1 dealing with function items, I may be able to handle it editorially. 

If your suggestion is to eliminate one or all of the diagrams, then I believe that a WG decision is required. 

If you wish to change the title either of diagram 1 only or of all diagrams to replace the word "hierarchy" with "lattice" or something similar, I also believe that a WG decision is required.
Comment 3 Michael Kay 2011-12-06 15:38:01 UTC
Specific suggestions. This affects the "first diagram" in F+O section 1.5.

Intro: "The first diagram and its corresponding table illustrate the "item" type hierarchy. In XDM, items include node types, function types, and built-in atomic types."

* delete the quotes around "item".

* replace "heirarchy" by "lattice"

* add the sentence: The types form a lattice because in the relationship expressed by the function derives-from(A, B), a type may be derived from more than one other type. For example, function(xs:string, xs:string) as xs:int is derived from (that is, substitutable for) both function(xs:Name, xs:Name) as xs:int and function(xs:NMTOKEN, xs:NNTOKEN) as xs:int. Equally, an atomic type A is substitutable for both union(A, B) and for union(A, C).

* add the qualification: The diagram does not attempt to illustrate the relationships of union types, and only gives a few illustrative examples of function types".

In the diagram:

* change XDM 1.1 to XDM 3.0

* In the stack of four (green) functions with a common parent, delete the fourth.
Comment 4 Jim Melton 2011-12-06 18:48:11 UTC
In comment 3, two items affect the diagram itself:

In the diagram:

* change XDM 1.1 to XDM 3.0

* In the stack of four (green) functions with a common parent, delete the

I had previously changed "XDM 1.1" to "XDM 3.0" (be sure to update your local CVS directories, including .../qtspecs/specifications/images/).  I have deleted the fourth green function box (and slightly shortened the line to which it was attached). 

NOTE: I did *not* change the title of the diagram to replace the word "Hierarchy" with "Lattice", but wonder if that change should be made.  If so, I'm happy to make that additional change. 

I presume that Mike, as F&O editor, will make the changes specific to the F&O spec, although I'm happy to make them if he prefers.

QUESTION: Should corresponding changes be made to the XDM 3.0 spec as well?
Comment 5 Jim Melton 2012-01-11 19:32:26 UTC
At their joint teleconference on 2012-01-10, the WGs decided not to change the title of the diagram (see the NOTE in comment 4), and decided that the text of XDM 3.0 should be changed corresponding to the changes made to F&O 3.0 described in the comments on this bug.  I am not marking the bug RESOLVED yet, pending completion of the changes to XDM 3.0.
Comment 6 Norman Walsh 2012-02-20 13:39:31 UTC
Fixed in DM.