From: Wang, D. <dwa...@ws...> - 2006-05-30 17:30:44
|
Hi Kal, =20 Thanks.. I have solved this problem by sorting the Tologresults Table = item instead of using the default sorting algorithm. It works fine for = me now. One more question is from another bulit-in predicates: /=3D for = example: =20 query =3D select $TOPIC1, $TOPIC2 from role-player($ROLE1,$TOPIC1), association-role($ASSOC,$ROLE1),association-role($ASSOC,$ROLE2), type($ASSOC,"relationshipTypeID"), role-player($ROLE2,$TOPIC2), $TOPIC1 /=3D $TOPIC2 ; In this query, I give an relationship type and find out all realted = role players.=20 Given a RelType : Simliar to =20 =20 Return : Role1 Role2 Beer Wine Wine Beer is there any way to filter out one of these 2 results? Or is it normal = to see the results like this?=20 My wonder is when the results getting really large, it might looks = pretty redundant. I guess the problem might be something regarding to = the concept: bound varialbe. =20 I am really not quite clear about that, could you give some help to = solve my problem. =20 I appreciate.. =20 =20 Dandan =20 =20 =20 =20 ________________________________ From: Kal Ahmed [mailto:ka...@te...] Sent: Mon 5/29/2006 7:39 AM To: Wang, Dandan Cc: tm4...@li...; he...@se... Subject: Re: [TM4J-users] Sorting in Tolog Hi Dandan, The default sorting algorithm is not exactly clever - if you sort a variable that binds to TopicMapObjects (like $TYPE binds to Topics in your query), then the sort order is by the ID property of the topics. Are you seeing the results at least grouped together by type (even if the types are not necessarily in the order you expect) ? Or are you seeing them all mixed up ? Cheers Kal Wang, Dandan wrote: > Hi All, >=20 > I am working on the Tolog Query implementation. My problem is, > the returned tolog resultsets can not be sorted , even if I use the > "order by" clause. > for example: > query =3D "select $TYPE, $VALUE from occurrence(topicID, = $OCC),type($OCC, > $TYPE), value($OCC, $VALUE) order by $TYPE ?"; >=20 > for this query, the returned tologResultSets showing in a JTable will > not be ordered by ascending $TYPE. >=20 > I also did some similar experiments in the TMNav, seems it has the = same > problem. >=20 > I would appreciate if anybody could give me some hints.. >=20 >=20 > Dandan >=20 |