From: Andrea C. <mai...@st...> - 2004-12-12 21:30:35
|
Hi All, I have the following small problem, and I can't find an answer to it in the programmer's guide: when I export a topic map to an XTM file, I see that in the file the typing-topics of a certain topic are indicated in it by means of their IDs. If the topic map is the result of a merge of several topic maps, this causes problems, because many IDs of merged topics are overwritten! I'd like to make use of the subject indicators of the typing topics (instead of the IDs) in order to indicate the type of a topic. Is it possible? How does it work? Thanks! Andrea |
From: Kal A. <ka...@te...> - 2004-12-13 15:22:51
|
Hi Andrea, When TM4J exports a topic map, all subjectIndicatorRef references to topics are converted into topicRef references - this is just the default behaviour of the XTM export code. Right now there is no option to use subjectIndicatorRef where possible, but that could be added as a new feature. To implement it for yourself, you will need to override the behaviour in XTMWriter. Take a look at the method topicRef (about line 665) - this is invoked from various places in the XTMWriter code to write a <topicRef> element. You could modify this method to check if the the Topic in the parameter t has a subject indicator and if it does, call the ref() method to write a subject indicator ref (there is an example of this on line 678. The important thing to note here is that even though TM4J's default behaviour is to "normalise" all references into topicRef references, the subject indicators in the original merged topic maps are preserved. Also, although the ID attribute values may get changed (especially when you merge topic maps), the original IDs are also preserved as full URLs in the sourceLocators property. Hope this helps! Kal Andrea Carradori wrote: >Hi All, >I have the following small problem, and I can't find an answer to it in the >programmer's guide: when I export a topic map to an XTM file, I see that in >the file the typing-topics of a certain topic are indicated in it by means >of their IDs. If the topic map is the result of a merge of several topic >maps, this causes problems, because many IDs of merged topics are >overwritten! >I'd like to make use of the subject indicators of the typing topics (instead >of the IDs) in order to indicate the type of a topic. Is it possible? How >does it work? >Thanks! >Andrea > > > > |
From: Stefan L. <li...@no...> - 2004-12-13 16:05:34
|
Hi Andrea, There is already an implementation of the solution Kal proposed. I dunno=20 if you use the TMAPI Interfaces TM4J provides, but there is a project=20 called tmapi-utils[1] out there which contains an XTMSerializer, which=20 can be switched to do exactly that what kal proposes (using=20 subjectIndicatorRef instead of topicRef, if the typing topic has a=20 subject indicator). Therfore you just have to call=20 XTMSerializer.setProperty("org.tmapi-utils.impexp.xtm.XTMSerializer.subje= ctIdentifiersOnly",true); feel free to contact me Stefan [1] http://tmapi-utils.sourceforge.net/ Andrea Carradori wrote: > Hi All, > > I have the following small problem, and I can=92t find an answer to it=20 > in the programmer=92s guide: when I export a topic map to an XTM file, = I=20 > see that in the file the typing-topics of a certain topic are=20 > indicated in it by means of their IDs. If the topic map is the result=20 > of a merge of several topic maps, this causes problems, because many=20 > IDs of merged topics are overwritten! > > I=92d like to make use of the subject indicators of the typing topics=20 > (instead of the IDs) in order to indicate the type of a topic. Is it=20 > possible? How does it work? > > Thanks! > > Andrea > --=20 My place : http://user.cs.tu-berlin.de/~lischke |
From: Andrea C. <mai...@st...> - 2004-12-14 18:49:10
|
Hi Kal, hi Stefan I'm not using TMAPI, so, unfortunately, I couldn't make use of the XTMSerializer. Anyway, I modified the XTMWriter, just as Kal proposed, and it worked! This helped me very much in my work. Thank you very much! By the way, I think it would be very useful if the possibility to use subjectIndicatorRef where possible were implemented in the next versions of TM4J, just like Kal wrote. Thanks again! Andrea -----Messaggio originale----- Da: tm4...@li... [mailto:tm4...@li...] Per conto di Stefan Lischke Inviato: Montag, 13. Dezember 2004 17:02 A: Andrea Carradori Cc: tm4...@li... Oggetto: Re: [TM4J-users] typing topics Hi Andrea, There is already an implementation of the solution Kal proposed. I dunno if you use the TMAPI Interfaces TM4J provides, but there is a project called tmapi-utils[1] out there which contains an XTMSerializer, which can be switched to do exactly that what kal proposes (using subjectIndicatorRef instead of topicRef, if the typing topic has a subject indicator). Therfore you just have to call XTMSerializer.setProperty("org.tmapi-utils.impexp.xtm.XTMSerializer.subjectI dentifiersOnly",true); feel free to contact me Stefan [1] http://tmapi-utils.sourceforge.net/ Andrea Carradori wrote: > Hi All, > > I have the following small problem, and I can't find an answer to it > in the programmer's guide: when I export a topic map to an XTM file, I > see that in the file the typing-topics of a certain topic are > indicated in it by means of their IDs. If the topic map is the result > of a merge of several topic maps, this causes problems, because many > IDs of merged topics are overwritten! > > I'd like to make use of the subject indicators of the typing topics > (instead of the IDs) in order to indicate the type of a topic. Is it > possible? How does it work? > > Thanks! > > Andrea > -- My place : http://user.cs.tu-berlin.de/~lischke ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Tm4j-users mailing list Tm4...@li... https://lists.sourceforge.net/lists/listinfo/tm4j-users |