You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(22) |
Jul
(4) |
Aug
(9) |
Sep
(6) |
Oct
(5) |
Nov
(15) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(4) |
Feb
(10) |
Mar
(12) |
Apr
(16) |
May
(2) |
Jun
(7) |
Jul
(10) |
Aug
(9) |
Sep
(3) |
Oct
(17) |
Nov
(17) |
Dec
(6) |
2003 |
Jan
(12) |
Feb
(15) |
Mar
(25) |
Apr
(20) |
May
(8) |
Jun
(3) |
Jul
(21) |
Aug
(10) |
Sep
(7) |
Oct
(1) |
Nov
(3) |
Dec
(6) |
2004 |
Jan
(5) |
Feb
(16) |
Mar
(34) |
Apr
(26) |
May
(20) |
Jun
(58) |
Jul
(76) |
Aug
(51) |
Sep
(40) |
Oct
(16) |
Nov
(7) |
Dec
(6) |
2005 |
Jan
(10) |
Feb
(1) |
Mar
(17) |
Apr
(8) |
May
(11) |
Jun
(15) |
Jul
(1) |
Aug
(7) |
Sep
(6) |
Oct
(10) |
Nov
(14) |
Dec
(9) |
2006 |
Jan
(11) |
Feb
(22) |
Mar
(17) |
Apr
(1) |
May
(15) |
Jun
(9) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(10) |
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2008 |
Jan
(2) |
Feb
(1) |
Mar
(8) |
Apr
(8) |
May
(12) |
Jun
(9) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bret C. <bre...@ya...> - 2004-07-29 20:57:01
|
Christoph (Armin?...), Here's an old email I never got around to sending you that specifies some of my problems getting tolog to work with the Tolog Panel in TMNav: I'm using tmnav 0.2.7a1-src, as you earlier suggested to me, and queries entered in the TologFramePanel either work inconsistantly or not at all. When I try entering queries about instance_of I get various responses to the query (sometimes to the very same query and to queries that work with the TM4J base) including: no response at all, a result set (and result set icon), a result set icon only, a result set icon with the number 1. In particular, I'm unable to develop a successful query with the other built-in predicates listed in the Ontopia Tolog Tutorial (http://www.ontopia.net/omnigator/docs/query/tutorial.html#d0e1044, section 2.5) such as association($ASSOC) & association-role($ASSOC, $ROLE1), for example: select $ASSOC from role-player($ROLE1, x), association-role($ASSOC, $ROLE1), association-role($ASSOC, $ROLE2), role-player($ROLE2, y)? It appears that I'm also unsuccessful when I use all variables (such as $ASSOC) in a query, rather than a mix of variables and topic references. I'm using my own topic map XTM file & could send a copy if necessary. Bret --- Bret Cohen <bre...@ya...> wrote: > Armin, > > I'm not speaking from experience here, and this > suggestion is probably way off track, but have you > checked the section on Property Change Listeners > <http://tm4j.org/tm4j/docs/devguide/ch05s04.html> in > the TM4J Developer's Guide? > > I'm going to be using tolog myself soon, so I'll > probably be falling into the same sets of problems. > > By the way, I'm curious if you or Christoph know > about > how to discover which versions of TM4J and TMNav use > which versions of Tolog. For example, I did some > preliminary testing of TMNav 0.2.7a1-src, and it > doesn't seem like Tolog 1.0 and it's built-in > predicates are supported. (I don't have my test code > easily available however.) Nor does TM4J src-0.9.4 > (I > must admit that being a rookie I've never yet > mastered > the use of CVS.) > > Bret > > > Message: 1 > > From: "Armin Wagenknecht web.de" > > <arm...@we...> > > To: <tm4...@li...> > > Date: Wed, 28 Jul 2004 23:09:54 +0200 > > Subject: [TM4J-users] tologx-query does not find a > > topic in the topicmap > > > > This is a multi-part message in MIME format. > > > > ------=_NextPart_000_0054_01C474F7.FE587290 > > Content-Type: text/plain; > > charset="iso-8859-1" > > Content-Transfer-Encoding: quoted-printable > > > > Hello, > > > > I use the tologx-package to query my topicmap. > > The topicmap is stored only in memory and is > wirtten > > to an xtm-file on = > > my harddisk during and at the end of the session > of > > my application. > > When I load the M > > map and create a new topic with id: test_id , an > > directly after this, I = > > try to use this topic in a query, I get an error, > > that there does not = > > exist a > > topicmap-object with the subject-indicator: > test_id. > > > > If I reload the map after creating the topic, the > id > > is recognized by = > > the query-engine. > > > > How can I get the query-engine to "know" the new > > topic immediately after = > > its creation? > > > > I hope somebody can help. > > > > Thanks > > > > Armin Wagenknecht > > TU Darmstadt Germany __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail |
From: Bret C. <bre...@ya...> - 2004-07-29 20:34:56
|
Armin, I'm not speaking from experience here, and this suggestion is probably way off track, but have you checked the section on Property Change Listeners <http://tm4j.org/tm4j/docs/devguide/ch05s04.html> in the TM4J Developer's Guide? I'm going to be using tolog myself soon, so I'll probably be falling into the same sets of problems. By the way, I'm curious if you or Christoph know about how to discover which versions of TM4J and TMNav use which versions of Tolog. For example, I did some preliminary testing of TMNav 0.2.7a1-src, and it doesn't seem like Tolog 1.0 and it's built-in predicates are supported. (I don't have my test code easily available however.) Nor does TM4J src-0.9.4 (I must admit that being a rookie I've never yet mastered the use of CVS.) Bret > Message: 1 > From: "Armin Wagenknecht web.de" > <arm...@we...> > To: <tm4...@li...> > Date: Wed, 28 Jul 2004 23:09:54 +0200 > Subject: [TM4J-users] tologx-query does not find a > topic in the topicmap > > This is a multi-part message in MIME format. > > ------=_NextPart_000_0054_01C474F7.FE587290 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > Hello, > > I use the tologx-package to query my topicmap. > The topicmap is stored only in memory and is wirtten > to an xtm-file on = > my harddisk during and at the end of the session of > my application. > When I load the M > map and create a new topic with id: test_id , an > directly after this, I = > try to use this topic in a query, I get an error, > that there does not = > exist a > topicmap-object with the subject-indicator: test_id. > > If I reload the map after creating the topic, the id > is recognized by = > the query-engine. > > How can I get the query-engine to "know" the new > topic immediately after = > its creation? > > I hope somebody can help. > > Thanks > > Armin Wagenknecht > TU Darmstadt Germany > ------=_NextPart_000_0054_01C474F7.FE587290 > Content-Type: text/html; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 > Transitional//EN"> > <HTML><HEAD> > <META http-equiv=3DContent-Type > content=3D"text/html; = > charset=3Diso-8859-1"> > <META content=3D"MSHTML 6.00.2800.1226" > name=3DGENERATOR> > <STYLE></STYLE> > </HEAD> > <BODY bgColor=3D#ffffff> > <DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV> > <DIV><FONT face=3DArial size=3D2>I use the > tologx-package to query my=20 > topicmap.</FONT></DIV> > <DIV><FONT face=3DArial size=3D2>The topicmap is > stored only in memory = > and is=20 > wirtten to an xtm-file on my harddisk during and at > the end of the = > session of my=20 > application.</FONT></DIV> > <DIV><FONT face=3DArial size=3D2>When I load the > M</FONT></DIV> > <DIV><FONT face=3DArial size=3D2>map and create a > new topic with id: = > test_id , an=20 > directly after this, I try to use this topic in a > query, I get an error, = > that=20 > there does not exist a</FONT></DIV> > <DIV><FONT face=3DArial size=3D2>topic</FONT><FONT > face=3DArial = > size=3D2>map-object with=20 > the subject-indicator: test_id.</FONT></DIV> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV> > <DIV><FONT face=3DArial size=3D2>If I reload the map > after creating the = > topic, the=20 > id is recognized by the query-engine.</FONT></DIV> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV> > <DIV><FONT face=3DArial size=3D2>How can I get the > query-engine to = > "know" the new=20 > topic immediately after its creation?</FONT></DIV> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV> > <DIV><FONT face=3DArial size=3D2>I hope somebody can > help.</FONT></DIV> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV> > <DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV> > <DIV><FONT face=3DArial size=3D2>Armin > Wagenknecht</FONT></DIV> > <DIV><FONT face=3DArial size=3D2>TU Darmstadt = > Germany</FONT></DIV></BODY></HTML> > > ------=_NextPart_000_0054_01C474F7.FE587290-- > > > > --__--__-- > > Message: 2 > Subject: Re: [TM4J-users] tologx-query does not find > a topic in the topicmap > From: Christoph Froehlich <cf...@fo...> > To: "Armin Wagenknecht web.de" > <arm...@we...> > Cc: "tm4...@li..." > <tm4...@li...> > Date: Wed, 28 Jul 2004 23:54:53 +0200 > > Hi armin > > since kal is off for holidays (with no computer) I > will try to have a > look at this, though I have no experience with the > tologx package. > Therefor it would be really helpful for me, if you > could post a code > fragment (or much better a unit test), that I can > use to debug things. > > My first guess is that some index that is used by > the tolog system is > not updated automatically when you're creating a new > topic. If someone > on the list has other presumptions please > contribute!! Any suspicion is > most welcome. > > Bye > c > > Am Mi, den 28.07.2004 schrieb Armin Wagenknecht > web.de um 23:09: > > Hello, > > > > I use the tologx-package to query my topicmap. > > The topicmap is stored only in memory and is > wirtten to an xtm-file on > > my harddisk during and at the end of the session > of my application. > > When I load the M > > map and create a new topic with id: test_id , an > directly after this, > > I try to use this topic in a query, I get an > error, that there does > > not exist a > > topicmap-object with the subject-indicator: > test_id. > > > > If I reload the map after creating the topic, the > id is recognized by > > the query-engine. > > > > How can I get the query-engine to "know" the new > topic immediately > > after its creation? > > > > I hope somebody can help. > > > > Thanks > === message truncated === _______________________________ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com |
From: Lars H. <tm...@qu...> - 2004-07-29 11:39:37
|
Hi Armin, > map and create a new topic with id: test_id , an directly after > this, I try to use this topic in a query, I get an error, that > there does not exist a > topicmap-object with the subject-indicator: test_id. I think, "test_id" is the source locator, not the subject indicator. But code may be helpful. :) Maybe you can post the query? Best regards, Lars |
From: Christoph F. <cf...@fo...> - 2004-07-28 21:55:19
|
Hi armin since kal is off for holidays (with no computer) I will try to have a look at this, though I have no experience with the tologx package. Therefor it would be really helpful for me, if you could post a code fragment (or much better a unit test), that I can use to debug things. My first guess is that some index that is used by the tolog system is not updated automatically when you're creating a new topic. If someone on the list has other presumptions please contribute!! Any suspicion is most welcome. Bye c Am Mi, den 28.07.2004 schrieb Armin Wagenknecht web.de um 23:09: > Hello, > > I use the tologx-package to query my topicmap. > The topicmap is stored only in memory and is wirtten to an xtm-file on > my harddisk during and at the end of the session of my application. > When I load the M > map and create a new topic with id: test_id , an directly after this, > I try to use this topic in a query, I get an error, that there does > not exist a > topicmap-object with the subject-indicator: test_id. > > If I reload the map after creating the topic, the id is recognized by > the query-engine. > > How can I get the query-engine to "know" the new topic immediately > after its creation? > > I hope somebody can help. > > Thanks > > Armin Wagenknecht > TU Darmstadt Germany -- Christoph Froehlich <cf...@fo...> |
From: Armin W. web.d. <arm...@we...> - 2004-07-28 21:09:30
|
Hello, I use the tologx-package to query my topicmap. The topicmap is stored only in memory and is wirtten to an xtm-file on = my harddisk during and at the end of the session of my application. When I load the M map and create a new topic with id: test_id , an directly after this, I = try to use this topic in a query, I get an error, that there does not = exist a topicmap-object with the subject-indicator: test_id. If I reload the map after creating the topic, the id is recognized by = the query-engine. How can I get the query-engine to "know" the new topic immediately after = its creation? I hope somebody can help. Thanks Armin Wagenknecht TU Darmstadt Germany |
From: Kal A. <ka...@te...> - 2004-07-27 10:31:35
|
On Mon, 2004-07-26 at 09:45, Andy Peel wrote: > > Hi Andy, > > Hi, > > > I think I agree with pretty much everything you write. However, I do > > think that there is a slight problem in the way in which TM4J "hides" > > transaction/session control from the programmer. If you want to do > > things efficiently it is important to have a good grip on what is > > happening with the transactions. For example in some trials for a new > > TM4J datamodel, I found that separating lookups from updates gave a > > doubling of the processing rate for an import operation. > > Sure, transactions are heavweight, so people need to be careful how many > they're creating as it will have a big impact on performance. What would be > useful, as I've mentioned before, is a mechanism to allow developers to > provide an existing transaction for TM4J to use, and by implication, a > mechanism to share a given Hibernate instance. This would also make > integration with enterprise software less tricky. > That should definitely be a consideration for TM4J - in fact I think that is something that could be doable for TM4J 1.0. I'll definitely look into that. I've added a feature request to the tracker to remind me... > > That said, with respect to indexes, Hibernate does give a means of > > assigning indexes in the mapping file that the schema is generated from, > > so perhaps there is some scope for doing that (though in my tests it > > doesn't help import performance at all - I guess that is to be expected > > though, and I guess indexes would help other forms of more > > read-intensive processing). > > > > I suppose that I should document the schema mapping a bit more and spend > > some time writing up how all this works. I'm a bit reluctant to do that > > right now as I am actually in the process of redesigning TM4J from the > > ground-up to be a "native" TMAPI engine. I'll take the comment on board > > though and if I get time to do it for TM4J 0.9.x I will. > > That's not what I'm suggesting - in an ideal world I think the schema should > remain a mystery to users calling the API. Then the schema can vary without > users having to worry about it. > Certainly in an ideal world developers should be completely shielded from the underlying database schema, but I could see cases where a developer might want to query the data directly (using HQL or SQL) as an efficiency measure. One aim with the TM4J 2.0 will be to support a query language (probably tolog) being directly translated into HQL, but even then there could be cases where knowing the database schema would enable a developer to write their own more compact/efficient query for a particular use case. Cheers, Kal -- Kal Ahmed <ka...@te...> techquila |
From: Kal A. <ka...@te...> - 2004-07-27 10:02:47
|
Hi all, Just to let you all know I'm going to be on holiday (with no computer!) for a couple of weeks starting from tomorrow, so its going to be very quiet from this end... Cheers, Kal -- Kal Ahmed <ka...@te...> techquila |
From: Kal A. <ka...@te...> - 2004-07-27 10:00:41
|
Hi Armin, An open match (with two variables) for the resource() predicate was not supported. The problem is that TM4J does not have the right indexes to support this kind of query at the moment. I plan to add support for that into the next version of TM4J. However I have just checked in a basic implementation that iterates through all of the objects in the topic map to do this query. So there is now an implementation, but it is not very efficient. The next version of TM4J should add the indexes needed to implement this more efficiently. Cheers, Kal On Tue, 2004-07-27 at 10:04, Armin Wagenknecht web.de wrote: > Hello, > > I tested the resource($OBJECT, $LOCATOR) predicate of tologx with > occurrences of my TopicMap. > Unfortunately I did not get any results. > Perhaps, there could be a bug in the source-code. > > Cheers, > > > Armin -- Kal Ahmed <ka...@te...> techquila |
From: Armin W. web.d. <arm...@we...> - 2004-07-27 09:03:03
|
Hello, I tested the resource($OBJECT, $LOCATOR) predicate of tologx with = occurrences of my TopicMap. Unfortunately I did not get any results. Perhaps, there could be a bug in the source-code. Cheers, Armin |
From: Andy P. <an...@il...> - 2004-07-26 08:45:09
|
> Hi Andy, Hi, > I think I agree with pretty much everything you write. However, I do > think that there is a slight problem in the way in which TM4J "hides" > transaction/session control from the programmer. If you want to do > things efficiently it is important to have a good grip on what is > happening with the transactions. For example in some trials for a new > TM4J datamodel, I found that separating lookups from updates gave a > doubling of the processing rate for an import operation. Sure, transactions are heavweight, so people need to be careful how many they're creating as it will have a big impact on performance. What would be useful, as I've mentioned before, is a mechanism to allow developers to provide an existing transaction for TM4J to use, and by implication, a mechanism to share a given Hibernate instance. This would also make integration with enterprise software less tricky. > That said, with respect to indexes, Hibernate does give a means of > assigning indexes in the mapping file that the schema is generated from, > so perhaps there is some scope for doing that (though in my tests it > doesn't help import performance at all - I guess that is to be expected > though, and I guess indexes would help other forms of more > read-intensive processing). > > I suppose that I should document the schema mapping a bit more and spend > some time writing up how all this works. I'm a bit reluctant to do that > right now as I am actually in the process of redesigning TM4J from the > ground-up to be a "native" TMAPI engine. I'll take the comment on board > though and if I get time to do it for TM4J 0.9.x I will. That's not what I'm suggesting - in an ideal world I think the schema should remain a mystery to users calling the API. Then the schema can vary without users having to worry about it. > I don't have any empirical evidence for which backends people are using > but from traffic on this list and private emails I would guess that the > order is something like > > 1) In-memory > 2) Hibernate (on a variety of RDBMSs) > 3) Ozone Andy. |
From: Kal A. <ka...@te...> - 2004-07-23 16:16:02
|
Hi Andy, I think I agree with pretty much everything you write. However, I do think that there is a slight problem in the way in which TM4J "hides" transaction/session control from the programmer. If you want to do things efficiently it is important to have a good grip on what is happening with the transactions. For example in some trials for a new TM4J datamodel, I found that separating lookups from updates gave a doubling of the processing rate for an import operation. That said, with respect to indexes, Hibernate does give a means of assigning indexes in the mapping file that the schema is generated from, so perhaps there is some scope for doing that (though in my tests it doesn't help import performance at all - I guess that is to be expected though, and I guess indexes would help other forms of more read-intensive processing). I suppose that I should document the schema mapping a bit more and spend some time writing up how all this works. I'm a bit reluctant to do that right now as I am actually in the process of redesigning TM4J from the ground-up to be a "native" TMAPI engine. I'll take the comment on board though and if I get time to do it for TM4J 0.9.x I will. I don't have any empirical evidence for which backends people are using but from traffic on this list and private emails I would guess that the order is something like 1) In-memory 2) Hibernate (on a variety of RDBMSs) 3) Ozone Cheers, Kal On Fri, 2004-07-23 at 13:50, Andy Peel wrote: > Hi Kal, > > > Hi again, > > > > I have received in a separate email a suggestion that we should create > > indexes for the table and use explain in Postgresql. Thats a really good > > point! I don't pretend to be an SQL/RDBMS expert by any means - so if > > anyone has any useful indexing tips for the TM4J Hibernate backend > > please post them. I promise to capture any suggestions and add them to > > the developer docs! > > Don't know if you've had any feed back on this, but thought I'd add my 2p. > > Firstly, there is going to be some difference between how DBs from different vendors optimise queries, obviously. However, there should still be a lot of ground to be gained from strapping on indexes to the more obvious places. > > For instance, at the moment the tmobjects table has just one index, on the topicMap column. object_id, class, parent_association and parent would all seem to be candidates for indexes (with no detailed knowledge of the schema I can't really tell). Basically, anywhere you've got a query, you should consider adding an index for each field/column in the WHERE clause, as this helps avoid doing a full table scan when running the query. This is presumably why large imports get slower as more data is brought in, and isn't to do with Hibernate itself. > > Secondly, as the above shows, I don't think this can be left for developers to sort out, as we don't know how the schema fits together, or how TM4J queries it. > > Just out of interest, do you have any idea of how many people use the different TM4J backends? > > Cheers, > > > Andy. -- Kal Ahmed <ka...@te...> techquila |
From: <ric...@ya...> - 2004-07-23 08:43:35
|
Hi All, As an alternate to using the Hibernate or Ozone backends, has anybody tried working with XTM topic maps stored in a Native XML DB, and if so, how was the performance? Cheers, Richard. --- Kal Ahmed <ka...@te...> wrote: > Hi again, > > I have received in a separate email a suggestion that we should create > indexes for the table and use explain in Postgresql. Thats a really good > point! I don't pretend to be an SQL/RDBMS expert by any means - so if > anyone has any useful indexing tips for the TM4J Hibernate backend > please post them. I promise to capture any suggestions and add them to > the developer docs! > > Cheers, > > Kal > > On Wed, 2004-07-21 at 20:49, Kal Ahmed wrote: > > Hi Andrea, > > > > Unfortunately the Hibernate backend is *much* slower than the in-memory > > backend. I have tried both MySQL and PostgreSQL and I have not noticed > > any significant difference in performance - and I get the same sort of > > performance as you do. I think that the root of the problem is in the > > structure of the database and how Hibernate interacts with it. When you > > import a topic map, the process requires a lot of database lookups and > > inserts. I am working on a new database schema that hopefully reduces > > the number of inserts required to import a topic, but that will probably > > be released after 1.0. > > > > Right now there is not really a good way to improve speed in general the > > best advice I can give is to look at your application code and try and > > cache the values you need as much as possible. For example if you are > > extracting names from topics for display purposes, caching the names of > > all typing topics can significantly reduce overhead when processing the > > same typing topics over and over again. > > > > It definitely looks like there is a need for a caching extractor > > implementation to make this kind of thing easy. I'll look into adding > > something like that for the next release. I'll also look into making use > > of some caching to speed up import (in experiments I have found that a > > reasonable sized LRU cache can really help processing topicRefs). > > > > Cheers and good luck! > > > > Kal > > > > > > On Wed, 2004-07-21 at 18:32, Andrea Carradori wrote: > > > Hi all, > > > > > > I am developing an application which, basing on a Hibernate backend, > > > does something which is very similar to what the program sent by > > > Richard does, that is: > > > > > > - retrieving a result set from a db > > > > > > - reading each row of the result set and making use of these data to > > > create topics in a topic map. Each topic is created with a base name, > > > a subject indicator and a type. > > > > > > > > > > > > The problem is that processing 600 topics takes several minutes on a > > > powerful computer (Pentium 4, 2.4 GHz), and I wanted to process at > > > least 1000 topics in a much shorter time! > > > > > > I tried to run the same program with an in-memory backend: it executed > > > within one second! > > > > > > So, I think the problem is that I make use of a databaseâ?¦ > > > > > > My questions are: > > > > > > - isthis long processing time normal? If yes, what does it > > > depend from? > > > > > > - Does a solution exist (at least to reach a shorter execution > > > time) or should I accept the idea of working with much smaller topic > > > maps (or with an in-memory backend)? > > > > > > > > > > > > I hope someone can help. > > > > > > > > > > > > Thanks in advance! > > > > > > Andrea > > > > > > > -- > Kal Ahmed <ka...@te...> > techquila > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_idG21&alloc_id040&op=click > _______________________________________________ > Tm4j-users mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-users > ___________________________________________________________ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself http://uk.messenger.yahoo.com |
From: Kal A. <ka...@te...> - 2004-07-22 15:09:20
|
Hi Armin, I hadn't checked in the grammar file for the tolog parser. Its checked in now. You will need to rebuild the tologx package to get the parser source to be regenerated by ANTLR (the best way is 'ant tologx-jar'). Cheers, Kal On Thu, 2004-07-22 at 13:07, Kal Ahmed wrote: > Hi Armin, > > There was a bug in the way that id references were handled by the tolog > processor. I thought I had checked in a fix for that, but it is possible > I forgot a file... > > Cheers, > > Kal > > On Thu, 2004-07-22 at 11:08, Armin Wagenknecht web.de wrote: > > Hello Kal, > > > > thanks a lot for the super-fast bug-fixing. Now,the reifies-predicate > > works perfectly. > > But I still have another question which determines, if I can use the > > tologx-package for my topicmap-application. > > > > Using the predicate "instance-of($INSTANCE, $TYPE)" for example, I can > > query > > > > ----- > > select $INSTANCE from instance-of($INSTANCE, <topic-id of a certain > > topictype>)? > > ----- > > > > -> I receive all topics which are typed by "topic-id of a certain > > topictype" > > > > or > > > > ---- > > select $TYPE from instance-of(<topic-id of a certain topic>, $TYPE)? > > ----- > > > > -> I receive the topictypes of " topic-id of a certain topic" > > > > So far so good, but with other predicates I can not put in an ID in > > both arguments of the predicate, for example: > > > > select $REIFIED from reifies(<topic-id of reifier-topic>, $REIFIED)? > > > > -> works > > > > but > > > > select $REIFER from reifies ($REIFER, <association-id of association > > which is reified>)? > > or > > > > select $REIFER from reifies ($REIFER, <occurrence-id of association > > which is reified>)? > > > > --> does not work!!! I get the error-message, that a topic with such > > an id does not exist in the Map. That is not surprising, because the > > ids I used in the queries > > are occurrence-ids or association-ids and no topic-ids. > > > > > > The same for > > > > select $ROLE from association-role(<association-id>, $ROLE)? > > > > select $THEME from scope(<occurrence-id of occurrence which is > > scoped>, $THEME)? > > > > > > > > and so on.... > > > > > > > > Is there a bug in the predicate-classes or did I use the > > tolog-predicates in a wrong way? > > > > > > > > Thank you in advance for your support! > > > > > > > > Cheers > > > > > > > > Armin -- Kal Ahmed <ka...@te...> techquila |
From: Kal A. <ka...@te...> - 2004-07-22 11:57:00
|
Hi Armin, There was a bug in the way that id references were handled by the tolog processor. I thought I had checked in a fix for that, but it is possible I forgot a file... Cheers, Kal On Thu, 2004-07-22 at 11:08, Armin Wagenknecht web.de wrote: > Hello Kal, > > thanks a lot for the super-fast bug-fixing. Now,the reifies-predicate > works perfectly. > But I still have another question which determines, if I can use the > tologx-package for my topicmap-application. > > Using the predicate "instance-of($INSTANCE, $TYPE)" for example, I can > query > > ----- > select $INSTANCE from instance-of($INSTANCE, <topic-id of a certain > topictype>)? > ----- > > -> I receive all topics which are typed by "topic-id of a certain > topictype" > > or > > ---- > select $TYPE from instance-of(<topic-id of a certain topic>, $TYPE)? > ----- > > -> I receive the topictypes of " topic-id of a certain topic" > > So far so good, but with other predicates I can not put in an ID in > both arguments of the predicate, for example: > > select $REIFIED from reifies(<topic-id of reifier-topic>, $REIFIED)? > > -> works > > but > > select $REIFER from reifies ($REIFER, <association-id of association > which is reified>)? > or > > select $REIFER from reifies ($REIFER, <occurrence-id of association > which is reified>)? > > --> does not work!!! I get the error-message, that a topic with such > an id does not exist in the Map. That is not surprising, because the > ids I used in the queries > are occurrence-ids or association-ids and no topic-ids. > > > The same for > > select $ROLE from association-role(<association-id>, $ROLE)? > > select $THEME from scope(<occurrence-id of occurrence which is > scoped>, $THEME)? > > > > and so on.... > > > > Is there a bug in the predicate-classes or did I use the > tolog-predicates in a wrong way? > > > > Thank you in advance for your support! > > > > Cheers > > > > Armin -- Kal Ahmed <ka...@te...> techquila |
From: Armin W. web.d. <arm...@we...> - 2004-07-22 10:07:58
|
Hello Kal, thanks a lot for the super-fast bug-fixing. Now,the reifies-predicate = works perfectly. But I still have another question which determines, if I can use the = tologx-package for my topicmap-application. Using the predicate "instance-of($INSTANCE, $TYPE)" for example, I can = query=20 ----- select $INSTANCE from instance-of($INSTANCE, <topic-id of a certain = topictype>)? =20 ----- -> I receive all topics which are typed by "topic-id of a certain = topictype" or ---- select $TYPE from instance-of(<topic-id of a certain topic>, $TYPE)? =20 ----- -> I receive the topictypes of " topic-id of a certain topic" So far so good, but with other predicates I can not put in an ID in both = arguments of the predicate, for example: select $REIFIED from reifies(<topic-id of reifier-topic>, $REIFIED)? -> works but select $REIFER from reifies ($REIFER, <association-id of association = which is reified>)? =20 or select $REIFER from reifies ($REIFER, <occurrence-id of association = which is reified>)? --> does not work!!! I get the error-message, that a topic with such an = id does not exist in the Map. That is not surprising, because the ids I = used in the queries are occurrence-ids or association-ids and no topic-ids. The same for=20 select $ROLE from association-role(<association-id>, $ROLE)? select $THEME from scope(<occurrence-id of occurrence which is scoped>, = $THEME)? and so on.... Is there a bug in the predicate-classes or did I use the = tolog-predicates in a wrong way? Thank you in advance for your support! Cheers Armin |
From: Kal A. <ka...@te...> - 2004-07-22 09:54:19
|
Hi again, I have received in a separate email a suggestion that we should create indexes for the table and use explain in Postgresql. Thats a really good point! I don't pretend to be an SQL/RDBMS expert by any means - so if anyone has any useful indexing tips for the TM4J Hibernate backend please post them. I promise to capture any suggestions and add them to the developer docs! Cheers, Kal On Wed, 2004-07-21 at 20:49, Kal Ahmed wrote: > Hi Andrea, >=20 > Unfortunately the Hibernate backend is *much* slower than the in-memory > backend. I have tried both MySQL and PostgreSQL and I have not noticed > any significant difference in performance - and I get the same sort of > performance as you do. I think that the root of the problem is in the > structure of the database and how Hibernate interacts with it. When you > import a topic map, the process requires a lot of database lookups and > inserts. I am working on a new database schema that hopefully reduces > the number of inserts required to import a topic, but that will probably > be released after 1.0. >=20 > Right now there is not really a good way to improve speed in general the > best advice I can give is to look at your application code and try and > cache the values you need as much as possible. For example if you are > extracting names from topics for display purposes, caching the names of > all typing topics can significantly reduce overhead when processing the > same typing topics over and over again. >=20 > It definitely looks like there is a need for a caching extractor > implementation to make this kind of thing easy. I'll look into adding > something like that for the next release. I'll also look into making use > of some caching to speed up import (in experiments I have found that a > reasonable sized LRU cache can really help processing topicRefs). >=20 > Cheers and good luck! >=20 > Kal >=20 >=20 > On Wed, 2004-07-21 at 18:32, Andrea Carradori wrote: > > Hi all, > >=20 > > I am developing an application which, basing on a Hibernate backend, > > does something which is very similar to what the program sent by > > Richard does, that is:=20 > >=20 > > - retrieving a result set from a db > >=20 > > - reading each row of the result set and making use of these data to > > create topics in a topic map. Each topic is created with a base name, > > a subject indicator and a type. > >=20 > > =20 > >=20 > > The problem is that processing 600 topics takes several minutes on a > > powerful computer (Pentium 4, 2.4 GHz), and I wanted to process at > > least 1000 topics in a much shorter time! > >=20 > > I tried to run the same program with an in-memory backend: it executed > > within one second! > >=20 > > So, I think the problem is that I make use of a database=E2=80=A6 > >=20 > > My questions are:=20 > >=20 > > - isthis long processing time normal? If yes, what does it > > depend from? > >=20 > > - Does a solution exist (at least to reach a shorter execution > > time) or should I accept the idea of working with much smaller topic > > maps (or with an in-memory backend)? > >=20 > > =20 > >=20 > > I hope someone can help. > >=20 > > =20 > >=20 > > Thanks in advance! > >=20 > > Andrea > >=20 > > =20 --=20 Kal Ahmed <ka...@te...> techquila |
From: Kal A. <ka...@te...> - 2004-07-21 19:38:45
|
Hi Andrea, Unfortunately the Hibernate backend is *much* slower than the in-memory backend. I have tried both MySQL and PostgreSQL and I have not noticed any significant difference in performance - and I get the same sort of performance as you do. I think that the root of the problem is in the structure of the database and how Hibernate interacts with it. When you import a topic map, the process requires a lot of database lookups and inserts. I am working on a new database schema that hopefully reduces the number of inserts required to import a topic, but that will probably be released after 1.0. Right now there is not really a good way to improve speed in general the best advice I can give is to look at your application code and try and cache the values you need as much as possible. For example if you are extracting names from topics for display purposes, caching the names of all typing topics can significantly reduce overhead when processing the same typing topics over and over again. It definitely looks like there is a need for a caching extractor implementation to make this kind of thing easy. I'll look into adding something like that for the next release. I'll also look into making use of some caching to speed up import (in experiments I have found that a reasonable sized LRU cache can really help processing topicRefs). Cheers and good luck! Kal On Wed, 2004-07-21 at 18:32, Andrea Carradori wrote: > Hi all, >=20 > I am developing an application which, basing on a Hibernate backend, > does something which is very similar to what the program sent by > Richard does, that is:=20 >=20 > - retrieving a result set from a db >=20 > - reading each row of the result set and making use of these data to > create topics in a topic map. Each topic is created with a base name, > a subject indicator and a type. >=20 > =20 >=20 > The problem is that processing 600 topics takes several minutes on a > powerful computer (Pentium 4, 2.4 GHz), and I wanted to process at > least 1000 topics in a much shorter time! >=20 > I tried to run the same program with an in-memory backend: it executed > within one second! >=20 > So, I think the problem is that I make use of a database=E2=80=A6 >=20 > My questions are:=20 >=20 > - isthis long processing time normal? If yes, what does it > depend from? >=20 > - Does a solution exist (at least to reach a shorter execution > time) or should I accept the idea of working with much smaller topic > maps (or with an in-memory backend)? >=20 > =20 >=20 > I hope someone can help. >=20 > =20 >=20 > Thanks in advance! >=20 > Andrea >=20 > =20 --=20 Kal Ahmed <ka...@te...> techquila |
From: Andrea C. <mai...@st...> - 2004-07-21 17:32:38
|
Hi all, I am developing an application which, basing on a Hibernate backend, does something which is very similar to what the program sent by Richard does, that is: - retrieving a result set from a db - reading each row of the result set and making use of these data to create topics in a topic map. Each topic is created with a base name, a subject indicator and a type. The problem is that processing 600 topics takes several minutes on a powerful computer (Pentium 4, 2.4 GHz), and I wanted to process at least 1000 topics in a much shorter time! I tried to run the same program with an in-memory backend: it executed within one second! So, I think the problem is that I make use of a database. My questions are: - is this long processing time normal? If yes, what does it depend from? - Does a solution exist (at least to reach a shorter execution time) or should I accept the idea of working with much smaller topic maps (or with an in-memory backend)? I hope someone can help. Thanks in advance! Andrea |
From: <Ste...@in...> - 2004-07-21 16:17:16
|
Hi Kal ! Shame on me !! There is (may be) nothing wrong with tolog !! There was a bug in my code where urls for locators are being generated. I'm extremely sorry for the inconvenience Stefan Kal Ahmed <ka...@te...> am 21.07.2004 17:01:46 An: Ste...@in... Kopie: tm4...@li... Thema: Re: Antwort: Re: [TM4J-users] Queries with association type as prediacte Hi Stefan, My guess (and it is only a guess at the moment) is still that the code is not finding the "description" topic - but I'm not sure if this is a bug with the tolog processor on the hibernate backend or if it is a problem with your query. Your query looks fine though... Can you modify the description topic to add a subject indicator and then try using that in the query? If that works then it narrows down the problem a bit. Cheers, Kal On Wed, 2004-07-21 at 13:08, Ste...@in... wrote: > Hi Kal ! > > Thanks for your immediate reply. Unfortunately my problems remain. > > -> Error message. This is the complete error message: > > Unable to create a new dynamic association predicate from > class org.tm4j.tologx.predicates.DynamicAssociationPredicate > > A stack trace is not avialable. > > -> Database table locators contains all reqired entries. > > > I'm sure, I made stupid mistake somewhere > > Here is my concrete problem: > .... > > <topic id="description"> > <baseName id="x1jpj8mb41-5"> > <baseNameString>Description</baseNameString> > </baseName> > </topic> > > <topic id="description-of"> > <baseName id="x1jpj8mb41-6"> > <baseNameString>Description Of</baseNameString> > </baseName> > </topic> > > <topic id="described-by"> > <baseName id="x1jpj8mb41-7"> > <baseNameString>Described By</baseNameString> > </baseName> > </topic> > > ..... > > <association id="x1jpjp8dlb-8"> > <instanceOf> > <topicRef xlink:href="#description"/> > </instanceOf> > <member id="x1jpjp8dlb-9"> > <roleSpec> > <topicRef xlink:href="#description-of"/> > </roleSpec> > <topicRef xlink:href="#x1jpjp8dlb-0"/> > </member> > <member id="x1jpjp8dlb-a"> > <roleSpec> > <topicRef xlink:href="#described-by"/> > </roleSpec> > <topicRef xlink:href="#x1jpjp8dlb-6"/> > </member> > </association> > > The query looks like: > > select $DESC from description($DESC : described-by, <topicID> : > description-of) ? > > > > > > > Kal Ahmed <ka...@te...> am 21.07.2004 10:22:43 > > An: Stefan Frauenknecht <ste...@in...> > Kopie: tm4...@li... > Thema: Re: [TM4J-users] Queries with association type as prediacte > > > Hi Stefan, > > Check the rest of the error message - it should also show what the cause > was. I expect that you do not have a topic with the source locator > <baselocator of topic map>#composed-by in your topic map. Remember that > in tolog references that are undecorated are references to the *source > locator* of the topic and that this is resolved against the *base > locator* of the topic map being queried. If you know the full > source-locator of the "composed-by" topic, use that with the decoration > a"<address>". If you know that it has a subject indicator, it is better > to use that with the decoration i"<subject indicator>". > > Hope this helps! > > Cheers, > > Kal > > On Tue, 2004-07-20 at 22:54, Stefan Frauenknecht wrote: > > Hi all !!! > > > > I'm still having problems with some queries in tm4j 0.9.5 and 0.9.6 > > > > Queries such as 'composed-by($COMPOSER: composer, $OPERA: opera)' do not > work. > > I always get a TologParserException: Unable to create a new dynamic > association predicate from > > class org.tm4j.tologx.predicates.DynamicAssociationPredicate > > > > My application uses the hibernate backend with a IBM DB2 Database. > > > > Digging in the source code shows that there is only one QueryEvaluator > > implementation for memory available. So queries may go against the > > wrong backend impl. ? > > > > Is this the problem ? There sould be an impl. for hibernate and ozone as > > well. Right ? > > > > How can I get rid of this problem ? > > > > Thanks in advance for your help. > > > > Stefan > > > > ________________________________________________________________ > > Verschicken Sie romantische, coole und witzige Bilder per SMS! > > Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193 > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > > _______________________________________________ > > Tm4j-users mailing list > > Tm4...@li... > > https://lists.sourceforge.net/lists/listinfo/tm4j-users > -- > Kal Ahmed <ka...@te...> > techquila > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Tm4j-users mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-users -- Kal Ahmed <ka...@te...> techquila |
From: <ric...@ya...> - 2004-07-21 15:07:16
|
Hi Kal, Thanks for the answer. I did a check on my data by doing a "select distinct..." query, and my new result set is 1111 rows, which with the typing topic, would give me the 1112 topics in the map that I was getting. I hadn't realise that the topics were merged automatically when creating a topic map. Doh! Thanks again, Richard. --- Kal Ahmed <ka...@te...> wrote: > Hi Richard, > > I think that merging is the most likely cause of the missing topics. > > I guess that the "num" variable is a unique value on each row, right ? > But what about the "descr" value that you use for a name, if some rows > have the same value for "descr" then you will get the rows merging > (because they will have the same name in the same scope). > > Hope this helps, > > Kal > > On Wed, 2004-07-21 at 13:47, Richard Gregory wrote: > > Hi All, > > > > I have a program (see below), which is largely based on the SerializeTopicMap example from > TM4J, > > which creates an in memory topic map, connects to a database with jdbc and performs a query to > > extract data which will be used to build the topics. The programe then loops through the > result > > set, creating a topic from each line of the results set. The result set has the data I expect > > (1307 rows), and it seems to be creating the topics from each row of the results set, as when > each > > is created, I can output the topicID and baseName. However, if i then try to work with the > > completed topic map, I find that it only has 1112 topics. Is there a limit to the number of > topics > > tm4j will add to a topic map, or is it something I'm doing, or is there some other reason? > > > > Any adive would be gratefully appreciated. > > > > Thanks, > > > > Richard. > > > > > > package mips.genre.topicmaps; > > > > import java.io.*; > > import java.util.Properties; > > import java.util.Iterator; > > > > import org.apache.xml.serialize.OutputFormat; > > import org.apache.xml.serialize.XMLSerializer; > > import org.tm4j.net.Locator; > > import org.tm4j.topicmap.*; > > import org.tm4j.topicmap.Member; > > import org.tm4j.topicmap.Topic; > > import org.tm4j.topicmap.TopicMap; > > import org.tm4j.topicmap.TopicMapProvider; > > import org.tm4j.topicmap.TopicMapProviderFactory; > > import org.tm4j.topicmap.utils.TopicMapWalker; > > import org.tm4j.topicmap.utils.XTMWriter; > > > > import java.sql.*; > > > > > > public class CreateTopicMap > > { > > private TopicMapProvider m_provider; > > private TopicMap m_topicMap; > > > > > > /** > > * The PSI for the concept of a function (link to the mips funcat website. > > */ > > private static final String FUNCTION_PSI = "http://mips.gsf.de/projects/funcat"; > > > > public static void main(String[] args) > > { > > try > > { > > CreateTopicMap theApp = new CreateTopicMap(); > > theApp.run(); > > } > > catch(Exception ex) > > { > > System.out.println("Exception caught: " + ex.toString()); > > } > > } > > > > /** > > * Constructor for the application. This constructor initialises the application > > * by creating a new in-memory back-end. > > */ > > public CreateTopicMap() > > throws Exception > > { > > TopicMapProviderFactory providerFactory = new > > org.tm4j.topicmap.memory.TopicMapProviderFactoryImpl(); > > m_provider = providerFactory.newTopicMapProvider(new Properties()); > > } > > > > /** > > * Runs the application > > */ > > public void run() > > throws Exception > > { > > // First create a new TopicMap > > // We will use a dummy URI as the "base" locator for the topic map. > > Locator tmLoc = m_provider.getLocatorFactory().createLocator("URI", > > "/home/richard/Documents/topicmaps/funcat_tm.xtm"); > > TopicMap funcat_tm = m_provider.createTopicMap(tmLoc); > > > > // Create function topic type > > Topic function = createTopic(funcat_tm, "tt-function", "Function", FUNCTION_PSI); > > > > // Create instance topics > > Statement stmt = null; > > ResultSet rs = null; > > FileOutputStream file = null; > > > > try { > > // The newInstance() call is a work around for some > > // broken Java implementations > > > > Class.forName("com.mysql.jdbc.Driver").newInstance(); > > > > Connection conn = DriverManager.getConnection("jdbc:mysql://clu2:12002/funcatDB", "yeast", > > "heFepilz"); > > > > stmt = conn.createStatement(); > > rs = stmt.executeQuery("SELECT * FROM cat_funcat;"); > > rs.first(); > > do { > > System.out.print( rs.getRow() ); > > System.out.print(" Number: " + rs.getString("num")); > > System.out.println(" Description: " + rs.getString("descr")); > > > > String topicID = "t-func-" + rs.getString("num"); > > String topicName = rs.getString("descr"); > > String topicPSI = > > "http://mips.gsf.de/cgi-bin/proj/funcatDB/search_advanced.pl?action=2&intern=&wert=" + > > rs.getString("num"); > > > > //Topic topic = createTopic(funcat_tm, topicID, function, topicName); > > > > Topic topic = funcat_tm.createTopic(topicID); > > topic.createName(null, topicName); > > > > > > System.out.println( "topicID: " + topic.getID() + " baseName: " + topic.getNames() ); > > > > } while ( rs.next() ); > > > > writeTopicMap(funcat_tm, System.out); > > > > System.out.println( "\nNumber of topics: " + funcat_tm.getTopicCount() ); > > > > > > try { > > file = new FileOutputStream("funcat_tm_from_db.xtm"); > > writeTopicMapToFile(funcat_tm, file); > > listTopics(funcat_tm); > > } > > // On exceptions, print out error message > > catch (Exception e) { > > System.err.println(e); > > } > > > > //close the streams > > finally { > > try { > > > > file.close(); > > } > > catch (Exception e) { > > } > > } > > > > } // End try > > > > catch (Exception ex) { > > // handle the error > > if (ex instanceof SQLException) { > > System.out.println("SQLException: " + ((SQLException)ex).getMessage()); > > System.out.println("SQLState: " + ((SQLException)ex).getSQLState()); > > System.out.println("VendorError: " + ((SQLException)ex).getErrorCode()); > > } // End if > > } // End catch > > > > finally { > > if (rs != null) { > > try { > > rs.close(); > > } > > catch (SQLException sqlEx) { // ignore > > } > > rs = null; > > } > > if (stmt != null) { > > try { > > stmt.close(); > > } > > catch (SQLException sqlEx) { // ignore > > stmt = null; > > } // End catch > > } //End If > > } // End finally > > } > > > > /** > > * Creates a new topic with an ID, base name and optionally a subject indicator. > > * @param tm the topic map which will contain the new Topic. > > * @param id the ID value to be assigned to the topic that gets created. > > * @param nameString the base name data to be assigned to the topic. > > * @param subjectIndicator the subject indicator URI address to be assigned to the topic. > > This may be null, in which case no subject indicator will be assigned to the topic. > > * @return the Topic created. > > */ > > private Topic createTopic(TopicMap tm, String id, String nameString, String > subjectIndicator) > > throws Exception > > { > > // Creates the topic with the specified ID > > Topic ret = tm.createTopic(id); > > > > // Creates a new base name with an ID generated by the backend > > // the return value is then used to set the name string. > > ret.createName(null).setData(nameString); > > > > // Creates a subject inidicator Locator and adds it to the topic. > > if (subjectIndicator != null) > > { > > Locator siLoc = tm.getLocatorFactory().createLocator("URI", subjectIndicator); > > ret.addSubjectIndicator(siLoc); > > } > > > > return ret; > > } > > > > /** > > * Creates a topic with the specified ID, type and name string. > > * @param funcat_tm the topic map which will contain the topic. > > * @param id the ID to be assigned to the topic > > * @param type the Topic which types this topic. > > * @param nameString the name to be assigned to the topic. > > * @return the Topic created > > */ > > private Topic createTopic(TopicMap funcat_tm, String id, Topic type, String nameString) > > throws Exception > > { > > Topic ret = createTopic(funcat_tm, id, nameString, null); > > ret.addType(type); > > return ret; > > } > > > > /** > > * Creates an association between two topics. > > * @param funcat_tm the topic map in which the association will be created. > > * @param assocType the Topic which is used to type the association. > > * @param role1Type the Topic which is used to specify the type of one role in the > > association > > * @param role1Player the Topic which is playing the role specified by > <code>role1Type</code> > > * @param role2Type the Topic which is used to specify the type of one role in the > > association > > * @param role2Player the Topic which is playing the role specified by > <code>role2Type</code> > > * @return the Association created > > */ > > private Association createBinaryAssociation(TopicMap funcat_tm, Topic assocType, > > Topic role1Type, Topic role1Player, > > Topic role2Type, Topic role2Player) > > throws Exception > > { > > Association ret = funcat_tm.createAssociation(null); > > ret.setType(assocType); > > Member m1 = ret.createMember(null); > > m1.setRoleSpec(role1Type); > > m1.addPlayer(role1Player); > > Member m2 = ret.createMember(null); > > m2.setRoleSpec(role2Type); > > m2.addPlayer(role2Player); > > return ret; > > } > > > > > > /** > > * Serialises the topic map in XTM syntax to the specified output stream. > > * @param funcat_tm the topic map to be serialised. > > * @param outputStream the output stream to which the XTM serialisation wil be written. > > */ > > private void writeTopicMap(TopicMap funcat_tm, PrintStream outputStream) > > throws Exception > > { > > System.out.println("Writing..."); > > > > XTMWriter writer = new XTMWriter(); > > TopicMapWalker walker = new TopicMapWalker(); > > XMLSerializer serial = new XMLSerializer(); > > serial.setOutputByteStream(outputStream); > > OutputFormat of = new OutputFormat(); > > of.setEncoding("UTF-8"); > > of.setMethod("xml"); > > of.setIndent(2); > > serial.setOutputFormat(of); > > walker.setHandler(writer); > > writer.setContentHandler(serial.asContentHandler()); > > walker.walk(funcat_tm); > > } > > > > private void writeTopicMapToFile(TopicMap funcat_tm, FileOutputStream outputStream) > > throws Exception > > { > > System.out.println("Writing to file..."); > > > > XTMWriter writer = new XTMWriter(); > > TopicMapWalker walker = new TopicMapWalker(); > > XMLSerializer serial = new XMLSerializer(); > > serial.setOutputByteStream(outputStream); > > OutputFormat of = new OutputFormat(); > > of.setEncoding("UTF-8"); > > of.setMethod("xml"); > > of.setIndent(2); > > serial.setOutputFormat(of); > > walker.setHandler(writer); > > writer.setContentHandler(serial.asContentHandler()); > > walker.walk(funcat_tm); > > > > System.out.println("Finished writing"); > > } > > > > private void listTopics (TopicMap tm) throws Exception { > > > > int i = 0; > > > > Iterator topics = tm.getTopicsIterator(); > > while(topics.hasNext()) > > { > > i++; > > Topic myTopic = (Topic)topics.next(); > > > > System.out.println("\nTopic " + i + ": " + myTopic.getID()); > > > > } > > > > } > > } > > > > > > > > > > > > > > ___________________________________________________________ALL-NEW Yahoo! Messenger - sooooo > many all-new ways to express yourself http://uk.messenger.yahoo.com > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > > _______________________________________________ > > Tm4j-users mailing list > > Tm4...@li... > > https://lists.sourceforge.net/lists/listinfo/tm4j-users > -- > Kal Ahmed <ka...@te...> > techquila > > ___________________________________________________________ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself http://uk.messenger.yahoo.com |
From: Kal A. <ka...@te...> - 2004-07-21 14:51:09
|
Hi Stefan, My guess (and it is only a guess at the moment) is still that the code is not finding the "description" topic - but I'm not sure if this is a bug with the tolog processor on the hibernate backend or if it is a problem with your query. Your query looks fine though... Can you modify the description topic to add a subject indicator and then try using that in the query? If that works then it narrows down the problem a bit. Cheers, Kal On Wed, 2004-07-21 at 13:08, Ste...@in... wrote: > Hi Kal ! > > Thanks for your immediate reply. Unfortunately my problems remain. > > -> Error message. This is the complete error message: > > Unable to create a new dynamic association predicate from > class org.tm4j.tologx.predicates.DynamicAssociationPredicate > > A stack trace is not avialable. > > -> Database table locators contains all reqired entries. > > > I'm sure, I made stupid mistake somewhere > > Here is my concrete problem: > .... > > <topic id="description"> > <baseName id="x1jpj8mb41-5"> > <baseNameString>Description</baseNameString> > </baseName> > </topic> > > <topic id="description-of"> > <baseName id="x1jpj8mb41-6"> > <baseNameString>Description Of</baseNameString> > </baseName> > </topic> > > <topic id="described-by"> > <baseName id="x1jpj8mb41-7"> > <baseNameString>Described By</baseNameString> > </baseName> > </topic> > > ..... > > <association id="x1jpjp8dlb-8"> > <instanceOf> > <topicRef xlink:href="#description"/> > </instanceOf> > <member id="x1jpjp8dlb-9"> > <roleSpec> > <topicRef xlink:href="#description-of"/> > </roleSpec> > <topicRef xlink:href="#x1jpjp8dlb-0"/> > </member> > <member id="x1jpjp8dlb-a"> > <roleSpec> > <topicRef xlink:href="#described-by"/> > </roleSpec> > <topicRef xlink:href="#x1jpjp8dlb-6"/> > </member> > </association> > > The query looks like: > > select $DESC from description($DESC : described-by, <topicID> : > description-of) ? > > > > > > > Kal Ahmed <ka...@te...> am 21.07.2004 10:22:43 > > An: Stefan Frauenknecht <ste...@in...> > Kopie: tm4...@li... > Thema: Re: [TM4J-users] Queries with association type as prediacte > > > Hi Stefan, > > Check the rest of the error message - it should also show what the cause > was. I expect that you do not have a topic with the source locator > <baselocator of topic map>#composed-by in your topic map. Remember that > in tolog references that are undecorated are references to the *source > locator* of the topic and that this is resolved against the *base > locator* of the topic map being queried. If you know the full > source-locator of the "composed-by" topic, use that with the decoration > a"<address>". If you know that it has a subject indicator, it is better > to use that with the decoration i"<subject indicator>". > > Hope this helps! > > Cheers, > > Kal > > On Tue, 2004-07-20 at 22:54, Stefan Frauenknecht wrote: > > Hi all !!! > > > > I'm still having problems with some queries in tm4j 0.9.5 and 0.9.6 > > > > Queries such as 'composed-by($COMPOSER: composer, $OPERA: opera)' do not > work. > > I always get a TologParserException: Unable to create a new dynamic > association predicate from > > class org.tm4j.tologx.predicates.DynamicAssociationPredicate > > > > My application uses the hibernate backend with a IBM DB2 Database. > > > > Digging in the source code shows that there is only one QueryEvaluator > > implementation for memory available. So queries may go against the > > wrong backend impl. ? > > > > Is this the problem ? There sould be an impl. for hibernate and ozone as > > well. Right ? > > > > How can I get rid of this problem ? > > > > Thanks in advance for your help. > > > > Stefan > > > > ________________________________________________________________ > > Verschicken Sie romantische, coole und witzige Bilder per SMS! > > Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193 > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > > _______________________________________________ > > Tm4j-users mailing list > > Tm4...@li... > > https://lists.sourceforge.net/lists/listinfo/tm4j-users > -- > Kal Ahmed <ka...@te...> > techquila > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Tm4j-users mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-users -- Kal Ahmed <ka...@te...> techquila |
From: Kal A. <ka...@te...> - 2004-07-21 14:47:46
|
Hi Richard, I think that merging is the most likely cause of the missing topics. I guess that the "num" variable is a unique value on each row, right ? But what about the "descr" value that you use for a name, if some rows have the same value for "descr" then you will get the rows merging (because they will have the same name in the same scope). Hope this helps, Kal On Wed, 2004-07-21 at 13:47, Richard Gregory wrote: > Hi All, > > I have a program (see below), which is largely based on the SerializeTopicMap example from TM4J, > which creates an in memory topic map, connects to a database with jdbc and performs a query to > extract data which will be used to build the topics. The programe then loops through the result > set, creating a topic from each line of the results set. The result set has the data I expect > (1307 rows), and it seems to be creating the topics from each row of the results set, as when each > is created, I can output the topicID and baseName. However, if i then try to work with the > completed topic map, I find that it only has 1112 topics. Is there a limit to the number of topics > tm4j will add to a topic map, or is it something I'm doing, or is there some other reason? > > Any adive would be gratefully appreciated. > > Thanks, > > Richard. > > > package mips.genre.topicmaps; > > import java.io.*; > import java.util.Properties; > import java.util.Iterator; > > import org.apache.xml.serialize.OutputFormat; > import org.apache.xml.serialize.XMLSerializer; > import org.tm4j.net.Locator; > import org.tm4j.topicmap.*; > import org.tm4j.topicmap.Member; > import org.tm4j.topicmap.Topic; > import org.tm4j.topicmap.TopicMap; > import org.tm4j.topicmap.TopicMapProvider; > import org.tm4j.topicmap.TopicMapProviderFactory; > import org.tm4j.topicmap.utils.TopicMapWalker; > import org.tm4j.topicmap.utils.XTMWriter; > > import java.sql.*; > > > public class CreateTopicMap > { > private TopicMapProvider m_provider; > private TopicMap m_topicMap; > > > /** > * The PSI for the concept of a function (link to the mips funcat website. > */ > private static final String FUNCTION_PSI = "http://mips.gsf.de/projects/funcat"; > > public static void main(String[] args) > { > try > { > CreateTopicMap theApp = new CreateTopicMap(); > theApp.run(); > } > catch(Exception ex) > { > System.out.println("Exception caught: " + ex.toString()); > } > } > > /** > * Constructor for the application. This constructor initialises the application > * by creating a new in-memory back-end. > */ > public CreateTopicMap() > throws Exception > { > TopicMapProviderFactory providerFactory = new > org.tm4j.topicmap.memory.TopicMapProviderFactoryImpl(); > m_provider = providerFactory.newTopicMapProvider(new Properties()); > } > > /** > * Runs the application > */ > public void run() > throws Exception > { > // First create a new TopicMap > // We will use a dummy URI as the "base" locator for the topic map. > Locator tmLoc = m_provider.getLocatorFactory().createLocator("URI", > "/home/richard/Documents/topicmaps/funcat_tm.xtm"); > TopicMap funcat_tm = m_provider.createTopicMap(tmLoc); > > // Create function topic type > Topic function = createTopic(funcat_tm, "tt-function", "Function", FUNCTION_PSI); > > // Create instance topics > Statement stmt = null; > ResultSet rs = null; > FileOutputStream file = null; > > try { > // The newInstance() call is a work around for some > // broken Java implementations > > Class.forName("com.mysql.jdbc.Driver").newInstance(); > > Connection conn = DriverManager.getConnection("jdbc:mysql://clu2:12002/funcatDB", "yeast", > "heFepilz"); > > stmt = conn.createStatement(); > rs = stmt.executeQuery("SELECT * FROM cat_funcat;"); > rs.first(); > do { > System.out.print( rs.getRow() ); > System.out.print(" Number: " + rs.getString("num")); > System.out.println(" Description: " + rs.getString("descr")); > > String topicID = "t-func-" + rs.getString("num"); > String topicName = rs.getString("descr"); > String topicPSI = > "http://mips.gsf.de/cgi-bin/proj/funcatDB/search_advanced.pl?action=2&intern=&wert=" + > rs.getString("num"); > > //Topic topic = createTopic(funcat_tm, topicID, function, topicName); > > Topic topic = funcat_tm.createTopic(topicID); > topic.createName(null, topicName); > > > System.out.println( "topicID: " + topic.getID() + " baseName: " + topic.getNames() ); > > } while ( rs.next() ); > > writeTopicMap(funcat_tm, System.out); > > System.out.println( "\nNumber of topics: " + funcat_tm.getTopicCount() ); > > > try { > file = new FileOutputStream("funcat_tm_from_db.xtm"); > writeTopicMapToFile(funcat_tm, file); > listTopics(funcat_tm); > } > // On exceptions, print out error message > catch (Exception e) { > System.err.println(e); > } > > //close the streams > finally { > try { > > file.close(); > } > catch (Exception e) { > } > } > > } // End try > > catch (Exception ex) { > // handle the error > if (ex instanceof SQLException) { > System.out.println("SQLException: " + ((SQLException)ex).getMessage()); > System.out.println("SQLState: " + ((SQLException)ex).getSQLState()); > System.out.println("VendorError: " + ((SQLException)ex).getErrorCode()); > } // End if > } // End catch > > finally { > if (rs != null) { > try { > rs.close(); > } > catch (SQLException sqlEx) { // ignore > } > rs = null; > } > if (stmt != null) { > try { > stmt.close(); > } > catch (SQLException sqlEx) { // ignore > stmt = null; > } // End catch > } //End If > } // End finally > } > > /** > * Creates a new topic with an ID, base name and optionally a subject indicator. > * @param tm the topic map which will contain the new Topic. > * @param id the ID value to be assigned to the topic that gets created. > * @param nameString the base name data to be assigned to the topic. > * @param subjectIndicator the subject indicator URI address to be assigned to the topic. > This may be null, in which case no subject indicator will be assigned to the topic. > * @return the Topic created. > */ > private Topic createTopic(TopicMap tm, String id, String nameString, String subjectIndicator) > throws Exception > { > // Creates the topic with the specified ID > Topic ret = tm.createTopic(id); > > // Creates a new base name with an ID generated by the backend > // the return value is then used to set the name string. > ret.createName(null).setData(nameString); > > // Creates a subject inidicator Locator and adds it to the topic. > if (subjectIndicator != null) > { > Locator siLoc = tm.getLocatorFactory().createLocator("URI", subjectIndicator); > ret.addSubjectIndicator(siLoc); > } > > return ret; > } > > /** > * Creates a topic with the specified ID, type and name string. > * @param funcat_tm the topic map which will contain the topic. > * @param id the ID to be assigned to the topic > * @param type the Topic which types this topic. > * @param nameString the name to be assigned to the topic. > * @return the Topic created > */ > private Topic createTopic(TopicMap funcat_tm, String id, Topic type, String nameString) > throws Exception > { > Topic ret = createTopic(funcat_tm, id, nameString, null); > ret.addType(type); > return ret; > } > > /** > * Creates an association between two topics. > * @param funcat_tm the topic map in which the association will be created. > * @param assocType the Topic which is used to type the association. > * @param role1Type the Topic which is used to specify the type of one role in the > association > * @param role1Player the Topic which is playing the role specified by <code>role1Type</code> > * @param role2Type the Topic which is used to specify the type of one role in the > association > * @param role2Player the Topic which is playing the role specified by <code>role2Type</code> > * @return the Association created > */ > private Association createBinaryAssociation(TopicMap funcat_tm, Topic assocType, > Topic role1Type, Topic role1Player, > Topic role2Type, Topic role2Player) > throws Exception > { > Association ret = funcat_tm.createAssociation(null); > ret.setType(assocType); > Member m1 = ret.createMember(null); > m1.setRoleSpec(role1Type); > m1.addPlayer(role1Player); > Member m2 = ret.createMember(null); > m2.setRoleSpec(role2Type); > m2.addPlayer(role2Player); > return ret; > } > > > /** > * Serialises the topic map in XTM syntax to the specified output stream. > * @param funcat_tm the topic map to be serialised. > * @param outputStream the output stream to which the XTM serialisation wil be written. > */ > private void writeTopicMap(TopicMap funcat_tm, PrintStream outputStream) > throws Exception > { > System.out.println("Writing..."); > > XTMWriter writer = new XTMWriter(); > TopicMapWalker walker = new TopicMapWalker(); > XMLSerializer serial = new XMLSerializer(); > serial.setOutputByteStream(outputStream); > OutputFormat of = new OutputFormat(); > of.setEncoding("UTF-8"); > of.setMethod("xml"); > of.setIndent(2); > serial.setOutputFormat(of); > walker.setHandler(writer); > writer.setContentHandler(serial.asContentHandler()); > walker.walk(funcat_tm); > } > > private void writeTopicMapToFile(TopicMap funcat_tm, FileOutputStream outputStream) > throws Exception > { > System.out.println("Writing to file..."); > > XTMWriter writer = new XTMWriter(); > TopicMapWalker walker = new TopicMapWalker(); > XMLSerializer serial = new XMLSerializer(); > serial.setOutputByteStream(outputStream); > OutputFormat of = new OutputFormat(); > of.setEncoding("UTF-8"); > of.setMethod("xml"); > of.setIndent(2); > serial.setOutputFormat(of); > walker.setHandler(writer); > writer.setContentHandler(serial.asContentHandler()); > walker.walk(funcat_tm); > > System.out.println("Finished writing"); > } > > private void listTopics (TopicMap tm) throws Exception { > > int i = 0; > > Iterator topics = tm.getTopicsIterator(); > while(topics.hasNext()) > { > i++; > Topic myTopic = (Topic)topics.next(); > > System.out.println("\nTopic " + i + ": " + myTopic.getID()); > > } > > } > } > > > > > > > ___________________________________________________________ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself http://uk.messenger.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Tm4j-users mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-users -- Kal Ahmed <ka...@te...> techquila |
From: <ric...@ya...> - 2004-07-21 12:47:21
|
Hi All, I have a program (see below), which is largely based on the SerializeTopicMap example from TM4J, which creates an in memory topic map, connects to a database with jdbc and performs a query to extract data which will be used to build the topics. The programe then loops through the result set, creating a topic from each line of the results set. The result set has the data I expect (1307 rows), and it seems to be creating the topics from each row of the results set, as when each is created, I can output the topicID and baseName. However, if i then try to work with the completed topic map, I find that it only has 1112 topics. Is there a limit to the number of topics tm4j will add to a topic map, or is it something I'm doing, or is there some other reason? Any adive would be gratefully appreciated. Thanks, Richard. package mips.genre.topicmaps; import java.io.*; import java.util.Properties; import java.util.Iterator; import org.apache.xml.serialize.OutputFormat; import org.apache.xml.serialize.XMLSerializer; import org.tm4j.net.Locator; import org.tm4j.topicmap.*; import org.tm4j.topicmap.Member; import org.tm4j.topicmap.Topic; import org.tm4j.topicmap.TopicMap; import org.tm4j.topicmap.TopicMapProvider; import org.tm4j.topicmap.TopicMapProviderFactory; import org.tm4j.topicmap.utils.TopicMapWalker; import org.tm4j.topicmap.utils.XTMWriter; import java.sql.*; public class CreateTopicMap { private TopicMapProvider m_provider; private TopicMap m_topicMap; /** * The PSI for the concept of a function (link to the mips funcat website. */ private static final String FUNCTION_PSI = "http://mips.gsf.de/projects/funcat"; public static void main(String[] args) { try { CreateTopicMap theApp = new CreateTopicMap(); theApp.run(); } catch(Exception ex) { System.out.println("Exception caught: " + ex.toString()); } } /** * Constructor for the application. This constructor initialises the application * by creating a new in-memory back-end. */ public CreateTopicMap() throws Exception { TopicMapProviderFactory providerFactory = new org.tm4j.topicmap.memory.TopicMapProviderFactoryImpl(); m_provider = providerFactory.newTopicMapProvider(new Properties()); } /** * Runs the application */ public void run() throws Exception { // First create a new TopicMap // We will use a dummy URI as the "base" locator for the topic map. Locator tmLoc = m_provider.getLocatorFactory().createLocator("URI", "/home/richard/Documents/topicmaps/funcat_tm.xtm"); TopicMap funcat_tm = m_provider.createTopicMap(tmLoc); // Create function topic type Topic function = createTopic(funcat_tm, "tt-function", "Function", FUNCTION_PSI); // Create instance topics Statement stmt = null; ResultSet rs = null; FileOutputStream file = null; try { // The newInstance() call is a work around for some // broken Java implementations Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection conn = DriverManager.getConnection("jdbc:mysql://clu2:12002/funcatDB", "yeast", "heFepilz"); stmt = conn.createStatement(); rs = stmt.executeQuery("SELECT * FROM cat_funcat;"); rs.first(); do { System.out.print( rs.getRow() ); System.out.print(" Number: " + rs.getString("num")); System.out.println(" Description: " + rs.getString("descr")); String topicID = "t-func-" + rs.getString("num"); String topicName = rs.getString("descr"); String topicPSI = "http://mips.gsf.de/cgi-bin/proj/funcatDB/search_advanced.pl?action=2&intern=&wert=" + rs.getString("num"); //Topic topic = createTopic(funcat_tm, topicID, function, topicName); Topic topic = funcat_tm.createTopic(topicID); topic.createName(null, topicName); System.out.println( "topicID: " + topic.getID() + " baseName: " + topic.getNames() ); } while ( rs.next() ); writeTopicMap(funcat_tm, System.out); System.out.println( "\nNumber of topics: " + funcat_tm.getTopicCount() ); try { file = new FileOutputStream("funcat_tm_from_db.xtm"); writeTopicMapToFile(funcat_tm, file); listTopics(funcat_tm); } // On exceptions, print out error message catch (Exception e) { System.err.println(e); } //close the streams finally { try { file.close(); } catch (Exception e) { } } } // End try catch (Exception ex) { // handle the error if (ex instanceof SQLException) { System.out.println("SQLException: " + ((SQLException)ex).getMessage()); System.out.println("SQLState: " + ((SQLException)ex).getSQLState()); System.out.println("VendorError: " + ((SQLException)ex).getErrorCode()); } // End if } // End catch finally { if (rs != null) { try { rs.close(); } catch (SQLException sqlEx) { // ignore } rs = null; } if (stmt != null) { try { stmt.close(); } catch (SQLException sqlEx) { // ignore stmt = null; } // End catch } //End If } // End finally } /** * Creates a new topic with an ID, base name and optionally a subject indicator. * @param tm the topic map which will contain the new Topic. * @param id the ID value to be assigned to the topic that gets created. * @param nameString the base name data to be assigned to the topic. * @param subjectIndicator the subject indicator URI address to be assigned to the topic. This may be null, in which case no subject indicator will be assigned to the topic. * @return the Topic created. */ private Topic createTopic(TopicMap tm, String id, String nameString, String subjectIndicator) throws Exception { // Creates the topic with the specified ID Topic ret = tm.createTopic(id); // Creates a new base name with an ID generated by the backend // the return value is then used to set the name string. ret.createName(null).setData(nameString); // Creates a subject inidicator Locator and adds it to the topic. if (subjectIndicator != null) { Locator siLoc = tm.getLocatorFactory().createLocator("URI", subjectIndicator); ret.addSubjectIndicator(siLoc); } return ret; } /** * Creates a topic with the specified ID, type and name string. * @param funcat_tm the topic map which will contain the topic. * @param id the ID to be assigned to the topic * @param type the Topic which types this topic. * @param nameString the name to be assigned to the topic. * @return the Topic created */ private Topic createTopic(TopicMap funcat_tm, String id, Topic type, String nameString) throws Exception { Topic ret = createTopic(funcat_tm, id, nameString, null); ret.addType(type); return ret; } /** * Creates an association between two topics. * @param funcat_tm the topic map in which the association will be created. * @param assocType the Topic which is used to type the association. * @param role1Type the Topic which is used to specify the type of one role in the association * @param role1Player the Topic which is playing the role specified by <code>role1Type</code> * @param role2Type the Topic which is used to specify the type of one role in the association * @param role2Player the Topic which is playing the role specified by <code>role2Type</code> * @return the Association created */ private Association createBinaryAssociation(TopicMap funcat_tm, Topic assocType, Topic role1Type, Topic role1Player, Topic role2Type, Topic role2Player) throws Exception { Association ret = funcat_tm.createAssociation(null); ret.setType(assocType); Member m1 = ret.createMember(null); m1.setRoleSpec(role1Type); m1.addPlayer(role1Player); Member m2 = ret.createMember(null); m2.setRoleSpec(role2Type); m2.addPlayer(role2Player); return ret; } /** * Serialises the topic map in XTM syntax to the specified output stream. * @param funcat_tm the topic map to be serialised. * @param outputStream the output stream to which the XTM serialisation wil be written. */ private void writeTopicMap(TopicMap funcat_tm, PrintStream outputStream) throws Exception { System.out.println("Writing..."); XTMWriter writer = new XTMWriter(); TopicMapWalker walker = new TopicMapWalker(); XMLSerializer serial = new XMLSerializer(); serial.setOutputByteStream(outputStream); OutputFormat of = new OutputFormat(); of.setEncoding("UTF-8"); of.setMethod("xml"); of.setIndent(2); serial.setOutputFormat(of); walker.setHandler(writer); writer.setContentHandler(serial.asContentHandler()); walker.walk(funcat_tm); } private void writeTopicMapToFile(TopicMap funcat_tm, FileOutputStream outputStream) throws Exception { System.out.println("Writing to file..."); XTMWriter writer = new XTMWriter(); TopicMapWalker walker = new TopicMapWalker(); XMLSerializer serial = new XMLSerializer(); serial.setOutputByteStream(outputStream); OutputFormat of = new OutputFormat(); of.setEncoding("UTF-8"); of.setMethod("xml"); of.setIndent(2); serial.setOutputFormat(of); walker.setHandler(writer); writer.setContentHandler(serial.asContentHandler()); walker.walk(funcat_tm); System.out.println("Finished writing"); } private void listTopics (TopicMap tm) throws Exception { int i = 0; Iterator topics = tm.getTopicsIterator(); while(topics.hasNext()) { i++; Topic myTopic = (Topic)topics.next(); System.out.println("\nTopic " + i + ": " + myTopic.getID()); } } } ___________________________________________________________ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself http://uk.messenger.yahoo.com |
From: <Ste...@in...> - 2004-07-21 12:09:39
|
Hi Kal ! Thanks for your immediate reply. Unfortunately my problems remain. -> Error message. This is the complete error message: Unable to create a new dynamic association predicate from class org.tm4j.tologx.predicates.DynamicAssociationPredicate A stack trace is not avialable. -> Database table locators contains all reqired entries. I'm sure, I made stupid mistake somewhere Here is my concrete problem: .... <topic id="description"> <baseName id="x1jpj8mb41-5"> <baseNameString>Description</baseNameString> </baseName> </topic> <topic id="description-of"> <baseName id="x1jpj8mb41-6"> <baseNameString>Description Of</baseNameString> </baseName> </topic> <topic id="described-by"> <baseName id="x1jpj8mb41-7"> <baseNameString>Described By</baseNameString> </baseName> </topic> ..... <association id="x1jpjp8dlb-8"> <instanceOf> <topicRef xlink:href="#description"/> </instanceOf> <member id="x1jpjp8dlb-9"> <roleSpec> <topicRef xlink:href="#description-of"/> </roleSpec> <topicRef xlink:href="#x1jpjp8dlb-0"/> </member> <member id="x1jpjp8dlb-a"> <roleSpec> <topicRef xlink:href="#described-by"/> </roleSpec> <topicRef xlink:href="#x1jpjp8dlb-6"/> </member> </association> The query looks like: select $DESC from description($DESC : described-by, <topicID> : description-of) ? Kal Ahmed <ka...@te...> am 21.07.2004 10:22:43 An: Stefan Frauenknecht <ste...@in...> Kopie: tm4...@li... Thema: Re: [TM4J-users] Queries with association type as prediacte Hi Stefan, Check the rest of the error message - it should also show what the cause was. I expect that you do not have a topic with the source locator <baselocator of topic map>#composed-by in your topic map. Remember that in tolog references that are undecorated are references to the *source locator* of the topic and that this is resolved against the *base locator* of the topic map being queried. If you know the full source-locator of the "composed-by" topic, use that with the decoration a"<address>". If you know that it has a subject indicator, it is better to use that with the decoration i"<subject indicator>". Hope this helps! Cheers, Kal On Tue, 2004-07-20 at 22:54, Stefan Frauenknecht wrote: > Hi all !!! > > I'm still having problems with some queries in tm4j 0.9.5 and 0.9.6 > > Queries such as 'composed-by($COMPOSER: composer, $OPERA: opera)' do not work. > I always get a TologParserException: Unable to create a new dynamic association predicate from > class org.tm4j.tologx.predicates.DynamicAssociationPredicate > > My application uses the hibernate backend with a IBM DB2 Database. > > Digging in the source code shows that there is only one QueryEvaluator > implementation for memory available. So queries may go against the > wrong backend impl. ? > > Is this the problem ? There sould be an impl. for hibernate and ozone as > well. Right ? > > How can I get rid of this problem ? > > Thanks in advance for your help. > > Stefan > > ________________________________________________________________ > Verschicken Sie romantische, coole und witzige Bilder per SMS! > Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193 > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Tm4j-users mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-users -- Kal Ahmed <ka...@te...> techquila |
From: Kal A. <ka...@te...> - 2004-07-21 09:04:02
|
Hi again, The fixes are now checked in to CVS - I've added a test case to validate that it should now work as expected. Cheers, Kal On Wed, 2004-07-21 at 09:37, Kal Ahmed wrote: > Hi Armin, >=20 > I've looked into this and it looks like there are a couple of problems > with the tolog query engine - I'll try and get a fix checked into CVS > today. >=20 > Cheers, >=20 > Kal >=20 > On Tue, 2004-07-20 at 16:24, Armin Wagenknecht web.de wrote: > > Hello, > > =20 > > first of all it=C2=B4s great that the tolog-package was extended so I c= an > > use all the nice built-in predicates in a tm4j-tolog-query! > > Unfortunately I can=C2=B4t resolve the following task. > > =20 > > In my TopicMap I have a normal reification of an association to link > > it with an occurrence like this: > > =20 > > <association id=3D"a1"> > > <instanceOf> > > <topicRef xlink:href=3D"#a"/> > > </instanceOf> > > <member> > > <roleSpec> > > <topicRef xlink:href=3D"#role1"/> > > </roleSpec> > > <topicRef xlink:href=3D"#ex1"/> > > </member> > > <member> > > <roleSpec> > > <topicRef xlink:href=3D"#role2"/> > > </roleSpec> > > <topicRef xlink:href=3D"#ex2"/> > > </member> > > </association> > > =20 > > =20 > > <topic id=3D"re-a1"> > > <subjectIdentity> > > <subjectIndicatorRef xlink:href=3D"#a1"/> > > </subjectIdentity> > > <baseName id=3D"baseNameID"> > > <baseNameString>Reifikation of Association1</baseNameString> > > </baseName> > > <occurrence id=3D"occID"> > > <instanceOf> > > <topicRef xlink:href=3D"#occtype"/> > > </instanceOf> > > <resourceRef xlink:href=3D"www.hello.net"/> > > </occurrence> > > </topic> > > =20 > > =20 > > For example, i like to get the specific association a1 refiied by the > > Topic re-a1 and I posess the TopicID. > > =20 > > I thought to solve this task with the help of tolog in the following > > way: > > =20 > > doQuery("select $REIFIED from reifies(<the ID of re-a1>, $REIFIED)?"); > > =20 > > Even the Command: > > =20 > > doQuery("select $REIFIER, $REIFIED from reifies($REIFIER,$REIFIED)?"); > > =20 > > don=C2=B4t show any results. > > =20 > > =20 > > =20 > > =20 > > I hope somebody can give me a hint. > > =20 > > Thanks > > =20 > > Armin Wagenknecht > > TU Darmstadt Germany > > =20 > > =20 > > =20 --=20 Kal Ahmed <ka...@te...> techquila |