Create a Topic Map

The Default Map

In the left-hand navigation panel, click the link labeled "New Map" under the heading "New". Notice that you are warned to save the old map. We do not have to save it for this example. Notice that you get a fresh text area ready to have a topic map pasted in. In this case, though, we want to create a new map so just press the "Build Topic Map" button. The "Associations and Topics" page loads into the right-hand panel. This is the main screen used to create topics and associations. Scopes and occurrences are handled in other pages.

JTMA creates all new topic maps with a set of default topics. This makes sure that the map uses types that the JTMA code can recognize. It is very possible to paste in maps that do not follow these conventions, and they will work, but JTMA may not be able to list certain information. For example, it would not recognize type-subtype relationships as special types of relationships to be displayed differently.

In the JTMA system, all topic types descend from a generic top-level type called "Urtype". This approach is common in taxonomies, although it is not required by Topic Map specifications.

Notice that the new map starts with eleven topic types (which are of course topics), including role, scope, and association types. In JTMA, a new topic must be given a type or it will not be created. This is not required by the core topic map engine itself, but is very convenient to make sure there is a known starting point for lists of topics, etc. That is why new maps are be salted with a few starter types.

Creating New Topics

Create a new topic, called, say, "Airplane". We can give it any legal id value, say "tt-airplane". To do this, in the lower right of the page, select "Ur-type", which will be the type of the new topic. Type the new id and name in the edit fields above the list of topics. Then press the "Add New Topic" button. Notice that the new topic appears highlighted in the topic list box.

We can now add a new topic of type Airplane by selecting "Airplane" (which has already been selected), and entering its new id and name. Type "Piper Cub" and "t-piper-cub" for the name and id. Press "Add New Topic As Instance"and notice that it is not shown in boldface.Boldfaceing in this list box is used to hint that a topic is intended to be used as a topic type rather than being just an instance. There is no such distinction in the topic map specifications, but it can be a usefulreminder to yourself. JTMA does this by seeing whether the topic id begins with "tt". If so, it assumes that the topic is intended as a topic type and highlights it. It is not at all necessary to follow this convention, but it can be convenient.

In the same way, create a new association type called "Airplane Pilot Association", with an id of "at-airplane-association". Also create a topic type "Person" (id "tt-person") of type "Ur-type" and a topic type "Pilot" (id "tt-pilot") as a subtype of "Person". Use the button labeled "Add New Topic As Subtype" to add a subtype.

Next create two roles types called "Airplane Role" (use "rt-airplane" for its id) and "Pilot Role" (use "rt-pilot" for the id). When you create these roles, select "Role Type" in the topic select list, and press the button labeled "Add New Topic As Instance".

Now create a topic for a specific airplane. This will represent a Piper Cub airplane with registration number N32968. Create it by typing "t-n32968" for the id, and "Cub N23968" for the name. Select "Piper Cub" in the topic select list, then press the button labeled "Add New Topic As Instance".

Similarly, create a topic of type "Pilot" named "John". You could make its id "t-john".

Note - JTMA will not create a new topic unless it has been given an id and a name, and unless a topic type has been selected. No warning will be given, but the new topic, not having been created, will not be listed in the topic select list.

Create a New Association

With the new association and role types, we can create an association. In the lower left select list, select the "Airplane-Pilot Association" association type. In the edit box labeled "ID for New Association", type an id: "a-cub-john". Then press the button labeled "Add New Association". Notice that the association becomes listed in the upper left select list. Association have no names of their own, so their ids are listed. The association type is displayed in the box just below the list of associations when an association is selected.

Add Roles to an Association

Next add the roles to the new association. Select the association in the upper left select list. Then select "Airplane Role" in the list box labeled "Role Types", and press the button labeled "Add Role To Association". Do the same for the Pilot Role. Notice that the newly assigned roles become listed in the list box labeled "Roles".

Assign Topics to the Roles

Assign the Pilot "John" to the Pilot Role for the association. In the Roles select list, select "Pilot Role". In the Topics select list, select "John". Press the button labeled "Add Player to Role". Notice that "John" appears in the "Role-Players" list box in the upper right.

Assign the airplane topic "Cub N32968" to the Airplane Role for the association. Make sure the association is still selected in the upper left select list (it should still be selected), select the Cub topic in the topic select list at the lower right of the panel, and then press the button labeled "Add Player to Role".

Assign a Scope to an Association

Create a new scope type to use with the new association. Select "Scope Type" for the topic type, and call the new scope type "Flying Scope" (the id could be "st-flying"). Press the button labeled "Add New Topic As Instance". Notice how the new scope appears on the list box labeled "scopes." Now select the desired association in the upper left select list, if it is not already selected. Then select the new scope in the "Scopes" list in the bottom, and press the button labeled "Add Scope to Assoc.". Notice that the newly assigned scope appears in the "scopes" list in the upper half of the page.

If you were to go to the Association-centric view now, you would see the new association and its scope displayed.

Add an Occurrence to a Topic

To add an occurrence, change to the Occurrences page using the "Occurrences" link in the left-hand panel. You use the bottom half of the page to add an occurrence, and the upper half to view occurrences and to edit them.

We will add an occurrence of type "note". This is one of the built-in occurrence types that JTMA builds into its maps.

Select the topic "John" in the select list labeled "Owner Topic".

Select "note" in the select list labeled "Occurrence Type".

Type some text for the note in the textarea box labeled "ResourceData".

Press the button labeled "Add Occurrence To Topic."

Notice in the upper left select box, the topic "John" is not boldfaced. This tells you that "John" has one or more occurrences. Gray topics have no occurrences.

The occurrences for a topic are listed by type in the select list labeled "Occurrences". If they have a scope assigned, it is listed in brackets next to the occurrence type. When you select one of the occurrences, its value is displayed in the textarea box labeled "Occurrence Data". There, you can edit it and save the new version using the button labeled "Change Occurrence".

To add a resourceRef URI to an occurrence (instead of just literal data), type it into the box labeled "ResourceRef" when you create the occurrence.