[tmcl-wg] Topic Map Constraint Language and Schematron

Dmitry tmcl-wg@isotopicmaps.org
Mon, 12 May 2003 20:17:03 -0400


From: "Lars Marius Garshol" <larsga@garshol.priv.no>
> My feeling so far has been that we would probably be best off if we
> could provide a combination of some more declarative/implicit language
> (like OSL[1] in general approach, if not necessarily in detail). To
> this end I put together a trivial proposal for extending OSL with such
> a capability. Basically the <topic> element would have had two
> additional element(s)
>
>    <assert>
>      <constraint>...tolog query here...</constraint>
>      <message>...error message here...</message>
>    </assert>
>
> and a similar <deny> where the former would require at least one match
> to the query and the latter none. These constraints would implicitly
> apply to all topics of the defined class. (One might perhaps also
> allow these elements to appear within the <schema> top-level element.)
>
> That was basically a dump of the contents of my brain relating to this
> subject. Would be interested to hear what anyone thinks of it. :)
>

I was thinking about reusing of XPath concept in TMCL. XPath allows
efficiently reference objects without explicitly naming them.
In logic functors are used for the same purpose.

So let's do XPath not by XML document structure but by TAO data model...

We can call it TAOPath (or TPath) in  this case :-)

So we can have something like this

type&any::person/playsrole&any::person/association&any::bornIn/role&any::pla
ce

and make statements like this (Prolog style):

hasType(type&any::person/playsrole&any::person/association&any::bornIn/role&
any::place,
              type::[country or county or city])@userconfirmed.
or

areDifferentTopics(association&any::haveBorders/role&set::country))@definedI
nTMCLSchema(psi("http://www.sometmclschema.org")).

or
numberOfMax(association&any::bornIn/role&set::who,1)@inherited.
numberOfMax(association&any::bornIn/role&set::who,1)@infered.
numberOfMax(association&any::bornIn/role&set::who,1)@decision.

I introduced two modifiers here:
- any - gives access to "any object such as..."
- set -  gives access to "set of all objects such as ..."

So for example:
association&any::bornIn means "any association of type bornIn"
association&any::bornIn/role&any::who means "any role player of role 'who'
of any assocoation of type 'bornIn'"
association&any::bornIn/role&set::who  means "set of all players of role
'who' of any assocoation of type 'bornIn'"

We can define 'any' as default, so we can use simplified form:
numberOfMax(association::bornIn/role&set::who,1)@definedInTMCLSchema(psi("ht
tp://www.sometmclschema.org")).

Anyway, I was just playing with this "TAOPath" when I saw emails from Rick
and Lars.

Just a thought...

Dmitry