From: Kal A. <ka...@te...> - 2005-04-04 16:30:16
|
Hi Ketil, The problem is the references in your Topics.xtm. When you have a <topicRef xlink:href="#books"/> element, the reference is to a topic with the URL <path>/Topics.xtm#books. When you merge in topicTypes.xtm, the <topic id="books"> element has the source locator <path>/topicTypes.xtm#books. I see that you have some relative URIs in topicTypes.xtm for subject identifiers. What I advise you to do is to: 1) Convert those relative URIs to absolute URIs with a full domain name e.g. http://www.online.no/psi/types/books 2) Either 2a) Replace the topicRefs in Topics.xtm with subjectIndicatorRefs using the full URIs OR 2b) Create "stub" topics for your topic types in topics.xtm that only have the id and the full subject identifier e.g. <topic id="books"> <subjectIdentity><subjectIndicatorRef xlink:href="http://www.online.no/psi/types/books"/></subjectIdentity> </topic> If you do (2a) you are basically replacing a reference to a topic with a reference to a subject identifier, that will get resolved during merging. Actually what happens "behind the scenes" is that a stub topic gets autogenerated for you. If you do (2b) then you can carry on using the shorter topic refs in your topics.xtm because the topics.xtm#books topic will get merged with the topicTypes.xtm#books topic by their subject identifier. (2b) could result in a smaller Topics.xtm file if you have lots of references, but I think that is really the only difference between the two approaches. Hope this helps, Kal Ketil Stadskleiv wrote: >I have a Topic Map consisting of two files (so far). > >- One with different topics >- One with all the topic-types referred to in the other file. > >If I cut and paste the content of these files into one it works just fine, >but I need to do this automaticly using CMD. > >------------------------------------------------ >Topics.xtm: > ><?xml version="1.0" encoding="UTF-8"?> ><!DOCTYPE topicMap SYSTEM "http://www.topicmaps.org/xtm/1.0/xtm1.dtd"> ><topicMap xmlns="http://www.topicmaps.org/xtm/1.0/" >xmlns:xlink="http://www.w3.org/1999/xlink"> ><!--Book--> > <topic id="id2002IEEE_Transactions_on_Parallel_and_Distributed_Systems"> > <instanceOf> > <topicRef xlink:href="#books" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/2002IEEE_Transactions_on_Parallel_and_Distributed_System >s" /> > </subjectIdentity> > > <baseName> > <baseNameString>IEEE Transactions on Parallel and Distributed >Systems 2002</baseNameString> > </baseName> > </topic> > ><!--Journal--> > <topic id="Transactions_on_Parallel_and_Distributed_Systems131"> > <instanceOf> > <topicRef xlink:href="#journals" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/Transactions_on_Parallel_and_Distributed_Systems131" /> > </subjectIdentity> > > <baseName> > <baseNameString>IEEE Transactions on Parallel and Distributed >Systems January 2002</baseNameString> > </baseName> > </topic> > ><!--Publisher--> > <topic id="idPublished_by_the_IEEE_Computer_Society"> > <instanceOf> > <topicRef xlink:href="#organizations" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/Published_by_the_IEEE_Computer_Society" /> > </subjectIdentity> > > <baseName> > ><baseNameString>Published_by_the_IEEE_Computer_Society</baseNameString> > </baseName> > </topic> > ><!--Article--> > <topic id="id10.1041_l0001s-2002"> > <instanceOf> > <topicRef xlink:href="#articles" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/IEEE_TRANSACTIONS_ON_PARALLEL_AND_DISTRIBUTED_SYSTEMS" >/> > </subjectIdentity> > > <baseName> > <baseNameString>IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED >SYSTEMS (10.1041/l0001s-2002)</baseNameString> > </baseName> > </topic> > ><!--YearMonth--> > <topic id="id2002january"> > <instanceOf> > <topicRef xlink:href="#date" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topics/2002January" /> > </subjectIdentity> > > <baseName> > <baseNameString>2002 January</baseNameString> > </baseName> > </topic> > ><!--Article--> > <topic id="id10.1041_l0004s-2001"> > <instanceOf> > <topicRef xlink:href="#articles" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/IEEE_TRANSACTIONS_ON_PARALLEL_AND_DISTIBUTED_SYSTEMS" /> > </subjectIdentity> > > <baseName> > <baseNameString>IEEE TRANSACTIONS ON PARALLEL AND DISTIBUTED >SYSTEMS (10.1041/l0004s-2001)</baseNameString> > </baseName> > </topic> > ><!--Year--> > <topic id="id2002"> > <instanceOf> > <topicRef xlink:href="#date" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topics/2002" /> > </subjectIdentity> > > <baseName> > <baseNameString>2002</baseNameString> > </baseName> > </topic> > ><!--Year--> > <topic id="id2002"> > <instanceOf> > <topicRef xlink:href="#date" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topics/2002" /> > </subjectIdentity> > > <baseName> > <baseNameString>2002</baseNameString> > </baseName> > </topic> ></topicMap> > >------------------------------------------------ >topicTypes.xtm: > ><?xml version="1.0" encoding="UTF-8"?> ><topicMap xmlns="http://www.topicmaps.org/xtm/1.0/" >xmlns:xlink="http://www.w3.org/1999/xlink"> ><!--Topic Types--> > <topic id="organizations"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/organizations" /> > </subjectIdentity> > > <baseName> > <baseNameString>Organization</baseNameString> > </baseName> > </topic> > > <topic id="books"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/books" /> > </subjectIdentity> > > <baseName> > <baseNameString>Books</baseNameString> > </baseName> > </topic> > > <topic id="journals"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/journals" /> > </subjectIdentity> > > <baseName> > <baseNameString>Journals</baseNameString> > </baseName> > </topic> > > <topic id="articles"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/articles" /> > </subjectIdentity> > > <baseName> > <baseNameString>Articles</baseNameString> > </baseName> > </topic> > > <topic id="date"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/date" /> > </subjectIdentity> > > <baseName> > <baseNameString>Date</baseNameString> > </baseName> > </topic> > > <topic id="person"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/person" /> > </subjectIdentity> > > <baseName> > <baseNameString>Person</baseNameString> > </baseName> > </topic> ></topicMap> >-------------------------------------------------- > >I use the command line tool in TM4J: > >compress -o testMerge.xtm Topics.xtm topicTypes.xtm > >And the result is this: > >---------------------------------------- >testMerge.xtm: > ><?xml version="1.0" encoding="UTF-8"?> ><topicMap id="x1kq61aj4o-0" >xml:base="file:/home/others/homer/groups/i/it3803gr3/result/topicTest.xtm" >xmlns="http://www.topicmaps.org/xtm/1.0/" >xmlns:xlink="http://www.w3.org/1999/xlink"> > <topic id="x1kq61ajdo-13"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/articles" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-14"> > <baseNameString>Articles</baseNameString> > </baseName> > </topic> > > <topic id="id2002"> > <instanceOf> > <topicRef xlink:href="#date" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topics/2002" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-b"> > <baseNameString>2002</baseNameString> > </baseName> > </topic> > > <topic id="id10.1041_l0001s-2002"> > <instanceOf> > <topicRef xlink:href="#articles" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/IEEE_TRANSACTIONS_ON_PARALLEL_AND_DISTRIBUTED_SYSTEMS" >/> > </subjectIdentity> > > <baseName id="x1kq61ajdo-7"> > <baseNameString>IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED >SYSTEMS (10.1041/l0001s-2002)</baseNameString> > </baseName> > </topic> > > <topic id="id10.1041_l0004s-2001"> > <instanceOf> > <topicRef xlink:href="#articles" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/IEEE_TRANSACTIONS_ON_PARALLEL_AND_DISTIBUTED_SYSTEMS" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-a"> > <baseNameString>IEEE TRANSACTIONS ON PARALLEL AND DISTIBUTED >SYSTEMS (10.1041/l0004s-2001)</baseNameString> > </baseName> > </topic> > > <topic id="journals" /> > > <topic id="id2002IEEE_Transactions_on_Parallel_and_Distributed_Systems"> > <instanceOf> > <topicRef xlink:href="#books" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/2002IEEE_Transactions_on_Parallel_and_Distributed_System >s" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-1"> > <baseNameString>IEEE Transactions on Parallel and Distributed >Systems 2002</baseNameString> > </baseName> > </topic> > > <topic id="x1kq61ajdo-11"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/journals" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-12"> > <baseNameString>Journals</baseNameString> > </baseName> > </topic> > > <topic id="books" /> > > <topic id="x1kq61ajdo-f"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/books" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-10"> > <baseNameString>Books</baseNameString> > </baseName> > </topic> > > <topic id="Transactions_on_Parallel_and_Distributed_Systems131"> > <instanceOf> > <topicRef xlink:href="#journals" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/Transactions_on_Parallel_and_Distributed_Systems131" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-3"> > <baseNameString>IEEE Transactions on Parallel and Distributed >Systems January 2002</baseNameString> > </baseName> > </topic> > > <topic id="x1kq61ajdo-15"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/date" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-16"> > <baseNameString>Date</baseNameString> > </baseName> > </topic> > > <topic id="articles" /> > > <topic id="organizations" /> > > <topic id="idPublished_by_the_IEEE_Computer_Society"> > <instanceOf> > <topicRef xlink:href="#organizations" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef >xlink:href="/topics/Published_by_the_IEEE_Computer_Society" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-5"> > ><baseNameString>Published_by_the_IEEE_Computer_Society</baseNameString> > </baseName> > </topic> > > <topic id="x1kq61ajdo-d"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/organizations" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-e"> > <baseNameString>Organization</baseNameString> > </baseName> > </topic> > > <topic id="person"> > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topicType/person" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-17"> > <baseNameString>Person</baseNameString> > </baseName> > </topic> > > <topic id="id2002january"> > <instanceOf> > <topicRef xlink:href="#date" /> > </instanceOf> > > <subjectIdentity> > <subjectIndicatorRef xlink:href="/topics/2002January" /> > </subjectIdentity> > > <baseName id="x1kq61ajdo-9"> > <baseNameString>2002 January</baseNameString> > </baseName> > </topic> > > <topic id="date" /> ></topicMap> > > >------------------------------------------------------------------------- > >I you can see I have som duplicate topics in topics.xtm, but the compress >tool seem to handle these just fine. But my problem is the Topic Types. >They are changed into this: ><topic id="articles" /> ><topic id="organizations" /> etc... > >And therefor when I test my Topic Map in TM4L viewer I have five Topic Types >without names, and the original Topic Types are only empty Topics. > >Why does this happen? >What can I do to avoid this? > >I's be most grateful for any help. > >Regards > >Ketil Stadskleiv > > > > > > > > > > > > > > > > > >------------------------------------------------------- >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://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Tm4j-users mailing list >Tm4...@li... >https://lists.sourceforge.net/lists/listinfo/tm4j-users > > > > |