![]() |
![]() |
![]() |
|||||||||||
| Preliminaries < A TMAPI Tutorial < < Home | |||||||||||||
|
PreliminariesJava being Java, we first have to set up a bit of infrastructure to host our topic map. TMAPI asks us to instantiate first a TopicMapSystemFactory and a TopicMapSystem (lines 1 and 2 in the following listing). Line 3 finally creates a TopicMap in the current TopicMapSystem: TopicMapSystemFactory tSystemFactory = TopicMapSystemFactory.newInstance(); TopicMapSystem tSystem = tSystemFactory.newTopicMapSystem(); TopicMap tMap = tSystem.createTopicMap( 'http://topicmaps.bond.edu.au/example/' );The given parameter in the last statement sets the baseLocator of the Topic Map to http://topicmaps.bond.edu.au/example/. That base locator is the base URL which can later be used to address particular topics and associations within that map. The base locator can be chosen freely as seems appropriate for your application. From then on we use this tMap instance to store topic map objects, such as topics and associations. |
||||||||||||