From: SourceForge.net <no...@so...> - 2010-01-11 14:55:35
|
Bugs item #2926983, was opened at 2010-01-06 17:15 Message generated for change (Settings changed) made by lheuer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=631664&aid=2926983&group_id=102341 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: tinyTiM 2.x Status: Open >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Merging of associations failed Initial Comment: if two topic maps are merge on demand by calling the method Topic.mergeIn, it fails if there are an association type in both topic maps with a merged type ( the same type ). tinyTim throws an ModelConstraint Exception: Exception in thread "main" org.tmapi.core.ModelConstraintException: All constructs must belong to the same topic map at org.tinytim.internal.utils.Check._reportModelConstraintViolation(Unknown Source) at org.tinytim.internal.utils.Check._sameTopicMap(Unknown Source) at org.tinytim.internal.utils.Check.sameTopicMap(Unknown Source) at org.tinytim.core.MemoryTopicMap.createAssociation(Unknown Source) at org.tinytim.core.MemoryTopicMap.createAssociation(Unknown Source) at TinyTimMergeTest.main(TinyTimMergeTest.java:54) And because of the fact that I try to merge, the associations don't belong to the same topic map. ---------------------------------------------------------------------- >Comment By: Lars Heuer (lheuer) Date: 2010-01-11 13:42 Message: Fixed in rev. 362 ---------------------------------------------------------------------- Comment By: https://www.google.com/accounts () Date: 2010-01-07 09:25 Message: Oh, this was a mistake, the attached file should not be empty. This is the contained code: TopicMapSystem topicMapSystem = TopicMapSystemFactory.newInstance() .newTopicMapSystem(); TopicMap topicMapA = topicMapSystem.createTopicMap("http://a"); TopicMap topicMapB = topicMapSystem.createTopicMap("http://b"); Topic typeA = topicMapA.createTopic(); typeA.addItemIdentifier(topicMapA.createLocator("http://type")); Topic roleA = topicMapA.createTopic(); roleA.addItemIdentifier(topicMapA.createLocator("http://role")); Topic playerA = topicMapA.createTopic(); playerA.addItemIdentifier(topicMapA.createLocator("http://player")); Association associationA = topicMapA.createAssociation(typeA, new Topic[0]); associationA.createRole(roleA, playerA); Topic typeB = topicMapB.createTopic(); typeB.addItemIdentifier(topicMapB.createLocator("http://type")); Topic roleB = topicMapB.createTopic(); roleB.addItemIdentifier(topicMapB.createLocator("http://role")); Topic playerB = topicMapB.createTopic(); playerB.addItemIdentifier(topicMapB.createLocator("http://player")); Association associationB = topicMapB.createAssociation(typeB, new Topic[0]); associationB.createRole(roleB, playerB); //THIS METHOD THROWS AN EXCEPTION topicMapA.mergeIn(topicMapB); ---------------------------------------------------------------------- Comment By: Lars Heuer (lheuer) Date: 2010-01-06 19:19 Message: I am confused. * The attached file does not do anything, it just declares a main function * Topics from different topic maps cannot be merged. As tinyTiM says correctly: It's a model constraint violation since "All constructs must belong to the same topic map". * TopicMap.mergeIn(otherTopicMap) should work Maybe you can provide more details? Are you trying to do the following: topicA = tmA.createTopic(); topicB = tmB.createTopic(); topicA.mergeIn(topicB); ? If so, tinyTiM's behaviour is correct. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=631664&aid=2926983&group_id=102341 |