Defining Term Lists
Term lists provide a way to customize a DeepSee model without programming. This chapter describes how to define them. It discusses the following topics:
Overview of Term Lists
Term lists provide a way to customize a DeepSee model without programming. A term list is a simple (but extendable) list of key and value pairs. The key values must be unique within the list. You can extend the term list by adding custom fields. You can use term lists in the following ways:
You can use a term list to define additional data to use in the cube. In this case, the term list is used when the cube is built. For example, you can use a term list to define a set of values to use as properties of a level. Or you could use a term list to provide an alternative set of names for the level members.
You can use term lists to define matching dictionaries for use with unstructured data. See “Using Unstructured Data in Cubes” in Defining DeepSee Models.
Accessing the Term List Manager
To define and modify term lists, you use the Term List Manager. To access this tool:
Select the InterSystems Launcher and then select Management Portal.
Depending on your security, you may be prompted to log in with a Caché username and password.
Switch to the appropriate namespace as follows:
Select the namespace.
Select DeepSee > Tools > Term List Manager.
The Term List Manager page initially looks like this:
On this page you can do the following:
Create new term lists. Select New and continue as described in “Defining a Term List.”
Open and modify existing term lists. Select Open, select a term list, and continue as described in “Defining a Term List.”
Export and import term lists. See “Exporting and Importing Term Lists.”
Defining a Term List
To define a term list, select New. The system displays a dialog box that asks for the name of the new term list. Enter a name and select OK. Then do the following tasks as needed:
Enter descriptive information about the term list into the following optional fields on the Details tab:
Caption — Optional caption for the term list
Subject Area — Select the subject area where this term list will be used
Description — Longer description of the term list
For information on Pattern, see “Specifying the Pattern for a Term List.”
Add terms. To do so, select Add Term on the right. Or select the New Term button .
A new row is added to the bottom of the term list.
Add custom fields. To do so, enter a value into Field Name and then select the Add Field button on the right. Or select the New Field button .
A new column is added on the right side of the term list.
Enter values into cells. To enter a value, select a cell and type a value. Then move the cursor to another cell, press Enter, or select OK.
Remove a term. To do so, select the row for the term and select Remove Term on the Details tab.
Remove a custom field. To do so, select the column for the custom field and select the Remove Field button on the right.
Then save the term list. To do so, select Save or Save As. If you select Save As, specify a new name and then select OK.
Specifying the Pattern for a Term List
The %TERMLIST function returns a set that, by default, consists of members that are identified by the keys in the term list, in combination with the term list pattern.
If you intend to use a term list with the %TERMLIST function, then define the term list as follows:
For each term, specify the value field as a member name or the numeric key.
For Pattern, specify an expression of one of the following forms:
If the value field contains member names, use the form:
[dimension name].[hierarchy name].[level name].[*]
If the value field contains member keys, use the form:
[dimension name].[hierarchy name].[level name].&[*]
In either case, dimension name, hierarchy name, and level name are the names of the dimension, hierarchy, and level to which the member belongs. The asterisk represents the value in the value field. For an example, see %TERMLIST in the DeepSee MDX Reference.
Exporting and Importing Term Lists
Exporting a Term List
To export a term list:
Display the term list in the Term List Manager.
Select Export. The system generates a file.
Depending on your browser settings, the browser then either saves the file automatically (in the default download directory for this browser) or opens the file in a default application.
Sample Term List File
The following shows the contents of an example term list file:
%%NAME,My Term List %%CAPTION,My Caption %%DESCRIPTION,My Description %%SUBJECTAREA,HoleFoods %%MODDATE,2014-06-06 11:31:10 Atlanta,Braves Boston,Red Sox New York,Yankees
As you can see, the first lines of the export contain items that start with %%; these lines contain descriptive information about the term list.
Importing a Term List
To import a term list:
In the right area, for CSV File to import, select Browse... and navigate to the file.
DeepSee examines the name of the term list as contained in this file. Then:
If the system already has a saved term list with the same name, DeepSee asks if you want to overwrite that term list. If you potentially want to overwrite the term list, select Yes. Otherwise, select Cancel to cancel the import action.
If you select Yes, DeepSee imports the file and displays the new definition of the term list, but does not save the change.
If the system does not yet contain a saved term list with the same name, DeepSee imports the file and displays the new term list, but does not save the new term list.
Optionally save the new or changed term list. To do so, select Save or Save As. If you select Save As, specify a new name and then select OK.
Deleting a Term List
To delete a term list:
Display the term list in the Term List Manager.
Accessing Term Lists Programmatically
You can use the %DeepSee.TermList class to access term lists programmatically. This class provides class methods like the following:
See the InterSystems Class Reference.