[tmql-wg] Re: [topicmapmail] AsTMa! as TMCL
Kal Ahmed
kal@techquila.com
Fri, 13 Dec 2002 09:51:35 +0000
On Thursday 12 December 2002 17:15, Lars Marius Garshol wrote:
> * Kal Ahmed
>
> | 1) There is nothing in the document about the treatment of
> | conflicting constraints. Especially where a topic may have multiple
> | types, it could be quite easy to end up with such conflicts. There
> | should be some form of resolution (perhaps precendence rules based
> | on file order ?)
>
> We had this issue in OSL as well, and the language allows you to say
> what other classes instances of a particular class are allowed to be
> instances of. This is necessary in order to avoid having people make
> statements like "Puccini is a composer and a city", which might
> otherwise go through with no problem.
>
That sounds like it might be a good basis to start from with constraining=
=20
topics by class.
> This is rather tricky to deal with in practice, however. We arrived at
> the conclusion that if A is an instance of B and C that must mean that
> it has to conform to the constraints on both. We've implemented it
> that way, but in a way that is not optimal.
>
> The problem is that there's no guarantee that the constraints on B and
> C are compatible. It's perfectly possible for the constraints to be
> phrased in such a way that no instance can conform to both at the same
> time. Our implementation does not detect that, but it should.
>
There is a problem here that in the absence of a fixed set of classes, no=
=20
implementation will ever be able to detect all possible constraint confli=
cts=20
at "compile" time in any meaningful way - conflicts could only be detecte=
d at=20
the time that the topic map containing the class instances is presented.
> | 2) There are no provisions for quantitative constraints (e.g. an
> | association of type 'has-natural-children' must contain no more than
> | two 'parent' role-players)
>
> OSL has this.
>
> | 3) As a smaller niggle, why do regular expressions which contain a /
> | character require a different syntax to other regex's when Perl
> | regex's allow / to be escaped ?
>
> OSL doesn't have this problem, because it doesn't have regular
> expressions at all. :-)
>
I can see a couple of useful "usecases" for regex constraints on string v=
alues=20
such as resourceData and baseNameString, such as validating that a=20
"sort-name" variant is actually in the expected normalized form, or that =
a=20
"postcode" occurrence is in the expected form etc. I guess that the=20
discussion on regex constraints goes hand-in-hand with the discussion on=20
datatype constraints...
> | As an aside, it is interesting that most constraint language
> | proposals involve the creation of a new syntax for their
> | expression. Having started down the road of developing a constraint
> | language using XTM syntax (based on the original work done by Steve
> | Newcomb and Michel Biezunski on association templates), I am aware
> | of the verbosity of such a solution, but it would be nice to see
> | if/how a constraint language such as AsTMa! could be mapped into
> | topic map constructs (even if the original AsTMa! syntax is
> | retained).
>
> Very much agreed. I've wanted to create an OSL -> topic map mapping
> for a long time, but have been unable to find the time to do it. I
> think this would be an important piece of work, as it would help us
> find out how feasible/useable this approach would be.
Perhaps working from OSL and taking the additional features of AsTMA! int=
o=20
account one could have a suitable constraint model to start working on=20
expressing in topic map form ? Something to think about over the christma=
s=20
dinner perhaps ;-)
Cheers,
Kal
--=20
Kal Ahmed, techquila.com
XML and Topic Map Consultancy
e: kal@techquila.com
p: +44 7968 529531
w: www.techquila.com