Re: A really micro schema language

Michael Kay scripsit:

> I think the key to having a really small schema language is that it
> must extend gracefully to be capable of expressing complex
> constraints.

I almost, but not quite, entirely disagree.  For me, semantic simplicity
is all about allowing only a few things and then making the most of them.
What makes MicroXML different from XML is that the latter is full of
bells, whistles, and gongs that the former lacks.  Each such decoration
has its uses, but it is precisely the need to support all of them that
might be present in a specific document that constitutes the complexity
tax that (as I believe) makes potential users shy away from XML as a
conceptually unintegrated mess.

> That could be as simple as adding a clause like
> 
>   person/@date[. castable as xs:date]
> 
>   car/@colour[. = ('red', 'green', 'blue')]
> 
> where the square brackets contain an assertion in the form of an
> arbitrary XPath expression.

The notions of "simple" and "arbitrary XPath expression", especially
XPath 2.0, simply do not go together for me at all.  There is nothing
simple about XPath.

> If you had this, I think you could dispense with // outside the brackets:
> 
>   form[not(.//form)]
> 
> For such clauses to be useful to an editor, of course, it would have
> too look for common patterns in the XPath expression to recognize
> things such as enumerations; but that's not demanding too much, I
> think.

What you seem to be talking about here is syntactic simplicity on top
of the same old complex model, a minimization of the surface form.
That would be in accord with a MicroXML founded on the XDM, but it was
the XDM that James and I set out to simplify in the first place: the
syntax of MicroXML is just a reasonably flexible syntax layered over
the simplest data model that could possibly work.

I believe there's an easy trap to fall into here, one that I have fallen
into many times myself.  When we are intimately familiar with every
detail of a complex model, we begin to see it as simple, because we
ourselves know exactly how to do all of it.  But the fact that we're able
to internalize such a model in all its complex beauty does not make it
necessary or appropriate for everyone to have to do so.

What is useful is to allow an escape saying that Here There Be Dragons:
everything between { and }, perhaps, is implementation-specific add-ons
outside the simple syntax and model of a "really micro schema language".
Not allowing that crosses the line from simple to too-simple.

-- 
They tried to pierce your heart                 John Cowan
with a Morgul-knife that remains in the         http://www.ccil.org/~cowan
wound.  If they had succeeded, you would
become a wraith under the domination of the Dark Lord.         --Gandalf

Received on Tuesday, 18 December 2012 11:02:50 UTC