Create a Cross-Domain Rule
Applies to: SQL Server
This topic describes how to create a cross-domain rule for a composite domain in a knowledge base in Data Quality Services (DQS). A cross-domain rule tests the relationship between values in single domains that are included in a composite domain. A cross-domain rule must hold true across a composite domain in order for domain values to be considered accurate and conformant to business requirements. A cross-domain rule is used to validate, correct, and standardize domain values.
The If clause and Then clause of a cross-domain rule are each defined for one of the single domains in the composite domain. Each clause must be defined for a different single domain. A cross-domain rule must relate to multiple single domains; you cannot define a simple domain rule (for only a single domain) for a composite domain. You would do so by defining a domain rule for a single domain. The If clause and the Then clause can each contain one or more conditions.
A cross-domain rule that has definitive conditions will apply the rules logic to synonyms of the value in the conditions, as well the values themselves. The definitive conditions for the If and Then clauses are Value is equal to, Value is not equal to, Value is in, or Value is not in. For example, suppose that you have the following cross-domain rule for a composite domain: "For 'City', if Value is equal to 'Los Angeles', then for 'State', Value is equal to 'CA'. "If 'Los Angeles' and 'LA' are synonyms, this rule will return correct for 'Los Angeles CA' and 'LA CA' and in error for 'Los Angeles WA' and 'LA WA'.
Apart from just letting you know about the validity of a cross-domain rule, the definitive Then clause in a cross-domain rule, Value is equal to, also corrects the data during the data-cleansing activity. For more information, see Data Correction using Definitive Cross-Domain Rules in Cleanse Data in a Composite Domain.
Cross-domain rules are taken into consideration after all simple rules that affect only a single domain. Only if a value passes single domain rules (if they exist) is the cross-domain rule applied. The composite domain and the single domains that a rule is run on must all be defined before the rule can be executed.
Before You Begin
Prerequisites
To create a cross-domain rule, you must have created and opened a composite domain.
Security
Permissions
You must have the dqs_kb_editor or the dqs_administrator role on the DQS_MAIN database to create a cross-domain rule.
Create Cross-Domain Rules
Start Data Quality Client. For information about doing so, see Run the Data Quality Client Application.
In the Data Quality Client home screen, open or create a knowledge base. Select Domain Management as the activity, and then click Open or Create. For more information, see Create a Knowledge Base or Open a Knowledge Base.
Note
Domain management is performed in a page of the Data Quality Service client that contains five tabs for separate domain management operations. It is not a wizard-driven process; any management operation can be performed separately.
From the Domain list on the Domain Management page, select the composite domain that you want to create a domain rule for, or create a new composite domain. If you have to create a new domain, see Create a Composite Domain.
Click the CD Rules tab.
Click Add a new domain rule, and then enter a name and description for the rule.
Select Active to specify that the rule will be run (the default), and deselect to prevent the rule from running.
Create the If clause as follows:
In the domain list in the If clause pane, select one of the single domains included in the composite domain to be the subject of the If clause. You can select any single domain in the composite domain.
Select a condition from the drop-down list for the first condition of the clause.
If the condition requires a value, enter the value in the text box associated with the condition.
If the If clause requires another condition, click Adds a new condition to the selected clause. Select the operator, select a condition, and enter a value for the condition, if necessary.
To change the order of the conditions, select a condition by clicking to its left, and then click the up or down arrow.
To hide the conditions, click the minus sign to the left of the domain name. Click the plus ign to display the conditions.
Create the Then clause by selecting a single domain, other than the subject of the If clause, in the domain list in the Then clause pane. Then build the Then clause using the same steps that you did in building the If clause.
Proceed to the testing procedure below.
Test Cross-Domain Rules
Test the cross-domain rule as follows:
Click the Run the selected domain rule on test data to icon in the upper right-hand corner of the composite domain pane.
In the Test Domain Rule dialog box, click the Adds a New Testing Term for the Domain Rule icon.
Enter test values for the single domain associated with the If clause and the single domain associated with the Then clause. The test values entered in the If clause must meet the conditions for that clause, or a question mark will be entered in the Validity column indicating that the cross-domain rule does not apply to the test data.
Click the Adds a new testing term for the domain rule icon again to add another set of test values.
Click the Test the Domain Rule on All the Terms icon. If a set of test values is valid, DQS will enter a check in the Validity column for the row. If the set of test values is not valid, DQS will enter a triangle with an exclamation point in the Validity column for the row.
After your testing is complete, click Close in the Test Composite Domain Rule dialog box.
When you have completed your cross-domain rules, click Finish to complete the domain management activity, as described in End the Domain Management Activity.
Follow Up: After Creating a Cross-Domain Rule
After you create a cross-down rule, you can perform other domain management tasks on the domain, you can perform knowledge discovery to add knowledge to the domain, or you can add a matching policy to the domain. For more information, see Perform Knowledge Discovery, Managing a Domain, or Create a Matching Policy.