[topicmapmail] basics
Kal Ahmed
kal@techquila.com
26 May 2003 13:53:35 +0100
Hi Kathy,
On Mon, 2003-05-26 at 13:25, Lieberknecht, Katharina wrote:
> Hello, just a newbie with thousand and one basic questions ...
>
> 1. What kind of value do I give best to ids?
> a) alphanumeric (as shown below) or
> b) rather the name of the object (id="device")
>
If you are writing these files by hand, then you might find it easier to
use memorable IDs. However, because IDs must be unique within a single
XTM file, you may find that your hands are tied later on.
If you are generating your topic maps programmatically, then it probably
depends on your source - if there is some form of unique identifier you
can use in the source, then by all means use that. Otherwise, you are
probably better off with some simple id generation mechanism (like an
incrementing counter).
> 2. The xtm dtd provides an id for each element.
> What is the consequence (for applications, queries, etc.)
> if I give an id to e.g. baseName or if I omit it?
>
I believe that most tools will preserve the ID attribute value on most
XTM elements in some form or another. For example, in TM4J, the ID
attribute value is combined with the URI locator of the topic map being
parsed to create the sourceLocator property of a TopicMapObject. This
property can then be accessed programmatically and an index of objects
by sourceLocator is also available. I believe you will find something
similar in most topic map processing tools. In the Standard Application
Model which is still being worked on by ISO, the same notion of "source
locators" as the address of the element which was parsed to create the
object also exists.
If you omit the ID, then you will not have a value for this
sourceLocator property, and so will not be able to address the object
directly.
> 3. Below is a example for the use of baseName and variant, scopes and topic
> types.
> Is this the correct way to use it?
>
This looks fine to me. As with many things, there is more than one way
to approach this, but your approach is a reasonable one with one note -
I would have expected to see "Vorgang" and "Vorrichtung" as the
baseNameString for the names in the scope "German".
>
> <!--Topic Templates (classes)-->
> <topic id="te02">
> <baseName>
> <scope><!--Scope TS - english--><topicRef
> xlink:href="#ts01"/></scope>
> <baseNameString>activity</baseNameString>
> <variant><parameters><!--Parameter TT - display--><topicRef
> xlink:href="#tt01"/></parameters>
>
> <variantName><resourceData>Activity</resourceData></variantName>
> </variant>
> <variant><parameters><!--Parameter TT - synonym--><topicRef
> xlink:href="#tt02"/></parameters>
>
> <variantName><resourceData>Process</resourceData></variantName>
> </variant>
> </baseName>
> <baseName>
> <scope><!--Scope TS - german--><topicRef
> xlink:href="#ts02"/></scope>
> <baseNameString>activity</baseNameString>
> <variant><parameters><!--Parameter TT - display--><topicRef
> xlink:href="#tt01"/></parameters>
>
> <variantName><resourceData>Vorgang</resourceData></variantName>
> </variant>
> </baseName>
> </topic>
>
> <topic id="te01">
> <baseName id="id01b01">
> <scope><!--Scope TS - english--><topicRef
> xlink:href="#ts01"/></scope>
> <baseNameString>device</baseNameString>
> <variant><parameters><!--Parameter TT - display--><topicRef
> xlink:href="#tt01"/></parameters>
>
> <variantName><resourceData>Device</resourceData></variantName>
> </variant>
> </baseName>
> <baseName>
> <scope><!--Scope TS - german--><topicRef
> xlink:href="#ts02"/></scope>
> <baseNameString>device</baseNameString>
> <variant><parameters><!--Parameter TT - display--><topicRef
> xlink:href="#tt01"/></parameters>
>
> <variantName><resourceData>Vorrichtung</resourceData></variantName>
> </variant>
> </baseName>
> </topic>
>
> <!-- Instances -->
> <topic id="ti01">
> <instanceOf><topicRef xlink:href="#te01"/></instanceOf>
> <baseName><baseNameString>switch B11</baseNameString></baseName>
> </topic>
>
>
>
> <!--Topic Types -->
> <topic id="tt01">
> <baseName><baseNameString>display</baseNameString></baseName>
> </topic>
> <topic id="tt02">
> <baseName><baseNameString>synonym</baseNameString></baseName>
> </topic>
>
>
> <!-- Scopes -->
> <topic id="ts01">
> <baseName>
> <baseNameString>en</baseNameString>
> </baseName>
> </topic>
> <topic id="ts02">
> <baseName>
> <baseNameString>de</baseNameString>
> </baseName>
> </topic>
>
Cheers,
Kal
--------------------------------------
Kal Ahmed, Techquila
Standards-based Information Management
e: kal@techquila.com
p: +44 7968 529531
w: www.techquila.com