![]() |
![]() |
![]() |
||||||||||||||
| Introduction < A TMAPI Tutorial < < Home | ||||||||||||||||
|
IntroductionOf course there are several software packages for Java developers when they need to develop applications using Topic Map technologies. There are some proprietary software vendors, but also open source packages like TM4j, tinyTIM and quite a few others. In the Java tradition to standardize interfaces the TMAPI project has proposed a set of Java interfaces which particular Topic Map implementations may choose to adhere to. The obvious advantage for the application developer is then to use only that single set of interfaces and to choose a particular implementation on other merits. Those of you who every now and then read underlying standards may notice that there is a strong coherence between TMAPI and the class model behind TMDM, the TM data model. This, of course, in no coincidence, both have been developed in lock-step. The good side of it is, that Java developers are programming close to the (high-level) TM model. In the following we give a fast-lane introduction of creating and restoring information using TMAPI. This tutorial is a spin-off of our efforts to create a TMAPI compliant AsTMa= parser; we have no affiliation with the TMAPI project itself. We assume that the reader has some familiarity with the basic Topic Map concepts (TAO):
We will use a tiny running example, dealing with airports (with which most of us are all too familiar, I guess). You can download some example code as one coherent Java file. Except for the classes java.util.Iterator and java.util.ArrayList all other classes used there and in this tutorial all reside in the package org.tmapi.core which TMAPI-conformant implementations will have to offer. Depending on your environment, you might compile the code via javac TMAPITutorial.java -classpath "lib\tmapi-1_0.jar"and execute it via something like (here we used tinyTIM): java -classpath ".;lib\tmapi-1_0.jar;\where\is\tinyTIM-1_0.jar" TMAPITutorialor - if you have some inclination to brute force and are blessed with a decent shell - java -classpath `find . -iname '*.jar' | awk 'ORS=":" {print $1}'` TMAPITutorial
|
|||||||||||||||