Configuration

Relationships between reference values

In Anjana Data it is possible to configure dependencies between the values of reference attributes (selector-type attributes: SELECT, MULTI_SELECT, TREE_SELECT, etc.) so that the selection of a value in one attribute determines the values available in another.

This mechanism makes it possible to reflect logic specific to the organization's data ecosystem and ensure consistency in the choice of values during the creation or editing of governed objects.

image-20250910-095921.png
Example of relationships between the metadata of the infrastructure-technology-zone triplet

For example, if when creating a DATASET the technology selected is Amazon S3, only compatible values will be available in the zone dropdown (example: Gold).
This way, the system ensures that the infrastructure-technology-zone value combination is always valid and consistent with the reference configuration.

Attribute Relationships Table of the Configuration Panel (Administrator View)

These dependencies are configured in the Attribute Relationships table.

image-20250910-101138.png
Attribute Relationship table for creating relationships between reference values

Structure of the Attribute Relationship table

Each registered relationship is characterized by the following fields:

  • Id: unique identifier of the record. It is automatically assigned from the Configuration Panel.

  • destinationValue: value of the dependent attribute (the one being filtered). It corresponds to a value defined in table Attribute Definition Value, that is, one of the options configured for a reference attribute.

  • sourceValue: value of the source attribute on which the previous one depends. It also corresponds to a value defined in table Attribute Definition Value. It is the value whose selection determines or filters the destinationValue.

In taxonomy-type attributes (TREE_SELECT or TREE_MULTISELECT), the values must be organized in a tree structure. Reference values that act as root nodes (top level of the hierarchical tree) must have the value <null> as sourceValue, which indicates to the platform the start of a branch.

  • objectSubType: object subtype to which the relationship applies. It corresponds to a subtype configured in the Object Sub-types table. If defined as NULL, the relationship will be global and will apply to any template where both attributes are present.

Important:

For relationships to be correctly applied between reference values of different metadata attributes, the dependency validation (DEPENDS_ON) must be configured in the Template Attribute Validations table.

Creating an attribute in the Attribute Relatioship table

Creating a new relationship between attribute values involves adding a new record to the Attribute Relationship table that defines the dependency between a source value (sourceValue) and a destination value (destinationValue).

image-20250910-110758.png
Example of creating the relationship between technology Amazon S3 and zone Gold for object subtype DATASET

To add a new relationship:

  1. Click the New button in the top right corner. This will open a wizard with the fields defined in the Structure of the Attribute Relationship table section.

  2. Fill in the fields according to the structure described:

    • destinationValue: select the dependent value from the list of values defined in the Attribute Definition Value table (e.g.: 2105-Gold-zone).

    • sourceValue: select the source value from the list of values defined in the Attribute Definition Value table (e.g.: 2104-Amazon S3-technology).

    • objectSubType: select the object subtype to which the relationship applies, from those configured in the Object Sub-Types table (e.g.: DATASET).

  3. Click Save to save the relationship or Cancel to discard it.

Note

After creating new relationships, it is necessary to run the Clear cache action from the Configuration Panel (Home > Reset Operations > Clear cache) for the changes to take effect in the Data Portal.

Example of creating a taxonomy-type attribute

The following shows how to configure the hierarchy tree of a taxonomy-type attribute (TREE_SELECT or TREE_MULTISELECT) like the one shown in the following image:

image-20250910-142558.png
Example of a taxonomy-type attribute made up of a hierarchy tree of reference values

Steps to create the hierarchy tree:

  1. Create the attribute in Attribute Definitions and the reference values in Attribute Definition Value

  2. In Attribute Relationship you must:

    1. Indicate that the reference value Clientes is the first level of the tree, to do this:

      1. sourceValue must have the value <null>

      2. destinationValue must reference the value Clientes

      3. destinationValue must reference the object subtype DATASET

    2. Indicate that the reference value Datos demográficos (nombre, edad, género, etc.) hangs from the value Clientes, to do this:

      1. sourceValue must have the value Clientes

      2. destinationValue must reference the value Datos demográficos (nombre, edad, género, etc.)

      3. destinationValue must reference the object subtype DATASET

    3. Indicate that the reference value Historial de compras hangs from the value Clientes, to do this:

      1. sourceValue must have the value Clientes

      2. destinationValue must reference the value Historial de compras

      3. destinationValue must reference the object subtype DATASET

    4. Repeat the previous step for all values that hang from Clientes

Modifying a relationship in the Attribute Relationship table

Modifying an existing relationship must be done with caution, as it can impact the display and consistency of reference values in the Data Portal.

  • If there are no governed objects in the Data Portal:
    The three fields of the relationship can be freely modified:

    • destinationValue (destination value, taken from the Attribute Definition Value table),

    • sourceValue (source value, taken from the Attribute Definition Value table),

    • objectSubType (subtype to which the relationship applies, configured in the Object Sub-Type table).

  • If there are governed objects in the Data Portal:
    Changes can only be made to the extent that they do not affect objects already created.
    In particular:

    • A relationship between a destinationValue and a sourceValue for a specific objectSubType cannot be deleted or modified if objects of that subtype already exist that contain those values in their source and destination attributes simultaneously.

    • In these cases, the only option will be to keep the current relationship, or delete it and redefine it after making a controlled adjustment to the governed objects.

Note

After modifying relationships, it is necessary to run the Clear cache action from the Configuration Panel (Home > Reset Operations > Clear cache) for the changes to take effect in the Data Portal.


Configuring relationships between reference values via direct database access (Developer View)

Relationships between reference values are stored in the anjana.attribute_relationships table. These relationships allow dependencies to be established between the values of two attributes configured in the anjana.attribute_definition_value table, so that the selection of a value in the source attribute filters the values available in the destination attribute.

Column

Type

Constraints / Notes

id_attribute_relationships

int4

PRIMARY KEY. Unique identifier of the relationship. Managed by sequence.

object_sub_type

varchar(255)

Can be NULL. Indicates the object subtype to which the relationship applies. It must correspond to a name defined in the anjana.object_subtype table.

destination_value

int4

Destination value of the relationship. FK to anjana.attribute_definition_value(id_attribute_definition_value).

source_value

int4

Source value of the relationship. FK to anjana.attribute_definition_value(id_attribute_definition_value).

The following example defines a relationship so that, in the DATASET subtype template, the technology value Amazon S3 (sourceValue = 2104) only allows the Gold zone to be selected (destinationValue = 2105):

SQL
INSERT INTO anjana.attribute_relationships
(id_attribute_relationships, object_sub_type, destination_value, source_value)
VALUES(1176, 'DATASET', 2105, 2104);

Important:

  • Once the insert has been executed, run the sequence update for the table. (From the new Configuration Panel under Home > Reset Operations > Reset database sequences, the sequences of all tables, including this one, can be updated).

  • The entire responsibility of the configuration logic falls on the developer who executes the SQL queries directly against the tables. It is recommended to carefully review the Structure section.