Previous | Next | Trail Map | The Basics | Directory Operations

Attribute Names

An attribute consists of an attribute identifier and a set of attribute values. The attribute identifier, or attribute name, as it is also called, is a string that identifies an attribute. Attribute names are used when you want to specify a particular attribute either for retrieval, searches or modification. They are also returned by operations that return attributes (such as when you perform reads or searches in the directory).

When using attribute names, you need to be aware of certain directory server features so that you won't be surprised by the result.

Attribute Type

In directories such as the LDAP, the attribute's name identifies the attribute's type and is often referred to as the attribute type name. For example, the attribute name "cn" is also called the attribute type name. An attribute's type definition specifies the syntax that the attribute's value is to have, whether it can have multiple values, and equality and ordering rules to use when performing comparison and ordering operations on the attribute's values.

Attribute Subclassing

Some directory implementations support attribute subclassing in which the server allows attribute types to be defined in terms of other attribute types. For example, a "name" attribute might be the superclass of all name-related attributes: "commonName" might be a subclass of "name". For directory implementations that support this, asking for the "name" attribute might return the "commonName" attribute.

When accessing directories that support attribute subclassing, you have to be aware that the server might be returning attributes with names different from those you have asked for. To minimize the chance of this, use the most derived subclass.

Attribute Name Synonyms

Some directory implementations support synonyms for attribute names. For example, "cn" might be a synonym for "commonName". Asking for the "cn" attribute might return the "commonName" attribute.

When accessing directories that support synonyms for attribute names, you have to be aware that the server might be returning attributes with names different from those you have asked for. To help prevent this from happening, use the "canonical" attribute name instead of one of its synonyms. The canonical attribute name is one used in the attribute's definition; the synonyms are those that refer to the canonical attribute name in their definitions.

Language Preferences

An extension to the LDAP v3 (RFC 2596) allows you to specify a language code along with an attribute name. This is in some sense similar to attribute subclassing in that one attribute name can mean several different actual attributes. For example, you can have a "description" attribute with two language variations:
description: software
description;lang-en: software products
description;lang-de: Softwareprodukte
Asking for the "description" attribute would then return all three attributes. When accessing directories that support this features, you have to be aware that the server might be returning attributes with names different from those you have asked for.


Previous | Next | Trail Map | The Basics | Directory Operations