From: Kal A. <ka...@te...> - 2001-06-29 09:00:58
|
> > The following situation: I have: > > - Topic A > > - Topic B > > - Association C > > - C is of type B > > - B is of type A > > Does this mean that C is of type B *and* A or is it only of type > B ? TM4J currently implements the second case. > 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. > And where is the difference between the base topic and the types > of a topic ? > The base topic is a construct that has no direct mapping to the XTM spec. In the in-memory implementation, topic B gets merged with topic A by getting added to the mergedTopics list property of A. Then, when A is asked for its characteristics (such as names, occurrences, types or roles played in associations), it will return the aggregate of all of its merged topics. For this to work properly and for the "demerging" of topics to be supported, the merged topics must also know which topic it is that they are merged with, so the baseTopic property is really a back-pointer to the topic which is serving as the "container" for all of the merged topics. Hope this makes sense - I haven't finished my coffee yet...;-) Cheers, Kal |