[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] RNG vs. XSD : is the use of abstract types andpolymorphism a good or bad thing for schemas for XML?
- From: Norm Birkett <Norm.Birkett@reval.com>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Tue, 13 Mar 2012 13:10:46 +0000
Roger,
While there may be something to what you're saying--my experience of XML and XML Schema is much too narrow to say--it does seem to me that you're committing a number of category errors here (as in many of your previous posts on syntax and semantics). Let me try to sketch an alternative vision, using a poor-man's plain-text formalism:
Syntax:
(1) XML is a language ("XML"). (Please take "language" here in its standard sense as used in formal language theory, mutatis mutandis.)
(2) It is also, therefore, an infinite set of languages, { XL1, XL2, XL3, ... XLn ... }, each a subset of XML. Some of these are useful to someone, most aren't (in many cases just because they haven't been thought of, and in many more cases because they're lousy languages; please take "lousy" as an undefined primitive predicate to which a variety of intuitive notions may be attached).
(3) An XML schema language is used to define particular XML-subset languages. It does this by defining a test for well-formed-documenthood in the definiendum ("[language] to be defined").
(4) The objects modeled in an XML schema language are syntactical objects in the XML-subset languages it will be used to define.
(5) There are various ways an XML schema language can describe its objects. A highly inefficient but instructive one, for instance, would be an enumeration of the all the well-formed documents in the definiendum. A more sophisticated approach might employ some notions or notions of type, which is just some sort of pattern, more or less detailed in its description. Yet more sophisticated approaches might classify or parameterize those types in various ways. In any event, there is a large body of literature on grammars and what kinds of languages they can model. (See "Chomsky hierarchy" in any formal grammar textbook or reference.)
Semantics:
(A) The semantics of a language can be usefully defined as the set of mappings of "meanings" (we'll leave that deliberately vague) that are mapped onto the language's constructs by users of the language.
(B) Any language that employs words or other meaningful constructs from some other widely used language (such as English) will therefore have a semantics, except in the unusual case in which all its users are unfamiliar with the widely used language.
(C) The syntax of a language limits what kinds of assertions (etc.) about its semantic objects can be expressed in that language.
Some theses about XML that follow:
(T1) The ways a particular XML schema language permits its users to describe its objects (see 4 and 5) have indirectly to do with the semantic ranges of its definienda (by 5 and C).
(T2) Because XML schema languages generally include lots of XML tags from their definienda, and because those tags are generally drawn from widely-used natural languages, a fair smattering of the definiendum's semantics is to be found in the typical XML schema language instance (by B).
(T3) It will be easy for humans, with all their capacity for muddleheadedness as well as connection-making and understanding, to suppose at times when working in an XML schema language that they are saying something about the semantics of the definiendum (by all of the above); in many cases this will be benign (by common observation).
(T4) In contexts in which precision on these points matters, it would be a good thing for the designer of an XML subset language to insure he gives the language sufficient syntactical resources to do its intended semantic job (see C) and to try to avoid loading up the language with unintended, extraneous, or damagingly ambiguous meanings (see B); it would also be a good thing for the writer of any grammar for that language to understand that his job is to define the syntax of the definiendum as clearly and precisely as possible, and to use a grammar language (such as an XML schema language) that will support the project's practical implementation requirements as well as possible. (All of which follows from the general principle that a person who understands what he's doing will frequently do a better job than a person who doesn't.)
Beyond that, I don't think you can go without risk of ideological-purity-unto-irrelevance (see Ron "Consistency" Paul, e.g.)
Norm Birkett
> -----Original Message-----
> From: Costello, Roger L. [mailto:costello@mitre.org]
> Sent: Tuesday, March 13, 2012 7:30 AM
> To: xml-dev@lists.xml.org
> Subject: RE: [xml-dev] RNG vs. XSD : is the use of abstract types and
> polymorphism a good or bad thing for schemas for XML?
>
> Hi Folks,
>
> I have been thinking about the issue of "inheritance" in schema
> languages for XML.
>
> Recall that James Clark says (paraphrasing) that it is not the role of
> a schema language to model conceptual or semantic relationships such as
> inheritance. Such relationships are best modeled elsewhere.
>
> That makes sense to me. Separation of concerns is a good thing. Use a
> schema language to define a template for syntactic organization. Using
> my chocolates example, use a schema language to show the organization
> of boxes (elements) and what chocolates (data) goes into each box.
>
> Use other technologies for expressing relationships and meaning -- use
> ontologies, data specifications, UML, etc.
>
> That's a nice, clean separation of concerns. That yields more
> productivity and better results. (Adam Smith, Wealth of Nations)
>
> I wonder why XML Schemas ever introduced inheritance machinery (derive-
> by-extension, derive-by-restriction, element substitution) into the
> language? The inheritance machinery muddies things up. It results in
> XML Schema trying to be both a language of expressing syntactic
> template and a poor man's pseudo UMLish relationship ontology language.
>
> This muddiness has created enormous confusion over the years.
>
> "XML Schema is just syntax."
>
> "No, XML Schema is semantics, just look at the meaning in this
> inheritance tree."
>
> It seems that the prudent path is to avoid all inheritance machinery in
> XML Schema.
>
> Don't use derive-by-extension, derive-by-restriction, and element
> substitution . Use XML Schema just for expressing templates of elements
> and attributes.
>
> Use ontologies, data specifications, UML, etc. for expressing
> relationships and meaning.
>
> Thoughts?
>
> /Roger
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]