In Anjana Data it is possible to configure dependencies between reference attribute values (selector-type attributes: SELECT, MULTI_SELECT, TREE_SELECT, etc.) so that selecting a value in one attribute determines the available values in another.
This mechanism allows reflecting the organization's own data ecosystem logic and ensures consistency in value selection during the creation or editing of governed objects.
For example, if Amazon S3 is selected as the technology when creating a DATASET, only compatible values will be available in the zone dropdown (example: Gold).
In this way, the system ensures that the infrastructure–technology–zone value combination is always valid and consistent with the reference configuration.
Attribute Relationships Table in the Configuration Panel (Administrator view)
These dependencies are configured in the Attribute Relationships table.
Structure of the Attribute Relationship table
Each registered relationship is characterized by the following fields:
-
Id: unique identifier of the record. Automatically assigned from the Configuration Panel. -
destinationValue: value of the dependent attribute (the one that is filtered). Corresponds to a value defined in theAttribute Definition Valuetable, i.e., one of the configured options for a reference attribute. -
sourceValue: value of the source attribute on which the previous one depends. Also corresponds to a value defined in theAttribute Definition Valuetable. It is the value whose selection determines or filters thedestinationValue.
For taxonomy-type attributes (TREE_SELECT or TREE_MULTISELECT), values must be organized as a tree. Reference values that act as root nodes (top level of the hierarchical tree) must have <null> as their sourceValue, which tells the platform the beginning of a branch.
-
objectSubType: object subtype in which the relationship applies. Corresponds to a subtype configured in theObject Sub-typestable. If defined asNULL, the relationship will be global and will apply in 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.
Adding an attribute in the Attribute Relationship table
Adding 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).
To add a new relationship:
-
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.
-
Fill in the fields according to the structure described:
-
destinationValue: select the dependent value from the list of values defined in theAttribute Definition Valuetable (e.g., 2105-Gold-zone). -
sourceValue: select the source value from the list of values defined in theAttribute Definition Valuetable (e.g., 2104-Amazon S3-technology). -
objectSubType: select the object subtype in which the relationship applies, from those configured in theObject Sub-Typestable (e.g., DATASET).
-
-
Click Save to save the relationship or Cancel to discard it.
Note
After adding new relationships, it is necessary to run the Clear cache action from the Configuration Panel (Actions > Clear cache) for the changes to be applied and become visible in the Data Portal.
Example of adding a taxonomy-type attribute
The following shows how to configure the hierarchy tree of a taxonomy-type attribute (TREE_SELECT or TREE_MULTISELECT) such as the one shown in the image below:
Steps to set up the hierarchy tree:
-
Register the attribute in
Attribute Definitionsand the reference values inAttribute Definition Value -
In
Attribute Relationshipyou must:-
Indicate that the reference value Customers is the first level of the tree, to do this:
-
sourceValuemust have the value<null> -
destinationValuemust reference the value Customers -
destinationValuemust reference the object subtype DATASET
-
-
Indicate that the reference value Demographic data (name, age, gender, etc.) is a child of the value Customers, to do this:
-
sourceValuemust have the value Customers -
destinationValuemust reference the value Demographic data (name, age, gender, etc.) -
destinationValuemust reference the object subtype DATASET
-
-
Indicate that the reference value Purchase history is a child of the value Customers, to do this:
-
sourceValuemust have the value Customers -
destinationValuemust reference the value Purchase history -
destinationValuemust reference the object subtype DATASET
-
-
Repeat the previous section for all values that are children of Customers
-
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 no governed objects exist in the Data Portal:
All three fields of the relationship can be freely modified:-
destinationValue(destination value, taken from theAttribute Definition Valuetable), -
sourceValue(source value, taken from theAttribute Definition Valuetable), -
objectSubType(subtype to which the relationship applies, configured in theObject Sub-Typetable).
-
-
If governed objects exist in the Data Portal:
Changes can only be made to the extent that they do not affect already created objects.
In particular:-
A relationship between a
destinationValueand asourceValuefor a specificobjectSubTypecannot be deleted or modified if objects of that subtype already exist that simultaneously contain those values in their source and destination attributes. -
In these cases, the only option will be to maintain the existing relationship or delete it and redefine it after performing a controlled adjustment on the governed objects.
-
Note
After modifying relationships, it is necessary to run the Clear cache action from the Configuration Panel (Actions > Clear cache) for the changes to be applied and become visible 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 establishing dependencies between the values of two attributes configured in the anjana.attribute_definition_value table, so that selecting a value in the source attribute filters the available values 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. Must correspond to a |
|
destination_value |
int4 |
Destination value of the relationship. FK to |
|
source_value |
int4 |
Source value of the relationship. FK to |
The following example defines a relationship so that, in the DATASET subtype template, the technology value Amazon S3 (sourceValue = 2104) only allows selecting the zone Gold (destinationValue = 2105):
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 Configuration Panel at
Actions > Reset DQ sequencesyou can update the sequences for all tables, including this one). -
The entire responsibility for the configuration logic falls on the developer executing SQL queries directly against the tables. It is strongly recommended to carefully review the Structure section.