| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (2 out of 6)

Overview of Attribute Access

The attribute access facility provides programmatic access to G2 system-defined attributes and the data structures of which they are composed, increasing the level of control that you, as a KB developer, have over item knowledge.

Using the attribute access facility, you can:

Accessing System-Defined Attributes

The attribute access facility provides an extremely powerful, but optional, set of capabilities. Existing KBs can incorporate these capabilities or continue without using them. Some KB developers may use attribute access to control a minimum set of knowledge and attributes, while others use it to control every programmatically-accessible attribute of G2.

The attribute access facility lets you conclude new values into system-defined attributes directly, using standard G2 expressions such as this conclude action:


where the class-of-procedure-invocation refers to a system-defined attribute. You can access most system-defined attributes.

In many cases, accessing system-defined attributes is no different than completing identical tasks on user-defined attributes.

In some cases, however, the internal data structures of system-defined classes consist of multiple embedded sequence and structure values, which require correspondingly complex references to express them. Because of this complexity, we recommend that you experiment gradually with using attribute access.

For example, you can initially use the facility to access and control some key system-defined attributes. Once the grammatical structures for manipulating embedded sequence and structure values become more familiar, you can then extend your use of attribute access to include any number of system-defined attributes that you wish to capture and manipulate.


Note: The permanent/transient status of an item is not currently available through attribute access. Instead, you can obtain this information through the use of the g2-system-predicate system procedure.

Attribute Access Terminology

The attribute access facility introduces several terms:

This term... Refers to...
subattribute
An attribute that is part of another attribute's value. For example, the History-keeping-spec attribute of variables and parameters consists of three subattributes:
subattribute reference
The expression to reference any subattribute of an attribute, which may itself consist of other subattributes, such as:
hidden attributes
Attributes inherent within an item, but which are not visible in its attribute table. Hidden attributes include:
composite attributes
Attributes that appear in an attribute table as one attribute, but which are composed of more than one subattribute.
attribute descriptions
The detailed internal specifications of an attribute. All attribute descriptions appear in the G2 Class Reference Manual.


Note: Do not confuse composite attributes with composite types. Composite attributes are those that consist of more than one subattribute, while composite types are those whose values can consist of any G2 type, such as structures and sequences described next.

Structures and Sequences

Part of using the attribute access facility involves the use and manipulation of structures and sequences. These composite value types, described in detail in Chapter 9, Values and Types, provide a flexible, efficient, and convenient way of providing sets of subattributes and ordered lists.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (2 out of 6)

Copyright © 1997 Gensym Corporation, Inc.