Infoloom
Semantic Integration Technologies
Michel Biezunski
Brooklyn, New York
mb@infoloom.com

Simple examples of XTM code

XTM Guide
The XTM DTD
The annotated XTM DTD
How to read a DTD


Topic map, Base name and identifier, Variant name, Multiple names, multiple names with scopes, Occurrence, Topic types, Association

Topic map

An XTM topic map instance is an XML document and always starts with <topicMap> and ends with </topicMap>

<topicMap>
  [...]
</topicMap>

Base name and identifier

The id attribute is used internally within the topic map instance document to refer to the topic element. The base name of a topic is contained within an element called baseNameString, itself contained in an element called baseName. In this example, the topic base name is "New York".

<topic id="t1">
<baseName>
  <baseNameString>New York</baseNameString>
</baseName>
</topic>

Variant name

In this example, the topic whose base name is New York has a variant name "NYC" used for Wireless devices. The parameters contains the information indicating the context of use of the variant name.

<topic id="t1" >
<baseName>
<baseNameString>New York</baseNameString>
<variant>
  <parameters>
     <topicRef xlink:href="http://www.topicmaps.org/procs.xtm#psi-display"/>
     <subjectIndicatorRef xlink:href="http://www.whatever.com/wap"/>
  </parameters>
   <variantName>
     <resourceData>NYC</resourceData>
   </variantName>
</variant>
</baseName>
</topic>

Multiple names

In this example, the topic has two base names: New York and New York City.

<topic id="t1">
<baseName>
  <baseNameString>New York</baseNameString>
</baseName>
<baseName>
  <baseNameString>New York City</baseNameString>
</baseName>
</topic>

Multiple names with scopes

This example shows a topic having two names used within different scopes. The singular and plural forms of a word are used as scopes.

<topic id="t1">
<baseName>
  <scope><topicref xlink:href="http://www.x.com/index.xtm#singular"/></scope>
  <baseNameString>room</baseNameString>
</baseName>
<baseName>
  <scope><topicref xlink:href="http://www.x.com/index.xtm#plural"/></scope>
  <baseNameString>rooms</baseNameString></baseName>
</topic>

Occurrence

In this example, there is a photograph described as an occurrence of the topic "New York". Note that "photograph" is a pointer to a topic presumably explaining what a photograph is.

<topic id="t1">
<baseName>
       <baseNameString>New York</baseNameString>
</baseName>
<occurrence>
   <instanceOf>
        <topicRef xlink:href="#Photograph"/>
   </instanceOf>
   <resourceRef xlink:href="doc1#n001"/>
</occurrence>
</topic>

Topic types

The topic which has as base names "New York" and "Big Apple" is indicated as having for type a topic identified by the unique identifier "cty" which happens to be the defining topic for the notion of "city". This topic has three different base names ("city", "ville" and "ciudad".

<topic id="t1">
<instanceOf><topicRef xlink:href="#cty"/></instanceOf>
<baseName><baseNameString>New York</baseNameString></baseName>
<baseName><baseNameString>Big Apple</baseNameString></baseName>
</topic>

<topic id="cty">
<baseName><baseNameString>city</baseNameString></baseName>
<baseName><baseNameString>ville</baseNameString></baseName>
<baseName><baseNameString>ciudad</baseNameString></baseName>
</topic>

Association

This example associates the two topics having for names "New York" and "Brooklyn Bridge". The semantics of the association is: "When in New York, visit Brooklyn Bridge.

<topic id="t1">
<baseName><baseNameString>New York</baseNameString></baseName>
</topic>

<topic id="b298">
<baseName><baseNameString>Brooklyn Bridge</baseNameString>
</baseName></topic>

<association>
   <member>
       <roleSpec><topicRef xlink:href="#when-in"/></roleSpec>
       <topicRef xlink:href="#t1"/></member>
  <member>
       <roleSpec><topicRef xlink:href="#visit"/></roleSpec>
       <topicRef xlink:href="#b298"/></member>
</association>
Semantic Integration
Technologies
Consulting
Production Services

Customers
Customers' Products

Partners
Mailing lists
Organizations

Presentations

Bio
Contact me

© 2005, Michel Biezunski