Skip to content
jansc edited this page Sep 14, 2010 · 5 revisions

Include tm.js or tm.min.js into an (X)HTML page or a JavaScript file (the last option applies to server-side JavaScript implementations).

Creating a TopicMap object

This is how to create a TopicMap object:

var factory, sys, tmid, tm;
factory = TopicMapSystemFactory.newInstance();
factory.setProperty('com.semanticheadache.tmjs.backend', 'memory');
sys = factory.newTopicMapSystem();
tmid = sys.createLocator("http://example.org/mytm");
tm = sys.createTopicMap(tmid);

By default newTopicMapSystem() returns an in-memory implementation.

Until the documentation for tmjs is finished you may refer to the TMAPI 2.0 -docs. Most of the time, the JavaScript API is identical to the Java API.

Clone this wiki locally