Elektra  0.8.18
elektra-key-names(7) -- the names of keys

Every Key object with the same name will receive the very same information from the global key database. The name locates a unique key in the key database. Key names are always absolute; so no parent or other information is needed. That makes a Key self-contained and independent both in memory and storage.

Every key name starts with a namespace, for example user or system. These prefixes spawn key hierarchies each.

The shared system configuration is identical for every user. It contains, for example, information about system daemons, network related preferences and default settings for software. These keys are created when software is installed, and removed when software is purged. Only the administrator can change system configuration.

Examples of valid system key names:

    system
    system/hosts/hostname
    system/sw/apache/httpd/#0/current/num_processes
    system/sw/apps/abc/#0/current/default-setting

user configuration is empty until the user changes some preferences. User configuration affects only a single user. The user's settings can contain information about the user's environment, preferred applications and anything not useful for the rest of the system.

Examples of valid user key names:

    user
    user/env/#1/LD_LIBRARY_PATH
    user/sw/apps/abc/#0/current/default-setting
    user/sw/kde/kicker/#0/current/preferred_applications/#0

The slash (/) separates key names and structures them hierarchically. If two keys start with the same key names, but one key name continues after a slash, this key is below the other and is called a subkey. For example user/sw/apps/abc/current is a subkey of the key user/sw/apps. The key is not directly below but, for example, user/sw/apps/abc is. keyRel() implements a way to decide the relation between two keys.

For computers Elektra would work without any conventions, because it is possible to rename keys with plugins and link and transform any key/value to any other key/value. Obviously, for humans such chaos would be confusing and harder to use, thus we encourage everyone to use the following conventions:

Arrays

If you want to denote an array, i.e. many unnamed subkeys, use the syntax #0, ..., #_10. Then simple string comparisons will yield correct results and the names are still very compact.

Application Base Name

As decided here, the key names of software-applications should always start with: /sw/org/myapp/#0/current/name/full

Further Recommendations

SEE ALSO