四、 主題地圖資源指引之實作
4.3 實作與呈現
4.3.3 建立 XTM 文件
除了使用 TM4L 編輯器來建構主題地圖外,也可以 XTM 規格所制定的語 法結構直接進行編輯,再匯入到編輯軟體 TM4L 中,以下即介紹 XTM 文件的 建立實例。
文件在未設定編碼屬性時,XTM 文件會以 UTF-8 為預設值,文件存檔時 副檔名需設為 .xtm。
z 首先,替 <TopicMap> 元素加入ID,使其具體化 1,參見圖 35。
<?xml version="1.0" encoding="UTF-8" ?>
- <TopicMap id="x1nhncorcr-4" xml:base="file:/C:/Documents and Settings/Administrator/桌面
/tm4l-1.0-bin/tm4l-1.0-bin/xtm/chu_lib2"
xmlns="http://www.TopicMaps.org/xtm/1.0/"
1 「具體化」是指將某種抽象或具體之事物,以某種具體事物將其指涉出來。在 Topic Maps 中,「具體化」意指將「關聯」、「資源指引」,或「主題地圖本身」,轉化為「主題」的過 程。
xmlns:xlink="http://www.w3.org/1999/xlink">
</TopicMap>
圖 35 具體化主題地圖實例
z 建立主題的方式是利用 <Topic> 這個元素,如主題「工管系相關期 刊」,參見圖 36。
<?xml version="1.0" encoding="UTF-8" ?>
- <TopicMap id="x1nhncorcr-4" xml:base="file:/C:/Documents and Settings/Administrator/桌面
/tm4l-1.0-bin/tm4l-1.0-bin/xtm/chu_lib2"
xmlns="http://www.TopicMaps.org/xtm/1.0/"
xmlns:xlink="http://www.w3.org/1999/xlink">
- <Topic id=" x1nhncsf5l-f62">
- <baseName id=" x1nhncsf5l-f63">
<baseNameString>工管系相關期刊</baseNameString>
</baseName>
</Topic>
</TopicMap>
圖 36 主題地圖的主題編碼實例
z 加入主題類型的方式,則是以 <instanceOf> 這個元素來為主題定義類 型,參見圖 37。
當然在定義主題類型之前,必須先建立一個「網路連結」主題,建立方式 如上述建立「工管系相關期刊」主題之方式,並將「網路連結」這個主題的 Topic ID 設為 "x1nhncsf5l-e28" 。
<?xml version="1.0" encoding="UTF-8" ?>
- <TopicMap id="x1nhncorcr-4" xml:base="file:/C:/Documents and Settings/Administrator/桌面
/tm4l-1.0-bin/tm4l-1.0-bin/xtm/chu_lib2"
xmlns="http://www.TopicMaps.org/xtm/1.0/"
xmlns:xlink="http://www.w3.org/1999/xlink">
- <Topic id=" x1nhncsf5l-f62">
- <baseName id=" x1nhncsf5l-f63">
<baseNameString>工管系相關期刊</baseNameString>
</baseName>
- <instanceOf>
<TopicRef xlink:href="#x1nhncsf5l-e28" />
</instanceOf>
</Topic>
</TopicMap>
圖 37 主題地圖的主題類型編碼實例
z 加入資源指引的方式,是以 <occurrence> 這個元素來為主題加入資源 指引,參見圖 38。
<?xml version="1.0" encoding="UTF-8" ?>
- <TopicMap id="x1nhncorcr-4" xml:base="file:/C:/Documents and
Settings/Administrator/桌面/tm4l-1.0-bin/tm4l-1.0-bin/xtm/chu_lib2"
xmlns="http://www.TopicMaps.org/xtm/1.0/"
xmlns:xlink="http://www.w3.org/1999/xlink">
- <Topic id=" x1nhncsf5l-f62">
- <baseName id=" x1nhncsf5l-f63">
<baseNameString>工管系相關期刊</baseNameString>
</baseName>
- <occurrence id="x1nhncsf5l-f81">
- <instanceOf>
<TopicRef xlink:href="#x1nhncsf5l-e28" />
</instanceOf>
<resourceRef
xlink:href="http://www.lib.chu.edu.tw/information/
%BA%DE%B2z%BE%C7%B0%7C/%A4u%BA%DE.htm#sec4"/>
</occurrence>
</Topic>
</TopicMap>
圖 38 主題地圖的資源指引編碼實例
z 在編輯完主題、資源指引後,接下來就可以利用 <association> 這個元 素來為主題加入關聯了,參見圖 39。
<?xml version="1.0" encoding="UTF-8" ?>
- <TopicMap id="x1nhncorcr-4" xml:base="file:/C:/Documents and Settings/Administrator/桌面
/tm4l-1.0-bin/tm4l-1.0-bin/xtm/chu_lib2"
xmlns="http://www.TopicMaps.org/xtm/1.0/"
xmlns:xlink="http://www.w3.org/1999/xlink">
- <Topic id=" x1nhncsf5l-f62">
- <baseName id=" x1nhncsf5l-f63">
<baseNameString>工管系相關期刊</baseNameString>
</baseName>
</Topic>
-<association id="x1nhncsf5l-ee1">
- <instanceOf>
<TopicRef xlink:href="#x1nhncsf5l-d63" />
</instanceOf>
-<member id="x1nhncsf5l-ee2">
-<roleSpec>
<TopicRef xlink:href="#x1nhncsf5l-d65" />
</roleSpec>
<TopicRef xlink:href="#x1nhncsf5l-e8c" />
</member>
-<member id="x1nhncsf5l-ee3">
-<roleSpec>
<TopicRef xlink:href="#x1nhncsf5l-d68" />
</roleSpec>
<TopicRef xlink:href="#x1nhncsf5l-e00" />
</member>
</association>
</TopicMap>
圖 39 主題地圖的關聯編碼實例