[tmcl-wg] TMPath and Schematron-like validation for TMs
Lars Marius Garshol
tmcl-wg@isotopicmaps.org
06 Jan 2004 17:59:36 +0100
* dmitryv@cogeco.ca
|
| I tried to investigate how TMPath (XPath-like language) can be used
| as a basis for Schematron-like validation engine for TopicMaps
This looks rather similar to the TMCL strawman proposal put forward by
the editors in N0408, but with some differences:
a) there's a separation between selector and constraint,
b) a custom error message can be provided, and
c) it is not represented as a topic map.
I quite like the idea of custom error messages with embedded TMQL
expressions to produce the message. I also think separating the
selector and the constraint probably will make the schemas easier to
read.
I think, however, that if this could be represented as a topic map,
and I think it can be quite easily, following a similar model as that
in the TMCL strawman, that would be a distinct advantage.
The main objections I have to TMatron are the same as the ones I'm going
to put forward against the TMCL strawman:
- no support for introspection, and
- actually writing a complete schema that contains *all* the
constraints is going to be laborious in the extreme.
Most things aren't allowed, yet here we are required to state all of
the things that aren't allowed. To use the opera TM as the example
we'd have to say things like:
- if you're not a person,
then you can't have a date of birth,
- if you're not a person,
then you can't have a date of death,
- if you're a person,
then you can't be a city,
- if you're a person,
then you can't be a country,
- ...
If you forget something here you'll have a hole in your schema, and
there will be no easy way to see that you've got one.
What I'm getting at is that I think we need a combination here:
1. A declarative language a la OSL or AsTMa! for laying down the
basic skeleton of the allowed structure
2. Support for asserting complex constraints with TMQL
TMatron looks like a good way to do the second, but I don't think it
can go all the way.
--
Lars Marius Garshol, Ontopian <URL: http://www.ontopia.net >
GSM: +47 98 21 55 50 <URL: http://www.garshol.priv.no >