A scope indicates the context within which a characteristic of a topic (a name, an occurrence or a role played in an association) may be considered to be true. One common use of scope is to provide localised names for topics. For example "company" in English could be "société" in French or "Firma" in German. They all describe the same concept and so should be represented by the same topic. Rather than creating separate topics one should instead create a single topic to represent the concept of a company and add to it three separate base names, using scope to indicate that a particular base name should be used for a specific language environment. Sample 6 shows this use of scope in a simple example.
<topicMap>
<!-- Some topics for the languages -->
<topic id="en"/>
<topic id="fr"/>
<topic id="de"/>
<topic id="company">
<baseName>
<scope>
<topicRef xlink:href="#en"/>
</scope>
<baseNameString>company</baseNameString>
</baseName>
<baseName>
<scope>
<topicRef xlink:href="#fr"/>
</scope>
<baseNameString>société</baseNameString>
</baseName>
<baseName>
<scope>
<topicRef xlink:href="#de"/>
</scope>
<baseNameString>Firma</baseNameString>
</baseName>
</topic>
</topicMap>
Sample 6 - Scope example
If a characteristic has no scope defined for it, then it is said to be in the unconstrained scope. Any characteristic defined in the unconstrained scope is always considered to be valid. Beyond this, the XTM specification leaves the precise effect of scope on processing up to individual applications. In practice, the scope of a characteristic is usually compared to a collection of topics representing the current context of the user or the application. The results of this comparison are then used to determine whether or not a given characteristic is valid. When comparing sets of topics in this way, standard mathematical set operations can be applied. For example a characteristic could be considered "valid" if the topics in its scope form a subset of the topics that define the user context. Alternatively, a characteristic could be regarded as "valid" if the union of the topics in the scope of the characteristic and the topics defining the user context is not the empty set. These two possible approaches are shown in Figure 4.
The topic map community is currently debating whether more prescriptive definitions of scope and of the way in which scope should be used are required. It seems likely that such definitions will be forthcoming in order to support the needs of layered standards such as a query language.
Figure 4 - Two approaches to determining characteristic validity (SVG version)
| Up: Topic Map Basics | |
| Previous: Name Variants | Next: Identity |