[tmcl-wg] TMPath and Schematron-like validation for TMs
Dmitry
tmcl-wg@isotopicmaps.org
Tue, 6 Jan 2004 21:17:05 -0500
----- Original Message -----
From: "Lars Marius Garshol"
To: <tmcl-wg@isotopicmaps.org>
Sent: Tuesday, January 06, 2004 11:59 AM
Subject: Re: [tmcl-wg] TMPath and Schematron-like validation for TMs
> 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.
Yes, I just try to follow this Schematron-like idea to some logical end.
> 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.
I have no problem with that. I just think that if we can have "compact
schema" syntax we can aslo have "compact rule" syntax.
> 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.
Agree, I never thought about Schematron-like idea as "full" TMCL. Just
"nice" way to package complex validation rules.
> 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,
Agree, your sample demonstrates nicely why "schema" part is important.
Schema firstly defines "what is possible/expected" if topic/association has
a specific type.
If we have type schema we know "what is possible" (well...and what is not)
and we need only to add constraints to "what is possible" to shape it.
> 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.
Agree, rule-based constraints are only good as "additional", "peripheral"
constraints which can help to catch complex dependencies (for example,
including 3,4 paths/steps from main type node).
> 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.
Agree
Dmitry