[tmcl-wg] Topic Map Constraint Language and Schematron

Rick Jelliffe tmcl-wg@isotopicmaps.org
Mon, 12 May 2003 19:44:09 +1000


WG members may be interested in a possible tie-in between Schematron and =
TMCL.

Schematron is a schema language being standardized as Part 4 of ISO =
DSDL.

It provides a general skeleton for any rule-based constraint languages. =
By default
it uses XSLT1's XPaths for its terms, however that does not have to be =
the case.
Indeed, there have been implementation of Schematron with subsets (such =
as
simple XPath) of XSLT, supersets (EXSLT), and completely different query =
languages
(e.g. Libby Millar's use of the RDF query language Squish in =
Schemarama).

Note that this reflects your WG's approach somewhat: you could pretty =
much
develop TCQL (in a compact syntax) as the query language and embed it in
Schematron.=20

Schematron seems to hit a sweet spot in that it uses elements for the =
rules
framework, but attribute values (in some non-XML notation) for the =
actual
constraints involved.=20

Schematron has been used for automatically generating Topic Maps, =
linking
descriptions of found patterns to their occurrences in a some sampled =
set.

The basic overview of Schematron is

schema
    pattern =20
        rule@context
            assert@test

A schema contains patterns. By default, all patterns are checked =
against.
A pattern contains rules. The first rule (lexically) in each pattern
whose context matches the candidate information item being validated
fires.  When a rule fires, all the assertions in it are tested.=20

The context and the test attributes can use any query language, over any
domain of information items. What they provide is a convenient way
of simplifying or factoring out complex assertions.

Schematron also provides other useful infrastructure, such as =
customisable
diagnostics, dynamic schemas (phases) and a simple macro mechanism
for abstractions (abstract patterns).   A simple <let> mechanism allows
the definition of variables to further simplify tests.=20

Resources for Schematron are at http://www.ascc.net/xml/schematron

Cheers
Rick Jelliffe