vacuous and non-vacuous chains of override (was Re: [Bug 12184] Circularity in xs:override)

On Mar 11, 2011, at 10:47 AM, Henry S. Thompson wrote:

>> ...
> 
> In this connection, rereading the status quo section 4.2.5 [1], I am
> struck by a apparent (?) contradiction between the newly added text,
> beginning "If the above definition is naively translated. . ."  (now
> the first real Note after the override element tableau) and the _last_
> (third) Note after the definition of *target set*, which appears to
> _also_ be intended to address to the problem of circular chains of
> overrides.
> 
> The latter appears to say that only vacuous chains, i.e. those with no
> effective overriding children, are allowed.  



This is the second in a series of three replies to Henry's message.

Henry writes

    The [note beginning "It is not forbidden for the schema document D
    containing an <override> element E to be in the ·target set· of
    E"] appears to say that only vacuous chains, i.e. those with no
    effective overriding children, are allowed.

For brevity, call this proposition P. This note discusses why I
believe P to be false.

First let's examine what the note says.

    If applying the override transformation specified in
    Transformation for xs:override (§F.2)to D and E results in a
    schema document equivalent to D (e.g. when none of the[children]
    of D, or of any <redefine> and <override> elements in D match any
    of the[children] of E, except for the [children] of E themselves),
    then the effect is the same as for a cyclic set of <include>
    references, or as for multiple inclusions of the same document (as
    described in the note at the end of Assembling a schema for a
    single target namespace from multiple schema definition documents
    (<include>) (§4.2.3)).

The first reason to doubt P is superficial: A sentence of the form "If
[condition] ... then the effect is the same as [situation]" does not,
on the face of it, say anything at all about what is allowed and what
is not allowed.  It only says that document graphs of a particular
shape have the same effect as document graphs of another shape.

I don't see anything in the note that talks about things being allowed
or not allowed.

The second reason to doubt P is that the situation it describes is not
limited to cases of vacuous override chains.

Rereading the note now I think it's a little narrow, and focuses on a
special case instead of the general case, but for now let us leave the
general case aside for the moment and focus on the case
described. Perhaps I can illustrate why I don't think the note applies
only in the case of "vacuous chains, i.e. those with no effective
overriding children".

Consider test 23, which is summarized using the algebraic notation
introduced in section 4.2.1 of the XSD spec in the post

http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2011Feb/0014.html

We have schema document A = over023.xsd and B = over023a.xsd.

  A overrides B with E1 (which delares element doc as xsd:date).
  B overrides A with E2 (which is vacuous).

Imagine that we are starting with document A and seek to calculate
schema(A).

The target set of E1 includes

  override(E1, B)
  override(E2', A)
  override(E1', B)

But note that because E2 is empty, E2' = E1, and that E1' = E1.  So
another way to write the target set of E1 is

  override(E1, B)
  override(E1, A)

Now the condition in the note is satisfied: override(E1, A) is
equivalent to A.  And the situation is analogous to that described in
the discussion of cyclic includes: the set of schema documents you
have, which have a cycle, is equivalent to (calculates the same schema
as) a similar set of schema documents in which the last link is
missing.

But note that although the condition described in the note does apply,
it is not the case that the override chain is vacuous: E1 contains a
declaration (of element doc) which does override the corresponding
declaration in document B.

If we start with B instead of A, and calculate schema(B), then we get
a different result: the target set of E2 is

  override(E2, A)
  override(E1', B)

The condition described in the note does not apply: override(E1',B) is
not equivalent to B, and if we process both of them, then we end up
with two conflicting declarations for doc, which is exactly what the
third paragraph of the note is trying to say.  (Judging by your
reaction, I gather that it is meeting with only imperfect success.)

More on the general case of override chains in another note.



-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************

Received on Friday, 11 March 2011 19:36:31 UTC