Text, ?Text, and ?Keyword

In the examples above, Text fields have been used to contain various kinds of information, typically descriptive material that might consist of a word, phrase, or several sentences. While a Text field can contain any kind of data, ACEDB also provides special classes that can make textual entries even more useful. This section introduces them and explains their similarities and differences.

A Text entry is part of an object and is not linked to any other object. Just as with Ints and Floats, if a user double-clicks on Text nothing happens. If a user wants to search for objects containing a specific Text entry, a query is required that examines the entries following the appropriate label.

What would it mean if Text were connected to other objects? This is the functionality provided by the ?Text class. A model that contains this structure

?TShirt Remarks ?Text
specifies a link to a ?Text object. The rules for filling in this field are the same as for any link. For example, if you provide the data:

TShirt : Sam80
Remarks "one of my favorites!"
you will create a link to a text object named "one of my favorites!".

Note that the text is not in boldface. This is an exception to the way in which ACEDB normally represents links. Nonetheless a link does exist and when the user double-clicks on the data in this field, a new window will appear showing the contents of the ?Text object:

In this context, "Sam80" is a link back to the TShirt object with that name.

What makes ?Text particularly powerful is the nature of its link back to other objects. From earlier discussions you might guess that it must look like this:

?Text Quoted_in ?TShirt
but then how could ?Text be used in different classes? ?Text has a special structure that permits a link to any object in any class:

?Text Quoted_in ANY
To illustrate the flexibility of ANY, consider two models:

?TShirt Remarks ?Text
 
?Person Remarks ?Text
and this data:

TShirt : sam12
Remarks "great at parties!"
 
Person : "Tom Smith"
Remarks "great at parties!"
After entering the data, we examine either sam12 or Tom Smith and double-click on the phrase "great at parties". The new window that opens contains links back to both objects.

This "indexing" should remind you of the exhaustive listing one finds at the back of some books, where terms are followed by the pages they appear on.

In addition to being "double-clickable", ?Text entries can be searched directly from the Text Search box in the ACEDB main window. This quick search utility does not search Text fields.

When trying to decide between using Text or ?Text fields in a model, think about whether the special properties of ?Text will give your users an advantage. If the data is likely to be queried only rarely, or if it is rarely repeated, then Text is probably fine. But if indexing will help your users, or if the data should be searchable from the Text Search box, ?Text is the way to go.

Keywords

A class with very similar properties is ?Keyword, traditionally used to associate keywords with objects, for example:

?Reference Keyword ?Keyword
 
?Sequence Keyword ?Keyword
The Keyword class is searchable via the Text Search box and may appear on ACEDB's main window, from which it can be examined like any other class). You might want to reserve ?Keyword to contain genuine keywords from bibliographic records or other lists of controlled or semi-controlled terms.

There are two characteristics to note concerning Text, ?Text and ?Keyword. First, when a user examines an object containing these fields, the text appears verbatim on screen along with all the other data associated with the object. Second, while the fields may contain entire paragraphs, it is impossible to preserve divisions between paragraphs. A multi-paragraph entry must appear as a solid block of text. There is also no control over line wrapping or indentation. Thus it is prudent to reserve these fields for relatively short entries unless you don't mind the line breaks that ACEDB imposes.


Show me the whole t-shirt model again.

Back to Table of Contents