From: Kal A. <ka...@te...> - 2001-06-29 11:33:11
|
> > C is only an association of type B. B is an instance of the > class A, but A > > is not a superclass of C. Sounds confusing ? :) > > > > The <instanceOf> element (which translates to the type or types > attribute) > > specifies a class-instance relationship. Topic maps are a powerful > > information modelling tool because they allow a topic to be > both a class and > > an instance of a class. > > > > You can model the subclass-superclass relationship by using an > association > > with the XTM-defined PSIs which you will find declared as constants in > > com.techquila.topicmap.PSI. To get the supertypes of a topic, > you need to > > first go to its type(s) and then for each of them, traverse the > > subclass-superclass association to find superclasses. > > Okay, sound reasonable. Interesting point: What happens with > cyclic dependencies ? E.g. A instanceof B, B instanceof C, > C instanceof A. Nobody bars you to model this, but it could cause > problems while processing. > It is true that you could get problems from this kind of dependancy loop - though I think that different applications would have different ways of wanting to handle it. I don't think that TM4J would have a problem - there are relatively few functions which perform any kind of traversal, but an editing application or a display application would need to be able to handle cycles in the topic map model. One thing that would be useful in a suite of topic map tools would be utilities to discover these kinds of problems and report on them - perhaps something like that should go into the command-line utilities package. This raises another question: What other kinds of problems should a "topicmap lint" application report on ? I would be interested in peoples' thoughts on this... Cheers, Kal |