iris-ldap

The COPA Coding System

Optimized Coding for Hierarchical Access to Information

This text has been automatically translated from Spanish. The original Spanish version is the authoritative reference.

Table of Contents

Introduction

COPA (Optimized Coding for Hierarchical Information Access) is a coding system developed by RedIRIS to perform searches at different levels of a hierarchical information structure. Its design addresses two requirements: enabling recursive searches starting from a specified level and preventing these searches from adding significant complexity to existing search systems.

What is a hierarchical structure or inverted tree?

In information organization, a hierarchical structure (or inverted tree) is a model in which data is organized into levels of dependency: a main element or root from which successive branches (categories and subcategories) extend. A classification formalizes this structure to group elements by subject, geography, or organization. Traditionally, this requires data to be physically stored by replicating the same tree structure. COPA allows this position to be represented using a flat alphanumeric code, decoupling the logical hierarchy from the way data is stored.

COPA Code Format

COPA codes are constructed by concatenating groups consisting of a letter followed by one or more digits. Each letter identifies a level in the tree structure, and each number distinguishes a node within the same level. The selected letters identify the levels (they do not establish a strict alphabetical order) and cannot be repeated within the same code (for example, a1a32b123 is invalid because it contains two groups with the letter a).

The following grammar describes its basic syntax:

<code>    ::= <group> | <group><code>
<group>   ::= <letter><digits>
<letter>  ::= "a" | "b" | ... | "z"
<digits>  ::= <digit> | <digit><digits>
<digit>   ::= "0" | "1" | ... | "9"

For example, a2b12c3 consists of three groups (a2, b12, and c3) that successively identify a node at each of the three levels of the hierarchy. This coding scheme makes it possible to create virtual navigation based on flat codes.

Furthermore, the same resource can be associated with different COPA codes to classify it within multiple branches or classifications simultaneously (e.g., thematic, geographical, etc.). You can consult the repository of COPA-based classifications.

What Can I Achieve by Using COPA?

COPA makes it possible to organize and query the same resources using different hierarchical classifications without imposing a rigid physical structure, offering three main advantages:

  • Navigation through virtual hierarchies: It allows a classification to be reconstructed from the codes associated with items, displaying its different levels.
  • Searches across categories and their descendants: It allows users to search for resources directly associated with a category or expand the search scope to automatically include all its subcategories.
  • Multiple search perspectives: It assigns codes from different classifications (thematic, organizational, geographical) to the same resources without duplicating information.

How Does COPA Work?

COPA represents hierarchies using codes that reflect the position of each element. Each new level extends the code of its parent category, making it possible to express dependency relationships without physically reproducing them.

An Example of a Hierarchy

The following example illustrates how a classification can be represented using successive codes:

a2          Health Sciences
a2b1        Pharmacy
a2b1c2      Pharmacology
a2b1c2d9    Psychopharmacology
a2b1c2d9e2  Geriatric Psychopharmacology

Preserving the sequence of levels in the code makes it possible to use prefixes to precisely define the scope of hierarchical searches.

How Is COPA Used to Navigate a Classification?

Navigation Through Virtual Views

Suppose that entries are stored on an LDAP server and created at the same level. We can develop an application that displays them as a hierarchical structure using COPA codes.

To display the areas at the first level, we search for codes beginning with a, excluding subsequent levels by means of advanced directory filters. For example, the corresponding LDAP filter would be:

(&(codigo=a*)(!(codigo=a*b*)))

If the user selects area a2, the application searches for the next level (beginning with a2b and excluding level c):

(&(codigo=a2b*)(!(codigo=a2b*c*)))

How Is COPA Used to Search for Information?

COPA makes it possible to define the scope of a search according to the relevant classification level, combining the text-based criterion with the hierarchical code.

Searching Within a Category and Its Descendants

Suppose we want to find resources related to paracetamol within Pharmacology and all the categories that fall under it (code a2b1c2).

The conceptual query for this operation would be:

cadena=paracetamol AND codigo=a2b1c2*

If your system uses LDAP directories, the equivalent technical filter would be:

(&(cadena=*paracetamol*)(codigo=a2b1c2*))

The asterisk at the end of the code acts as a prefix wildcard, recursively covering the selected category and all its descendants.

Restricting the Search to a Specific Category

If we want to search only for resources associated with a specific category, excluding those belonging to its subcategories (for example, Psychopharmacology, with code a2b1c2d9), we use an exact code match.

The conceptual query would be:

cadena=paracetamol AND codigo=a2b1c2d9

And its equivalent as an LDAP filter would be:

(&(cadena=*paracetamol*)(codigo=a2b1c2d9))

Since no prefix wildcard is used, the search is strictly limited to that exact node.

Combining Searches Across Different Perspectives

A resource can be classified using several COPA attributes simultaneously (thematic, geographical, organizational). For example, we can search for pages mentioning the "Brazilian red spider" within the field of Pharmacology.

The conceptual query would combine free text with the code of the category selected by the user:

"Brazilian red spider" AND codigo=a2b1c2*

The technical LDAP filter would be:

(&(contenido=*Brazilian red spider*)(codigo=a2b1c2*))

Technical note: The LDAP filters shown are illustrative examples. Attribute names and syntax must be adapted to the actual schema and data of each implementation.

COPA vs. a Physical Hierarchy

A hierarchical classification does not necessarily have to match the structure in which the physical data is stored:

Traditional Physical Hierarchy Classification Using COPA
The hierarchy depends rigidly on the structure in which the elements are organized. The hierarchy is represented by alphanumeric codes flexibly associated with the data.
Providing different perspectives requires duplicating structures or implementing complex additional mechanisms. The same resources can be associated simultaneously with different classifications and viewpoints.
Searches across descendant levels depend on the physical implementation of the structure. Codes make it possible to define the hierarchical scope of a query cleanly using prefixes.

COPA Use Cases

COPA can be applied to institutional directories, subject classifications, and the organization of infrastructures or services where hierarchies need to be represented.

See specific examples on the use cases page.

Documentation and Technical Resources

  • COPA LDAP Schema: schema definition for LDAP environments.
  • Technical Documentation: information about how COPA works and how to use it.
  • A collection of COPA Use Cases, showing how this coding system can be applied to specific problems, from information indexing and searching to the organization of spaces, resources, and inventories.
  • A repository of COPA-based classifications, including examples such as CATRE and classifications for universities, networks, and public key infrastructures.
  • siLeDAP — software that supports COPA.