Skip to main content

Pentaho+ documentation has moved!

The new product documentation portal is here. Check it out now at docs.hitachivantara.com

 

Hitachi Vantara Lumada and Pentaho Documentation

Managing rules

Parent article

Organizations need to understand the quality of their data to understand its fit for use. They also need to manage their metadata at scale without requiring significant human effort, especially for repeated tasks. With Data Catalog's rules framework, you can define, execute, and manage business rules. These rules can evaluate data and metadata properties to add terms, remove terms, modify custom property values, evaluate data quality metrics, and perform several other actions.

Rule components

Data and metadata rules execute based on the defined rule scope, criteria, and action on all qualified data entities.

You must use the Data Catalog rule components, which provide constructs for expressing scope, criteria, and actions. You can define all these constructions based on actual business terms, field names, custom properties, and business term association states.

The rule components are:

  • Rule scope

    Sets the scope of resources on which the rule is evaluated and applied.

  • Rule criteria

    Defines the condition.

  • Rule action

    Defines the action to take on resources that conform to the rule's evaluation, such as add term, remove term, set custom property values, set quality dimension, set term assignment state, compute data quality score, and set sensitivity.

NoteData Catalog always refers to terms using their fully qualified name in the following form: <Glossary Name>/<Parent Term>.<Child Term>.<Grandchild Term>.The parent term should be separated by the child term using a dot (.). For example, @Insurance/HomeOwners.State_VA, here HomeOwners is a parent term, and State_VA is a child term.

Rules creation

To create rules, click Management on the menu bar to open the Manage Your Environment page, and then click Business Rules.

On the Business Rules page, you can create, run, track, and manage all rules in Data Catalog.

You can create business rules in two ways:

  • Create a new rule by entering the scope, action, and criteria for the rule in the Add New Rule page and save it.
  • Create a new rule by creating blocks for scope, action, and criteria. You can use these blocks any time later while creating a new rule using the Load option on the Add New Rule page. This is the recommended way that is optimized for re-usability.

When you create rules, they are translated automatically into concrete rules that are bound and executed on individual data resources. This translation occurs regardless of which format and platform the resource is in, such as JDBC tables, Hive tables, CSV, Avro, JSON, or any other file format that Data Catalog supports.

NoteData Catalog data types differ from the original data types used in databases and file systems. For example, the int data type can be represented as Integer in a Data Catalog data type. You can view data types by clicking the Details tab when you are viewing a resource in the Data Canvas.

You can view the following sample applications of the rules framework:

Rule scope

The rule scope defines the resources for rule execution. When configuring a rule, you can define the rule scope by specifying scope types in the Set Scope section.

  • Virtual folders

    You must include at least one virtual folder. When a single virtual folder is listed, the rule runs against all the resources in the listed virtual folder. You can select multiple virtual folders from the navigation tree.

  • Resource terms

    You can select multiple terms from multiple glossaries in the navigation tree. Selecting resource terms narrows the scope to include only the resources (files and tables) that have the selected resource-level terms.

  • Field terms

    You can select multiple terms from multiple glossaries in the navigation tree. Selecting field terms narrows the scope to include only the resources (files and tables) that contain columns and fields associated with the selected terms.

  • Custom properties

    You can select custom properties from custom property groups in the navigation tree. Selecting custom properties narrows the scope to include only the resources (files and tables) that have the selected resource custom properties.

  • Term states

    You can further filter the resources based on the term association state if you have selected Resource terms or Field terms while defining the rule scope. The possible values are ACCEPTED, SUGGESTED, and REJECTED. If you do not specify a term association state, then all states will be considered.

Rule criteria

The rule criteria define the rule that is translated and evaluated into a query for execution against every qualifying resource as defined in the rule scope. You can define the rule criteria by specifying the criteria block and later loading it into a rule or manually entering it while creating a new rule.

For example, you can insert a clause that determines what the rule body acts on. The query clause determines if the rule acts on metadata or actual resource data.

ImportantData Catalog uses the JDK regular expression (regex) engine to process regular expressions. When you are editing business rules, make sure your regular expressions conform to JDK regex syntax so Data Catalog can process them accurately.

Rule criteria on resource data

The rule criteria on resource data operates on field terms in combination with field values. For example, the rule criteria (@EMS/Category >= 100 and @EMS/Category <= 199) and @EMS/Tax_State = '6A' inspects the data in the field tagged with EMS/Category for values between 100 and 199, when the data in the field tagged with EMS/Tax_State has a value of "6A".

It can also operate on field values using field names. The rule on resource data can directly act on the real values of the field and column. For example, a rule criteria like Country = ‘USA’ is inspecting the data in a field named Country for a value of USA.

Rule criteria defined on resource data inspects the data of the file when evaluating the rules, and identifies the associated fields and checks the data of those fields.

Depending on the rule type, you can use the rule criteria queries shown in the table, where the field term is a fully qualified term name including the domain that it is associated with:

NotePrefixing a fully qualified field term with an "@" indicates the rule operates on the data tagged by the term.

Example of a fully qualified term name: If the user has Glossary as HomeInsurance and Term as State-NJ, then the fully qualified name of the Term is: HomeInsurance/State-NJ

Rule criteria must be written using a specific syntax to execute as desired. For syntax requirements, see Rule criteria requirements and syntax.

Rule criteriaDescription
Country IN('USA', 'Australia', 'Japan') AND 'Insurance Type'= 'Auto'Evaluating data in fields using field name.
@Domain1/Term1 = "someValue" ruleCriteria:@Domain1/fieldTerm1 >= 100 and @Domain1/fieldTerm1 <= 199) and @Domain1/fieldTerm2 = “some_value”Evaluating data in fields using field terms.
length(Username) > 10 ORlength(@Domain1/Term1)> 10Evaluating the length of field values by querying for both field name and field term.
UserIDisuniqueEvaluating the uniqueness of a field using field name.
Usercontainsall(‘John’, ‘Matt’, ‘Winston’)Evaluating all the given values in the mentioned field name.
@Domain1/ParentTerm1.childTerm >=100 and @`Domain name1/field Term2` = “value”Evaluating data in fields with nested terms and terms with spaces using field terms.

Rule criteria on resource metadata

Rule criteria defined on resource metadata evaluates against metadata discovered by Data Catalog. For example, the rule criteria hasFieldTerm(Built-in_Terms/Social_Security_Number_Delimited) = 1 checks for the presence of the field term Built-in_Terms/Social_Security_Number_Delimited.

For a custom property, include "@@" in the rule criteria. For example, the rule criteria @@business= 'MagnUX' operates on custom properties looking for the value of 'MagnUX'. The inclusion of "@@" indicates the rule is used for custom properties and is a metadata rule.

Depending on the rule type, you can use the following rule criteria queries:

NoteYou must write rule criteria using a specific syntax for the rule to execute as desired. For syntax requirements, see Rule criteria requirements and syntax.
LogicRule criteriaParametersApplicable to

Metadata rules

MatchMetadataNamehasMetadataName(LDC Data Type, Name/Regex)=1

Example: hasMetadataName(boolean, IsRatingFinished)=1

Regex example:hasMetadataName(boolean,`.*RatingFini.*`)=1

  • Type

    DataSource/ VirtualFolder/ ResourcePath/ ResourceName/ FieldPath/ FieldName

  • Name/Regex

    Regular expression to match name or entire name

Rule /Term discovery

(In Rule execution datasource, virtualFolder is not applicable)

MatchFieldNamehasFieldName(Name/regex)=1

Example: hasFieldName(CreditCard)=1

Regex example:hasFieldName(`CreditCa.*`)=1

  • Name/Regex:

    regular expression to match name or entire name

Rule /Term discovery
MatchFieldTypehasFieldType(LDC DataType,Name/Regex)=1

Example:hasFieldType (LDC data type, CreditCardNumber)=1

Regex example: hasFieldType (long, `CreditCa.*`)=1

  • DataType:

    dataType of the field

  • Name/Regex:

    regular expression to match name or entire name

NoteIf second option is not provided, it checks if any field in the column has that data type.

Rule /Term discovery

matchFieldAssociationProximityhasTermProximity(fully qualified term name1, fully qualified term name2) >=2

Example: hasTermProximity(Built-in_Terms/First_Name, Built-in_Terms/Last_Name) <=2

Fully qualified Term name1

Fully qualified Term name2

Rule
matchFieldProximityhasFieldProximity(field1,field2)= Proximity Value(distance between two fields)

Example:

hasFieldProximi(Firstname, Lastname)<=2
  • field1:

    field1 Name/fieldPath

  • field2:

    field2 Name/fieldPath

  • Proximity:

    distance between two fields

Rule /Term discovery

matchOrdinalhasOrdinal(fieldname,ordinal)=1

Example: The field FirstName appears as the 3rd column in LDC Data Canvas UI, then the ordinal should be given as 2 because LDC follows Java Conventions.

hasOrdinal (Firstname,2)=1
  • fieldName:

    field name/ field Path

  • ordinal:

    position number

Rule /Term discovery
hasFieldTermhasFieldTerm(fully qualified termName)=1

Example: hasFieldTerm (Built-in_Terms/Country)=1

  • termName:

    1 fully qualified name of the term

Rule/Business Entity
hasAcceptedFieldTermhasAcceptedFieldTerm(termName)=1

Example:hasAcceptedFiel dTerm(Built-in_Terms/Country)=1

  • termName:

    fully qualified name of the term

Rule
hasResourceTermhasResourceTerm(termName)=1

Example: hasResourceTerm(Builtin_Terms/Country)= 1

  • termName:

    fully qualified name of the term

Rule/Business Entity
matchTermFieldProximityhasFieldTermProximity(fieldname)=1
  • fieldname:

    fully qualified name of the term

  • termName:

    fully qualified name of the term

Rule /Business Entity
metadataSelectivityhasStatistic(statistic name,Fieldname/regex)=1

Example: hasStatistic(Selelctivity,Country)>=28

Regex example: hasStatistic(Selelctivity,`.*ountr.*`) >3

  • name:

    can be one of the values: (selectivity/ cardinality/ stringMin/ StringMax/ NumericMin/ NumericMax

  • Fieldname/regex:

    regular expression to match name or entire name

Rule /Term discovery
metadataCardinalityhasStatistic(name,Fieldname/regex)=1

Example: hasStatistic(Cardinality,Country)<=10

Regex example: hasStatistic(Cardinality,`.*ountr.*`) >= 3

  • name:

    can be one of the values: selectivity/ cardinality/ stringMin/ StringMax/ NumericMin/ NumericMax

  • Fieldname/regex:

    regular expression to match name or entire name

Rule /Term discovery
metadataStringMin hasStatistic(na me,Fieldname/ regex)=1

Example: hasStatistic(stringMin,Sport)>=3

Regex example:

hasStatistic(stringMin,`.*Port`)>=3
  • name:

    can be one of the values: selectivity/ cardinality/ stringMin/ StringMax/ NumericMin/ NumericMax

  • Fieldname/regex:

    regular expression to match name or entire name

Term discovery
metadataStringMax hasStatistic(name,Fieldname/ regex)=1

Example: hasStatistic(stringMax,Sport)>=3

Regex example:hasStatistic(stringMax,`.*Port`)>=3

  • name:

    can be one of the values: selectivity/ cardinality/ stringMin/ StringMax/ NumericMin/ NumericMax

  • Fieldname/regex:

    regular expression to match name or entire name

Term discovery
metadataNumericMin hasStatistic(na me,Fieldname/ regex)=1

Example: hasStatistic(numericmin,Sport)>=3

Regex example:hasStatistic(numericmin,`.*Port`)>=3

  • name:

    can be one of the values: selectivity/ cardinality/ stringMin/ StringMax/ NumericMin/ NumericMax

  • Fieldname/regex:

    regular expression to match name or entire name

Rule /Term discovery
metadataNumericMax hasStatistic(na me,Fieldname/ regex)=1

Example: hasStatistic(numericmax,Sport)>=3

Regex example: hasStatistic(numericmax,`.*Port`)>=3

  • name:

    can be one of the values: selectivity/ cardinality/stringMin/ StringMax/ NumericMin/ NumericMax

  • Fieldname/regex:

    regular expression to match name or entire name

Rule /Term discovery
lastProfiledTimeStamp hasLastProfiledTimestamp (``) >= 1 timestampvalue in "dd-mm-yyyy hh:mm:ss" format.

Example: hasLastProfiledTimestamp(``) > "10-01-2022 02:22:45"

  • timestamp:

    value in timestamp

Rule /Term discovery
Unstructured
ContainsTermhasFieldTerm(termName)=1

Example: containsTerm(Built-in_Terms/Country)=1

If any resource within a virtual folder has the term Country associated with it, then this implies that the condition is satisfied.

  • termName:

    fully qualified name of the term

Rule
DocumentType (Jpeg, video, etc.)hasDocumentType(Type)=1

Example: hasDocumentType(jpeg) = 1

If the unstructured document type is “jpeg", this condition will return true.

  • Type:

    type of the document

Rule
Data quality
Field’s Quality ScorehasFieldQuality(FieldName/Regex)=1

Example: hasFieldQuality(`.*country.*`) >=30

If the resource has a field “Country”, and the field has Data Quality Statistics, which is 30. In such a scenario, this condition will return true.

  • Fieldname/regex:

    regular expression to match name or entire name

Rule
Resource’s Quality ScorehasResourceQuality()=1

hasResourceQuality(``) >=30

If any resources have a Data Quality Score of 30, then this method will return true.

No parameterRule
Term metadata rules
termConfidence valueshasTermConfidence(field/Regex)=1

In a resource, if any field has the name “Country”, and the field has the term -Built-in_Terms/Country associated with it, and if the Term confidence percentage is greater than 80, then this condition will return true.

  • Fieldname/regex:

    regular expression to match name or entire name

Rule

Rule criteria requirements and syntax

You must write rule criteria using a specific syntax for the rule to execute as desired. There are general syntax requirements that you must use regardless of whether the rule is a metadata or a data rule. There are also syntax requirements specific to metadata and those specific to data rules.

Requirements for writing rule criteria for a metadata and data rule

You can avoid errors by adopting the following requirements when writing data and metadata rules:

Rule criteria elementsSyntax requirements
Business terms using the syntaxSurround the entire fully qualified glossary and business term with backticks. For example,

`glossary_name/business_term.child_business_term`

If your term does not have a child term, do not include it. For example,

`Marketing/Campaign_ID`

`Data Quality Flags/Data Quality Issue`

`Products/Parts.Part_Number`

Fields using the syntaxSurround the entire field name with backticks. For example,

`first_name`

`First Name`

Regular expressionsSurround regular expressions with backticks. For example, hasOrdinal(`.*oUntry`,1)=1 Regular expressions are case insensitive. For example, the following rule criteria uses a regular expression to match a field name. It matches both `Country` and `cOunTry`: hasFieldName(`.*OUntry`)=1
SQL functionsData Catalog supports minimal SQL functions in rule criteria, such as AND, OR, <, >, IN, and length ().
Data Catalog's rules framework does not create new terms. It only attaches an existing term to the resource or field specified.
Requirements for writing rule criteria for a data rule
You can avoid errors by adopting the following requirements when writing data rules:
Rule criteria elementsSyntax requirements
Business terms

Prefix a fully qualified field term with an "@" to indicate the rule operates on data tagged by the glossary and term @`glossary_name/parent_term_name.child_term_name`.

For example, @`Clinical Code/LONIC CODE` = “5792-7”
Custom propertyPrefix a custom property name with “@@” to indicate the rule criteria is used for custom properties and is a metadata rule @@property_name. For example, @@retention_date < “10-01-2022 12:00:00”

Rule action

A rule action has an array of actions, and each action performs a task. Actions can be one of the following:

ImportantRule actions execute in the following order regardless of the order they are created in the user interface.
  • Set Properties
  • Reset Properties
  • Add Business Terms
  • Remove Business Terms
  • Set Term Assignment State
  • Set Sensitivity
  • Set Quality Dimension
  • Compute Data Quality Score

You can define the rule action by specifying action types in the Rule Actions window. The supported rule action types are described below.

  • Set Properties and Reset Properties

    When actionType is set to SetProperties or ResetProperties, the ruleAction sets or resets custom property values.

    Property values are strings. If you specify property names with @@, then the value of its string is substituted for the property name. You can specify multiple property values in the Add Property Value section. Each property value should be comma (,) separated and without any trailing space.

    You can use property actions to set and reset property values. To reset a property value, use ResetProperties.

  • Add Business Terms

    When actionType is set to AddBusinessTerm, the ruleAction makes term associations based on rule evaluation. You can apply a term suggestion on a specific field or on a qualifying resource. When applying a term suggestion of a field, the field is identified with a full field name. You can add multiple terms in AddBusinessTerms rules.

    NoteThe Data Catalog rule framework does not create new terms. Any term suggestions to be applied as part of a rule action must be for existing terms. If an associated term does not exist, Data Catalog displays an error message.
  • Remove Business Terms

    When actionType is set to RemoveBusinessTerm, the ruleAction removes the term associations based on the rule evaluation.

  • Set Term Assignment State

    When actionType is set to SetTermAssignmentState, the ruleAction updates the business term assignment state. You can specify one or multiple terms whose assignment state is to be changed. If you do not select a term, then the selected assignment state is applied to all the terms associated with the resource.

    The supported business term assignment states are:

    • Accept & Use In Learning
    • Accept & Don’t Use In Learning
    • Reject & Use In Learning
    • Reject & Don’t Use In Learning

    Use In Learning is only applicable at the column level. At the resource level, it can only be Accept or Reject.

    NoteThis action requires metadata criteria in the rule to execute.
  • SetSensitivity

    When actionType is set to SetSensitivity, the ruleAction updates the resource sensitivity level. This is applicable only at the resource level. If you do not provide the resource name, then the action changes the sensitivity level of all the resources defined in the rule scope and criteria.

    If multiple sensitivity rules are executed for a particular resource, then the sensitivity level defined in the latest rule is considered, overriding all the previous rules.

    The supported business term assignment states are:

    • Low
    • Medium
    • High
    • Non Sensitive
    • Unknown
    NoteThis action requires metadata criteria in the rule to execute.
  • Set Quality Dimension

    When actionType is set to SetQualityDimension, the ruleAction defines the quality dimension. You can specify the following quality dimensions with a threshold value range (Low Threshold and High Threshold).

    The supported quality dimensions are:

    • Accuracy
    • Completeness
    • Consistency
    • Timeliness
    • Uniqueness
    • Validity

    Specify the field name if the associated action is to be performed at the field level. If you do not specify the field name, then the action is performed at the resource level.

    NoteThis action requires non-metadata criteria to execute because it evaluates the actual data of the column.
  • Compute Data Quality Score

    When actionType is set to ComputeDataQualityScore, the ruleAction computes the data quality score based on the provided data quality dimension values.

    When you select the Compute Data Quality Score as the rule action type, the template for the score formula is provided in the Score Formula field. You can customize the template formula by changing the dimension weightage values.

    Score formula template:

    GUID-731861F6-883D-4A08-B353-67682F199AE7-low.jpg

    Data quality score formula conditions:

    • The column-level entity should have at least one calculated dimension for the action to execute.
    • If the rule provides weightages to multiple dimensions, and the actual entity has only one dimension, then 0 is considered the value for the other dimensions.
    • The formula should have at least one dimension and all the weights provided should total 1.0.

      The following example shows a valid formula with weights specified for Accuracy, Completeness and Uniqueness quality dimensions:

      GUID-B4CF36D0-E1DD-4F77-8AB6-8A6B3AD7E269-low.jpg

    Data quality score calculation process:

    Data quality score is calculated based on the Quality Dimension Weightage specified in the formula and Calculated Value Set defined for the quality dimension.

    Data quality score calculation process is stated below with an example:

    Data quality score formula:

    • Accuracy*0.5 + Completeness*0.20 + Uniqueness*0.30

    Calculated value set:

    • Accuracy: 60
    • Completeness: 80
    • Uniqueness: No calculated value is set for Uniqueness. The default value for Uniqueness will be 0.

    Data quality score calculation:

    • [60*0.5 + 80*0.2 + 0*0.3] = 46
    NoteThis action requires a metadata criteria in the rule to execute.

Using a rule for sensitive resource tagging

Many users create business rules to govern sensitive data. The following example identifies and tags all resources containing sensitive data or personal identifiers such as names and addresses. You can modify it to work with other sensitive data like social security numbers and account information.

Using the Data Catalog term discovery features, you can identify field metadata and tag data fields such as first name, last name, and address. The Data Catalog built-in terms can identify these fields. Then, you can use a rule to check for any resources that contain tagged sensitive data fields and tag the resources as "PII/Restricted Access".

The following rule example is term-based and does not depend on an actual field name, resource name, or resource type.

When you run the rule, it is applied to all qualifying resources and attaches the term you specify when a resource contains the sensitive fields and these fields have terms associated with them. If you have 100 CSV files, 200 JDBC tables, and 30 Avro files that are all sensitive, they are all labeled correctly after executing this rule.

Metadata rule with field term for sensitive data
Rule componentDefinition
Rule ScopeYou can define the following rule scope by clicking and selecting parameters using the scope building block.
  • Virtual folders
  • Resource terms
  • Field terms
  • Custom Properties
  • Term states
Rule Criteria hasFieldTerm(Built-in_Terms/First_Name)=1 AND hasFieldTerm(Built-in_Terms/Last_Name)=1 AND hasFieldTerm(Built-in_Terms/US_Address)=1
Rule ActionYou can tag associations, remove associations, set properties, reset properties, set term assignment state, compute data quality score, and set sensitivity level by selecting the action using the Rule Action block.

For example, to tag SSN field as PII/Restricted Access:

Select Action Type as: Add Business Terms

Select Business Terms as: PII/Restricted Access

Set Action Field as: SSN (this field is case-sensitive)

Set the threshold as needed.

Resource tagging based on data properties

You can use Data Catalog rules to create a simple data rule that defines the resources to which the condition applies, a condition, and then performs a specified action. In the following example, the rule attaches a resource term to all resources where the data for a given field falls within a specified condition and threshold range.

Data rule with resource term
Rule componentDefinition
Rule Scope

You can define the following rule scope by simply clicking and selecting parameters using the scope building block.

  • Virtual folders
  • Resource terms
  • Field terms
  • Custom Properties
  • Term states
Rule Criteria (rule body)

Country='Australia’

Here Country is the column name, and 'Australia' is the value inside the column.

Use single quotation marks to specify the value.

Rule criteria for data rules always examine the actual data of the given column.

Rule Action

You can tag or remove associations, set or reset properties, set data quality by selecting it using the action building block.

In this example, we will do the following:

Tag resource as DQM/CA_Employee:

Select Action Type as:Add Business Term

Select Business Term as: PII/Restricted Access

Keep Action Field empty

Set the threshold as needed.

Rule workflow

On the Business Rules page, you can create, update, edit, and delete rules.

Create a rule

Perform the following steps to create a new rule. After you create a rule, you can then run the rule using Execute rules.

Procedure

  1. Click Management on the menu bar to open the Manage Your Environment page, and then select Business Rules to open the Business Rules page. Click Add Business Rule.

    The Create Business Rule page opens.
  2. Enter the rule name and description.

  3. Set the Rule Scope. The rule scope includes the following parameters:

    You can create your own scope and save it for future use by yourself or another user or select one of the existing ones using the Load Scope option.

    You can use the Rule Scope JSON box to view the rule scope as you create it or the rule scope that you have selected using the Load Scope option. This helps you visualize the defined rule scope parameters and make the necessary changes. You can also copy the rule scope in the JSON format and use it for REST API requests.

    • Virtual Folders

      Select virtual folders on which the rule should be executed. You must include at least one virtual folder for the rule to compile. When a single virtual folder is listed, rule execution is run against all the resources in the listed virtual folder. You can select additional virtual folders. If a folder no longer exists when the rule is executed, it is ignored.

    • Resource Terms

      Select business terms to filter the virtual folder resources.

    • Field Terms

      Select the business terms associated with the fields or columns to filter the virtual folder resources.

    • Custom Properties

      Select the custom properties to filter the virtual folder resources.

    • Term States

      You can further filter the virtual folder resources based on the term association state. The possible values are ACCEPTED, REJECTED, and SUGGESTED. If you do not specify a term association state, all states are included.

  4. Set the Rule Criteria.

    You can create your rule criteriaand save it for future use by yourself or another user or select one of the existing ones using the Load Scope option.

    Define the rule's criteria for evaluation using rule syntax, with MetadataRule or DataRule. See the following examples:

    • MetadataRule

      For dealing with metadata stored in the database. Syntax is:

      • hasResourceTerm(TermFullyQualifiedName) =1

        Work on the resources that have the given resource term associated with them. For example, hasResourceTerm(Insurance/HomeOwners.State_VA)=1

      • hasFieldTerm(TermFullyQualifiedName) =1

        Work on the fields and columns that have the given field term associated with them. For example, hasFieldTerm(Insurance/HomeOwners.State_VA)=1

    • DataRules

      For dealing with actual data present in the resource. Syntax is to specify the column name directly or use @TermFullyQualifiedName equivalent to the field with the given term name. Use @@customPropertyName to specify the custom property with specific values.

    NoteAll Quality Dimensions are generated only with DataRules.
  5. Set the Rule Actions. The rule actions include the following action types.

    You can create rule actions and save them for future use by yourself or another user or select one of the existing ones using the Load Scope option.

    You can use the Rule Actions JSON box to view the rule actions as you create them or the rule actions that you have selected using the Load Action option. This helps you visualize the defined rule actions and make the necessary changes. You can also copy the rule actions in the JSON format and use it for REST API requests.

    Action TypeDescription
    Add Business Terms
    • Business Term

      Select the term name that you want to add.

    • Action Field

      Specify the field name if the associated action should be performed on a specific field. The field name specified is tagged with the term provided in the Add Business Terms.

      If the field name is not specified, then the action will be performed at the resource level.

    • Set Threshold

      Specify the threshold value at which to perform the rule action.

    Remove Business Terms
    • Business Term

      Select the term name that you want to remove.

    • Action Field

      Specify the field name if the associated action should be performed at the column level. The field name specified is tagged with the term provided in the Remove Business Terms.

      If the field name is not specified, then the action will be performed at the resource level.

    • Set Threshold

      Specify the threshold value at which to perform the rule action.

    Set Properties
    • Select Property

      Select the property for which you want to set the custom properties.

    • Action Field

      Specify the field name if the associated action should be performed on a field.

    • Add Property Value

      Specify the property value. You can specify multiple property values. Each property value should be a comma (,) separated and no trailing space.

    • Set Threshold

      Specify the threshold value at which to perform the rule action.

    Reset Properties
    • Select Property

      Select the property for which you want to reset the custom properties.

    • Action Field

      Specify the field name if the associated action should be performed on a field.

    • Set Threshold

      Specify the threshold value at which to perform the rule action.

    Set Quality Dimension
    • Set Quality Dimension (for DataRules)

      Select the data quality dimension that defines your rule. This dimension is reflected in the data quality graph on the Data Canvas page. Options include:

      • Accuracy

        The degree to which data correctly describes the "real world" object or event being described.

      • Completeness

        The proportion of stored data against the business definition of “100% complete”.

      • Consistency

        The absence of difference when comparing two or more representations of an item against a definition. Each data item is measured against itself or its counterpart in another data set.

        Note that consistency assessment may not be applicable to all data items.

      • Timeliness

        The degree to which data represent reality from the required point in time. This is measured by the time distance between each correct and incorrect data point.

      • Uniqueness

        The inverse of an assessment of the level of duplication.

      • Validity

        Data is valid if it conforms to the syntax (format, type, range) of its business definition. Typically, this value is the overall measure of data quality.

    • Action Field

      Specify the field name if the associated action should be performed at the column level. The field name specified is tagged with the term provided in the Set Quality Dimension.

      If the field name is not specified, then the action will be performed at the resource level

    • Set Low Threshold

      Specify the threshold value at which to perform the rule action.

    • Set High Threshold

      Specify the threshold value at which to perform the rule action.

    You can view the following data quality color range in a donut chart for the column.

    • > High Threshold = green
    • > Low Threshold and < High Threshold = orange
    • < Low Threshold = red

    For example, If you want to validate the number of records with the state name California.

    To validate this, you have selected Validity as a quality dimension. Suppose there are a total of 500 records for states; out of these, you want to see records with the state name California.

    Now, consider that out of 500, we have 50 states with the name California. This is 10% as a validity percentage.

    Now in the threshold field, if you set the low threshold as 0 (zero) and the high threshold as 9. In this case, 10 is greater than the high threshold, so the data quality chart will show green.

    If you set a low threshold as 0 (zero) and a high threshold as 15. In this case, 10 falls between 0 and 15, so the data quality chart will show orange.

    If you set the low threshold as 11 and the high threshold as 15. In this case, 10 falls below the low threshold, so the data quality chart will show red.

    Similarly, you can set the threshold value for all the data quality dimensions.

    SetTermAssignmentState
    • Set Term Assignment State (for MetaData Rules)

      Set the assignment state of a term.

    • Select Term

      Select one or multiple terms for which you want to change the assignment state. If the term is not specified, the selected assignment state is applied to all the terms associated with the resource.

    • Assignment State

      Select the assignment state. The supported term assignment states are:

      • Accept & Use In Learning
      • Accept & Don’t Use In Learning
      • Reject & Use In Learning
      • Reject & Don’t Use In Learning
      NoteUse In Learning is applicable at the column level only. At resource level, it is Accept and Reject only.
    ComputeDataQualityScore
    • Compute Data Quality Score

      Computes the data quality score based on the provided data quality dimension values.

    • Score Formula

      When you select the Compute Data Quality Score as the rule action type, the template for the score formula is provided in the Score Formula field. You can customize the template formula by changing the dimension weightage values as per the requirement.

      Score formula template:

      Accuracy*0.17 + Completeness*0.17 + Consistency*0.16 + Timeliness*0.16 + Uniqueness*0.17 + Validity*0.17

      Data quality formula condition:

      • The column level entity should have at least one calculated dimension for this action to execute..
      • If the rule provides weightages to multiple dimensions, and actual entity has only one dimension, then 0 will be considered as the weightage value for the other dimensions.
      • While defining the formula, there should be at least one valid dimension, and the sum of all dimension weightages should equal to 1. Greater than 1 or less than 1 is not acceptable.

        Example of a valid formula:

        Accuracy*0.5 + Completeness*0.20 + Uniqueness*0.30

    • Action Field

      Specify the column name if the associated action should be performed only on a specific column, instead of applying the weights on all the columns of the applicable resource.

      Examples of a valid formula used in the Action Block:

      Accuracy*0.5 + Completeness*0.20 + Uniqueness*0.30

      Accuracy*0.2 + Completeness*0.1 + Consistency*0.1 + Timeliness*0.1 + Uniqueness*0.4 + Validity*0.1

    SetSensitivity
    • Set Sensitivity

      Updates the resource sensitivity level. If multiple Sensitivity rules are executed for a particular resource, then the sensitivity level defined in the latest rule is considered, overriding all the previous rules.

    • Sensitivity Level

      Specify the sensitivity level. The supported sensitivity levels are:

      • Low
      • Medium
      • High
      • Non Sensitive
      • Unknown
    • Action Item

      Specify the resource name if the associated action should be performed on a resource. If the resource name is not provided, then the action will change the sensitivity level of all the resources defined in the rule scope and criteria.

  6. Click Create Rule.

Update a rule

If you have already created and configured a rule, you can edit it from the Business Rules page.

Perform the following steps to edit a rule:

Procedure

  1. Click Management on the menu bar to open the Manage Your Environment page, and then select Business Rules to open the Business Rules page.

    The Business Rules page opens.
  2. Locate the business rule you want to configure in the table of rules and select the View Details button (greater-than sign) in its row.

    If you have a large number of rules, select Show Filters to help you find the rule you want to edit.The Business Rule page opens for the selected rule.
  3. Edit the fields as needed and click Save Rule.

    The rule is saved with your changes. If there is a problem while creating your rule, an error notification displays at the top of the page. Resolve the error and click Save Rule.

Update a rule created using rule blocks

If you have created and configured a rule using Scope, Action, and Criteria blocks, you can edit it from the Business Rules page

Perform the following steps to edit a rule:

Procedure

  1. Click Management on the menu bar to open the Manage Your Environment page, and then select Business Rules to open the Business Rules page.

    The Business Rules page opens.
  2. Locate the business rule you want to configure in the table of rules and select the View Details button (greater-than sign) in its row.

    If you have a large number of rules, select Show Filters to help you find the rule you want to edit.The Business Rule page opens, highlighting the block that is used for the selected rule.
  3. If you want to update the rule block used in the rule, click on the specific block name link (which can be Rule Scope, Rule Criteria, or Rule Actions).

    You will be navigated to the specific block page.
  4. Edit the fields as needed and save the changes.

    The rule will be updated with the block changes.

  5. If you do not want to update the pre-saved rule block currently in use, but you want to change its scope, criteria, and action, then you do one of the following:

    • You can either load a different rule block by clicking the load button on the top right of the scope, criteria, or action component.
    • Update the block on the Update Business Rules page. This will create a new block instead of updating it. You can save this new block with the new name.
    If there is a problem while modifying the block, then an error notification is shown at the top right corner of the page.

Delete a rule

If a rule is no longer needed, you can delete it. Perform the following steps to delete a rule:

Procedure

  1. Click Management on the menu bar to open the Manage Your Environment page, and then select Business Rules.

    The Business Rules page opens.
  2. Use the check box to select the rule you want to delete.

  3. Click the Actions menu and then click Remove. Optionally, select the More actions icon, then click Remove from the drop-down menu.

    A message appears prompting you to enter the text Yes to delete the rule.
  4. Enter Yes in the input field and click Confirm.

    A message appears confirming that the business rule is deleted.
  5. Click Close on the message box to return to the Business Rules page.

View rules

You can view the list of all the rules in Data Catalog.

Perform the following steps to view the rules:

Procedure

  1. Go to Management and click Business Rules.

    The list of all rules in Data Catalog is shown.
  2. To view the rules associated with the specific resource. Navigate to Explore Your Data > Virtual folders > Specific file.

  3. Click Rules tab.

    Rules specific to that file are shown.View rules

Adding rule blocks

You can create a scope, criteria, and actions block and use it anytime later while creating a rule.

Perform the following steps to create a block:

Procedure

  1. Go to Management and click Business Rules.

  2. Click the Blocks tab.

  3. Click Add New Block, and select the scope, criteria, or actions for which you want to create a block.

    NoteIf you make any changes to the block, the rules that are using these blocks are impacted.

Execute rules

Perform the following steps to execute a Data Catalog rule.

NoteIf the rule does not execute as expected, verify the rule configuration and syntax and review the job activity log.
  1. Go to Management and click Business Rules.
  2. Select the rule you want to run and click the Execution tab.

    The Execution Schedule window opens. You can run the rule immediately or add a schedule.

  3. Select Run Now to run the rule immediately.
  4. Click Add Schedule to schedule the rule and select one of the following schedules:
    • On a date
    • Daily
    • Weekly
    • Monthly

    NoteSet the schedule time in UTC zone only.
  5. (Optional) If you want to enter parameters, select the Advanced Mode check box, and enter the parameters in the text box.

    For example, to generate a rule execution report, enter the following additional parameters before rule execution:

    -generateReport true -reportName <Name of the report being generated>

    For more information on additional parameters, see Rule execution report.

  6. Click Apply Changes.
Propagate bindings

Propagate bindings associates the rule with all the data entities that fall under the selected resources.

On the Execution Schedule window,click Propagate Bindings to associate the rule with the data entities.

You will receive notification about the propagate binding status. After completing it, you can go to each data entity and run the rule as required. With propagate bindings, owners of data entities have an option to run the rule or not.

Rule execution report

A rule execution report is a report of all the rules that summarizes how well a rule evaluates the resources in Data Catalog.

To generate a rule execution report, enter the following additional parameters before rule execution:

-generateReport true -reportName <Name of the report being generated>

Define the options as follows:

  • -generateReport

    If this parameter is passed, rule execution generates a report with the name specified by the -reportName parameter.

  • -reportName

    User-defined name for the report being generated. Use with the -generateReport parameter.

All reports are generated in the /var/log/ldc/generatedReports directory. If you do not provide a report name, Data Catalog randomly generates a unique name for each report.