Infoloom
Semantic Integration Technologies
|
![]() |
Simple examples of XTM code
Topic map, Base name and identifier, Variant name, Multiple names, multiple names with scopes, Occurrence, Topic types, Association Topic mapAn XTM topic map instance is an XML document and always starts with <topicMap> and ends with </topicMap> <topicMap> [...] </topicMap> Base name and identifierThe 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 nameIn 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 namesIn 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 scopesThis 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> OccurrenceIn 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 typesThe 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> AssociationThis 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> |
© 2005, Michel Biezunski |