1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754
|
<html><!-- Automatically generated, do not edit -->
<head>
<title>AsTMa= Authoring Tutorial</title>
<link rel="stylesheet" media="screen" href="astma-print.css" type="text/css">
</head>
<body bgcolor="white" >
<h1>AsTMa= Authoring Tutorial</h1><p>
Robert
Barta
<a href="http://www.bond.edu.au/">Bond University</a>
<address><a href="mailto:rho@bond.edu.au">rho@bond.edu.au</a></address>
</p>Copyright ©
2002
<a href="mailto:rho@bond.edu.au">Robert Barta</a>
<p>
<p>
AsTMa= is part of the <a href="astma-family.dbk">AsTMa language family</a> which was
designed to facilitate authoring, constraining and querying topic maps. This documents provides
an introduction of AsTMa= to Topic Map authors who have already some knowledge using XTM.
</p>
</p><releaseinfo>v1.0, 2002-07-10, Revision 1.0</releaseinfo>
<hr>
<h2>Introduction</h2>
<p>
Since the stabilisation of <a href="http://www.topicmaps.org/xtm/">XTM</a>, an XML-based
notation for <a href="http://www.topicmaps.org/">Topic Maps</a>, the interest in authoring Topic Maps
has increased.
</p>
<p>
While the automatic generation of topic maps from backend databases into XTM can easily be achieved,
manual authoring in XTM is tedious and error-prone. One option is to use XML aware development tools, such as
XML-editors or XML IDEs. While feasible, generic XML editors offer little help above syntactical conformance.
Another option is to use integrated development environments for Topic Maps (server or client-side) as
they have appeared in the market.
</p>
<p>
AsTMa= is a linear, textual notation for Topic Map information. The motivation was
to create a shorthand notation in contrast to
<a href="http://www.topicmaps.org/xtm/">XTM</a> which is mainly suitable for interchange purposes.
This motivation it shares with comparable languages as <a href="http://www.ontopia.net/download/ltm.html">LTM</a>.
</p>
<p>
In the tradition of
<a href="http://www.la.unm.edu/~mbrettin/algorithms/huffman.html">Huffman-encoding</a> languages
AsTMa= has the following design objectives:
</p>
<p>
<dl>
<h2>AsTMa design objectives</h2>
<dt><strong>Minimum of effort:</strong></dt>
<dd>A converter should be able to <i>interpret</i> the intention of the author in a
specific context reducing the verbosity of the language (DWIM, do what I mean).</dd>
<dt><strong>Minimal use of special characters and keywords:</strong></dt>
<dd>Banning of [(&^%$}] delimiters should increase the usability of the language. This also
reduces the need to escape these special characters once they belong to the information.</dd>
<dt><strong>Asymptotic regarding to XTM:</strong></dt>
<dd>The language should not have a built-in <i>syntax-sound-barrier</i> making it
impossible to reach the same expressiveness as XTM.</dd>
<dt><strong>Keep things together:</strong></dt>
<dd>The author should not be forced to split up (topic) information into several fragments, which have
to be <a href="http://www.topicmaps.org/xtm/1.0/#def-topic-naming-constraint">merged via TNC</a>
afterwards by a followup Topic Map processing stage.</dd>
</dl>
</p>
<p>
At this stage AsTMa= does not fulfill all of the above objectives.
As outlined in more detail in the <a href="#conformance">section about conformance</a>, AsTMa=
is (yet) not as expressive as XTM, that not having been a prime concern. Still, AsTMa= is
sufficiently rich to prototype medium sized topic maps.
</p>
<p>
The following setting assumes that the AsTMa= text will be either directly understood by a particular
Topic Map processing software or that a specialized processor will first convert the AsTMa= text stream
into an XTM stream.
</p>
<h2>Basics</h2>
<p>
AsTMa= is line oriented. This means that pertinent information is terminated with the end of the line. A single
line containing
<pre class="astma">
filesystem (software)
</pre>
already defines a topic (as explained below). If there is more to a topic (or an association) this information
will be on follow-up lines:
<pre class="astma">
filesystem (software)
bn: File System
</pre>
</p>
<p>
An empty line, thus, separates items like topics and associations. On any line white-spaces can be used
before and after keywords and special characters. They are silently ignored.
Any line also can contain comment introduced by the character '#' (following a white-space character):
<pre class="astma">
filesystem (software) # more information will follow
</pre>
Such comments will be discarded by any processor and are only for <i>internal</i> documentation purposes.
</p>
<p>
Please note that (starting from Rev1.5) such a comment must have at least one blank before the '#'. This allows
the hasslefree notation of URIs containing a '#' and avoid that the XPointer part will be interpreted as comment.
The blanks between the text and the '#' are ignored.
</p>
<p>
If you would like to have a comment in the processor output, then this comment MUST begin at the start of a line:
</p>
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
# I will survive and (hopefully)
# the line structure will not
# be broken
</pre>
</td>
<td>
<pre class="xtm">
<!-- I will survive and (hopefully)
the line structure will not
be broken -->
</pre>
</td>
</tr>
</tbody>
</table>
<p>
Comments on consecutive lines will be treated as one comment. Any non-comment line
signals the end of such a group. Also, any '-->' occurrence within a comment will be
converted into '--_ >' (one underscore character) to avoid obvious problems in the resulting
XML code.
</p>
<h2>Topics</h2>
<p>
The line
<pre class="astma">
reiserfs (filesystem)
</pre>
indicates the definition of a topic with id <tt>reiserfs</tt> which is an instance of another topic,
<tt>filesystem</tt>:
</p>
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
reiserfs (filesystem)
</pre>
</td>
<td>
<pre class="xtm">
<topic id="reiserfs">
<instanceOf>
<topicRef xlink:href="#filesystem"/>
</instanceOf>
<baseName>
<baseNameString>filesystem</baseNameString>
</baseName>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
<p>
As we did not provide a base name, the topic id <tt>reiserfs</tt> is also assumed to be the topic's
basename. While this heuristic approach works fine for some words, it does not necessarily do well with others, say,
</p>
<pre class="astma">
linux-distribution (software)
</pre>
<p>
which would designate <tt>linux-distribution</tt> as being an instance of some software.
Any AsTMa= processor is free to apply any kind heuristics to derive a base name once none is provided
explicitely, as for example:
</p>
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
linux-distribution (software)
</pre>
</td>
<td>
<pre class="xtm">
<topic id="linux-distribution">
<instanceOf>
<topicRef xlink:href="#software"/>
</instanceOf>
<baseName>
<baseNameString>linux distribution</baseNameString>
</baseName>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
<p>
substituting dashes by blanks, looking up 3rd-party databases or leaving it as it is. Of course,
the author can enforce a particular base name:
</p>
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
RedHat-Linux-sparc (linux-distribution-port)
bn: RedHat Linux for SPARC
</pre>
</td>
<td>
<pre class="xtm">
<topic id="RedHat-Linux-sparc">
<instanceOf>
<topicRef
xlink:href="#linux-distribution-port"/>
</instanceOf>
<baseName>
<baseNameString>RedHat Linux
for SPARC</baseNameString>
</baseName>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
<p>
On a similar take, you can also add occurrences for topics:
</p>
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
linux (os)
bn: Linux kernel
oc: http://www.kernel.org/
</pre>
</td>
<td>
<pre class="xtm">
<topic id="linux">
<instanceOf>
<topicRef xlink:href="#os"/>
</instanceOf>
<baseName>
<baseNameString>Linux kernel</baseNameString>
</baseName>
<occurrence>
<resourceRef xlink:href="http://www.kernel.org/"/>
</occurrence>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
<p>
in the case for resource references or also for inline data (XTM resourceData):
</p>
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
linux-port-on-sparc (linux-port)
bn: SPARC Linux port
oc: http://www.sparc.org/linux.shtml
in: The kernel and kernel modules \
are 64-bit on sparc64, \
userland is still 32-bit, \
and in fact the same as on sparc32.
</pre>
</td>
<td>
<pre class="xtm">
<topic id="linux-port-on-sparc">
<instanceOf>
<topicRef xlink:href="#linux-port"/>
</instanceOf>
<baseName>
<baseNameString>SPARC Linux
port</baseNameString>
</baseName>
<occurrence>
<resourceRef xlink:href="http:....linux.shtml"/>
</occurrence>
<occurrence>
<resourceData>The kernel ...</resourceData>
</occurrence>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
Any number of occurrences can be added.
<h2>Types and Scopes</h2>
<p>
If appropriate, you can also type topic characteristics:
</p>
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
reiserfs (filesystem)
bn: Reiser File System, ReiserFS
oc (download): \
http://www.namesys.com/download.html
</pre>
</td>
<td>
<pre class="xtm">
<topic id="reiserfs">
<instanceOf>
<topicRef xlink:href="#filesystem"/>
</instanceOf>
<baseName>
<baseNameString>Reiser ....</baseNameString>
</baseName>
<occurrence>
<instanceOf>
<topicRef xlink:href="#download"/>
</instanceOf>
<resourceRef xlink:href="http:...download.html"/>
</occurrence>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
<p>
To scope a characteristic you use '@' to introduce a particular context:
</p>
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
RedHat-Linux-sparc (linux-distribution-port)
bn: RedHat Linux for SPARC
bn @ deutsch : RedHat Linux f&uuml;r SPARC
</pre>
</td>
<td>
<pre class="xtm">
<topic id="RedHat-Linux-sparc">
<instanceOf>
<topicRef
xlink:href="#linux-distribution-port"/>
</instanceOf>
<baseName>
<baseNameString>
RedHat Linux for SPARC
</baseNameString>
</baseName>
<baseName>
<scope>
<topicRef xlink:href="#deutsch"/>
</scope>
<baseNameString>
RedHat Linux f&uuml;r SPARC
</baseNameString>
</baseName>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
<h2>Associations</h2>
<p>
Associations may or may not have a particular association type. This topic type is provided inside
a () pair.
<pre class="astma">
(kernel-patch-provides-feature)
...
</pre>
If the association has no explicit type, it can be omitted, by writing only <tt>()</tt>.
</p>
<p>
Associations also have a number of members playing roles:
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
(kernel-patch-provides-feature)
feature: reiserfs
platform: i386
patch: generic-reiserfs-patch-2.4.x
</pre>
</td>
<td>
<pre class="xtm">
<association>
<instanceOf>
<topicRef xlink:href="#kernel-patch-provides-feature"/>
</instanceOf>
<member>
<roleSpec>
<topicRef xlink:href="#feature"/>
</roleSpec>
<topicRef xlink:href="#reiserfs"/>
</member>
<member>
<roleSpec>
<topicRef xlink:href="#platform"/>
</roleSpec>
<topicRef xlink:href="#i386"/>
</member>
<member>
<roleSpec>
<topicRef xlink:href="#patch"/>
</roleSpec>
<topicRef xlink:href="#generic-reiserfs-patch-2.4.x"/>
</member>
</association>
</pre>
</td>
</tr>
</tbody>
</table>
</p>
<p>
For better readability you may want to indent the roles
<pre class="astma">
(kernel-patch-provides-feature)
feature: reiserfs
platform: i386
patch: generic-reiserfs-patch-2.4.x
</pre>
</p>
<h2>Identification and Reification</h2>
<p>
Topics are said to <i>reify</i> subjects. Either a topic in a topic map is a
<i>representant</i> of the subject. That is the case if the subject itself is
not directly addressable.
Or---if it is---then the topic can directly and unambiguously name the subject it embodies via a URI.
</p>
<p>
In case a subject indicator (a not necessarily unique identification for a particular subject) is known, it can
be provided via <i>sin</i>:
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
linux (os)
bn: Linux kernel
oc: http://www.kernel.org/
sin: http://dmoz.org/.../Linux/
</pre>
</td>
<td>
<pre class="xtm">
<topic id="linux">
<instanceOf>
<topicRef xlink:href="#os"/>
</instanceOf>
<baseName>
<baseNameString>Linux kernel</baseNameString>
</baseName>
<occurrence>
<resourceRef xlink:href="http://www.kernel.org/"/>
</occurrence>
<subjectIdentity>
<subjectIndicatorRef
xlink:href="http://dmoz.org/.../Linux/"/>
</subjectIdentity>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
Several such subject indicators can be provided for a single topic. If the indicator string provided contains
a URI scheme, then AsTMa assumes a reference to an (external) subject indicator. Otherwise, AsTMa will assume
this to be a reference to a local topic (topicRef):
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
linux (os)
bn: Linux kernel
...
sin: http://dmoz.org/.../Linux/
sin: linux-os
</pre>
</td>
<td>
<pre class="xtm">
<topic id="linux">
<instanceOf>
<topicRef xlink:href="#os"/>
</instanceOf>
<baseName>
<baseNameString>Linux kernel</baseNameString>
</baseName>
...
<subjectIdentity>
<subjectIndicatorRef
xlink:href="http://dmoz.org/.../Linux/"/>
<topicRef
xlink:href="#linux-os"/>
</subjectIdentity>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
</p>
<p>
In the case where the topic is the subject in question, we can use
AsTMa's <i>reify</i> clause:
</p>
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
linux-kernel-site (web-site) reifies http://www.linux.org/
bn: Linux kernel Site
...
</pre>
</td>
<td>
<pre class="xtm">
<topic id="linux-kernel-site">
<instanceOf>
<topicRef xlink:href="#web-site"/>
</instanceOf>
<baseName>
<baseNameString>Linux kernel Site</baseNameString>
</baseName>
...
<subjectIdentity>
<resourceRef
xlink:href="http://www.linux.org/"/>
</subjectIdentity>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
The subject provided can be external (by providing a full URI) or can also be a local resource, such as another
topic or an association.
It is clear from the syntax that only a single such resource reference can be specified.
<p>
On some occasions it is more convenient to use the reification the other way round, as in
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
linux-org (web-site) is-reified-by linux-kernel-site
oc: http://www.linux.org/
linux-kernel-site
bn: Linux kernel Site
</pre>
</td>
<td>
<pre class="xtm">
<topic id="linux-org">
<instanceOf>
<topicRef xlink:href="#web-site"/>
</instanceOf>
<baseName>
<baseNameString>linux org</baseNameString>
</baseName>
</topic>
<topic id="linux-kernel-site>
<baseName>
<baseNameString>Linux kernel Site</baseNameString>
</baseName>
<subjectIdentity>
<resourceRef
xlink:href="#linux-org"/>
</subjectIdentity>
</topic>
</pre>
</td>
</tr>
</tbody>
</table>
While a topic-topic reification might be of limited use, reifying associations helps to create a
topic about the association statement:
<pre class="astma">
(threatens) is-reified-by threat-1
victim: it-market
threat: linux
threat-1 (threat)
bn: Linux threatens the IT market
(claims)
claimant: mirkosoft
claim: threat-1
</pre>
</p>
<h2>Topic Maps</h2>
<p>
There is no special format or syntax for an AsTMa= Topic Map instance. All text blocks within the
document are regarded to be part of the map.
</p>
<p>
Optionally you can control the name (id) of the Topic Map. This, though, might have only relevance
to your local topic map processor, so there is no counterpart of this in XTM.
When doing so, then the <i>very first non-empty line within the document</i> MUST provide
this name (identifier) of the topic map itself:
<table border="1" width="100%">
<tbody>
<tr><td>AsTMa=</td><td>XTM</td></tr>
<tr>
<td>
<pre class="astma">
sparclinux : iso-8859-1
</pre>
</td>
<td>
<pre class="xtm">
<?xml version="1.0" encoding="iso-8859-1"?>
<topicMap id="sparclinux"
xmlns = 'http://www.topicmaps.org/xtm/1.0/'
xmlns:xlink = 'http://www.w3.org/1999/xlink'>
</pre>
</td>
</tr>
</tbody>
</table>
</p>
<p>
As you can see, you may specify also a particular encoding. If omitted, the encoding defaults to iso-8859-1.
</p>
<p>
Any AsTMa= implementation may also provide special commands or syntactical forms to control
other processing aspects of your map. Please consult the appropriate documentation.
</p>
</body>
</html>
|