[topicmapmail] Merging associations

Lars Heuer heuer at semagia.com
Tue Sep 19 13:15:19 EDT 2006


Hi Joril,

> In tinyTIM, you have a boolean argument ; modify. I assumed this was to
> indentify if the merging was with 2 topic maps or just withnin the same
> topic map. However, you only set the rolesPlayed in the merging topic A, if
> modify is true.Shouldn't this happen anyhow?

Well, I am not pretty familiar with the tinyTiM code. I'm one of the
project admins and fixed some bugs, but I suggest to write Stefan
Lischke if you've concrete questions regarding the tinyTiM code.

>>Item identifiers are always absolute. They are resolved against a
>>locator. [...]"tuesday" becomes
>>"http://www.example.org/tm/my-tm#tuesday".

> Yes, so then, two topics in different topic maps will never have the same
> item identifier(locator)?

No, you cannot make this assumption. You never know how the topic map
was created, you've check for duplicate item identifiers if you modify
and merge topic maps.

[...]
> And when merging 2 topics from different topic maps, the merged
> topic will contain a source locator, indicating it is merged...?

No, there is no special item identifier that indicates that a merge
has happened. The merged topic contains the union of item identifiers
from both topics.

Example:
        Topic a has the item identifiers (A, B)
        Topic b has the item identifiers (C, D)

        Now you merge topic a with b, you'll have a topic with the
        item identifiers (A, B, C, D)

If you know that the item identifier A comes from topic map X and the
item identifier D comes from topic map Y, you have something like an
indicator that the topic was merged, but there is no special 'I have
merged with ...' item identifier.

> The getReference() method in Locator, returns the "tuesday", and the 
> getNotation() returns the absolute path?

No. The Locator.getReference() method returns the complete IRI (i.e.
"http://www.example.org/tm/my-tm#tuesday"), the getNotation method
returns the locator notation, which is in allmost all cases "URI".

> I see that in the TMAPI, they write in the mergIn(Topic) method that:
> "to replace the other Topic wherever it is used as a typing or scoping
> topic"...
> Do you have any clue how to 'get' the topics that have 'other' topic as type
> or scope?

Yes, just use for example the index package :)
http://tmapi.org/apiDocs/org/tmapi/index/core/package-summary.html
The AssociationIndex, TopicNamesIndex etc. provide methods

    get...ByType(Topic type)

which return a collection of objects that are typed by "type".

Best regards,
Lars
-- 
http://www.semagia.com
http://www.topicgarden.com/mailinglist/ German Topic Maps mailinglist



More information about the topicmapmail mailing list