I think that the following cannot be considered as bug, but I will appreciate it, if someone could explain "why, when you define an InstanceOf" three topics with subjectIndicatorRef xlink:href "points" to the "http://www.topicmaps.org/xtm/1.0/index.html#psi-at-class-xxx" are being created ?
The three new topics are created to type an association between the topic which defines the type (the class) and the topic which is typed (the instance). This is the XTM-defined way of asserting the class-instance relationship (the <instanceOf> tag is actually just a short-cut for creating the association).
In TM4J, all type relationships between topics result in the automatic creation of an association as well. This means that if you were to do t2.getRolesPlayed() or t1.getRolesPlayed() at the end of your example code, you should find that the resulting collection is not empty.
Kal
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think that the following cannot be considered as bug, but I will appreciate it, if someone could explain "why, when you define an InstanceOf" three topics with subjectIndicatorRef xlink:href "points" to the "http://www.topicmaps.org/xtm/1.0/index.html#psi-at-class-xxx" are being created ?
To be more specific, here is a simple code:
public static void main(String[] args) {
TopicMapFactoryImpl tmfi = null;
TopicMap tm = null;
tmfi = new TopicMapFactoryImpl();
tm = tmfi.createTopicMap();
try {
Topic t = tmfi.createTopic("myTopic01");
Topic t2 = tmfi.createTopic("myTopicID2");
//create instanceOf
t2.addType(t);
}
}
Check this out, it you'll understand what I mean.
Thanks in advance
Ioannis
Hi Ioannis,
The three new topics are created to type an association between the topic which defines the type (the class) and the topic which is typed (the instance). This is the XTM-defined way of asserting the class-instance relationship (the <instanceOf> tag is actually just a short-cut for creating the association).
In TM4J, all type relationships between topics result in the automatic creation of an association as well. This means that if you were to do t2.getRolesPlayed() or t1.getRolesPlayed() at the end of your example code, you should find that the resulting collection is not empty.
Kal