Previous | Next

An introduction to XTM 2.0

Posted in Technology on 2006-12-09 14:17

Various people have asked for an introduction to XTM 2.0, since the actual standard is not very easily readable, and so I thought I would provide that. This posting is just a simple walk-through of the syntax with examples. People have also asked for an explanation of the differences with version 1.0, and I'll do a separate posting on that later when time allows.

Let's look at how you'd wrap the topic map first:

<topicMap version="2.0" xmlns="">

  <!-- topics and associations go here -->


As you can see, this is pretty much as in XTM 1.0, so let's move on to a simple topic example.

<topic id="xtm">
  <subjectIdentifier href=""/>
    <topicRef href="#syntax"/>
    <value>XTM 2.0</value>
      <topicRef href="#status"/>
    <resourceData>International Standard</resourceData>

I think this example is pretty much self-explanatory for anyone who knows Topic Maps already. One thing to note here is that the reason I use topicRef elements everywhere to reference topics is that XTM 2.0 doesn't allow any other form of topic reference. I'm not adding any examples of the scope element, as it is identical to the way it was in XTM 1.0.

Below is an example of an association.

    <topicRef href="#specified-in"/>
      <topicRef href="#specified"/>
    <topicRef href="#xtm"/>
      <topicRef href="#specification"/>
    <topicRef href="#xtm-spec"/>

Again, I think this is self-explanatory. Note that for each role you can only have a single player, unlike in XTM 1.0.

We've now shown all the main constructs, but there are some variations left, so let's go through those as well.

<topic id="xtm-spec">
  <subjectLocator href=""/>
    <topicRef href="#specification"/>
    <value>XTM 2.0 specification</value>
      <topicRef href="#publication-date"/>
    <resourceData datatype=""

Here you can see an example of a topic that represents a resource (it has a subject locator), and also an example of a datatyped occurrence value.

Reification is quite simple to do. Let's say you want to create a topic reifying the example topic map. To do that, just write as follows:

<topicMap version="2.0"

<topic id="tmtopic">
    <value>XTM 2.0 Example Topic Map</value>

<!-- ... -->

As you can see, reification is done by referring from the reified construct (in this case the topic map) to the topic reifying it.

This leaves only the mergeMap element, which is still in XTM. Using it you can merge another XTM 2.0 file into the current one, as follows:

<mergeMap href="other.xtm"/>

Note that this shows the complete mergeMap element. Unlike in XTM 1.0 there isn't anything more you can do with it.

That's pretty much the whole syntax. I've left out variant names and item identifiers, but other than that this should provide everything you need to create XTM 2.0 topic maps. If you want more examples you may want to look at Topincs, which can export XTM 2.0 files.

Similar posts

Why XTM 2.0 is different from 1.0

Many people have asked what the changes between versions 1.0 and 2.0 of XTM are, and what the rationales for the various changes are

Read | 2006-12-16 19:17

A quick introduction to CXTM

I got some questions about how CXTM actually works, so I thought I'd put together a little introduction to it

Read | 2006-08-04 22:27

ISO meeting in Atlanta, day 2

Day 2 started with a presentation by Naito-san about a proposal from him and Komachi-san about a standard format for publishing PSIs

Read | 2005-11-14 00:35


No comments.

Add a comment

Name required
Email optional, not published
URL optional, published
Spam don't check this if you want to be posted
Not spam do check this if you want to be posted
> Home
> Technology
> Beer
> Personal

> The author .
> On Twitter


follow us in feedly

Subscribe by email:

My new book

det norske ølet

My other book

Guidebook to Lithuanian beer
Rough guide to
Lithuanian beer

Technology blogs

Robert Barta
Sveins blogg
Stephen Fry
Messages in a bottle
Alex Brown
Planet Topic Maps

Last comments

Lars Marius Garshol on A sudoku solver in P...

Heinz-GŁnter on A sudoku solver in P...

alex bloom on Active learning, alm...

alex bloom on Experiments in genet...

kenneth mwelwa on 10 tips on presentin...

fadirra on 7 tips on writing cl...

Tim on 7 tips on writing cl...

elmarie on What is an informati...

p2r on 7 tips on writing cl...

Jeffrey White on The solera paradox