Rule Validating Absence of a Particular Value
The product documentation provides firm guidance on how to ensure that certain attributes do not possess null values. However, I have a use case involving ruling out that a particular attribute, Section of Law, contains the value “research” in any way. To that end, I have drafted a validation script that I’m not confident functions but bears out this concept:
rule {
given {
SectionOfLaw = attributes.'Section of Law'
}
then {
!contains ('sectionOfLaw', Research)
}
message "Asset ${name} ideally possesses a defined Section of Law"
}
How can I make a rule that would consider a table more validated if fewer records contain the term “research” in a Section of Law attribute? Thanks.
tylerbass
Posted 4 years ago · Edited 1 year ago·Last reply 4 years ago
6 comments
Nicolas Pirou
·4 years ago · EditedHello @tyler.bass.tmrhq2.com
You can test this validation script below. I have tested and this is working (you just need to replace Definition by the name of your Attribute, which is Section of Law):
rule {
given {
presence=attributes.‘Definition’?.first()
}
when {
isNotEmpty(presence)
}
then {
!contains(presence, ‘research’, message: “Attribute Definition of the Asset ${name} in domain ${vocabulary.name} should not contain ‘research’”)
}
}
tylerbass
OP4 years ago · EditedHi, Nicolas. I wanted to say thank you very much for your effort on this matter, which is very helpful to our designs in the near term. Just brilliant and thanks for going the extra mile.
Nicolas Pirou
·4 years ago · EditedThank you Tyler, you’re welcome.
Nicolas Pirou
·4 years ago · EditedHello @tyler.bass.tmrhq2.com
You can test this validation script below. I have tested and this is working (you just need to replace Definition by the name of your Attribute, which is Section of Law):
rule {
given {
presence=attributes.‘Definition’?.first()
}
when {
isNotEmpty(presence)
}
then {
!contains(presence, ‘research’, message: “Attribute Definition of the Asset ${name} in domain ${vocabulary.name} should not contain ‘research’”)
}
}
tylerbass
OP4 years ago · Edited@nicolas.pirou.collibra.com I’m not having any luck repurposing your code as such:
To Kristen’s point, I suspect that an articulation score rule, and not a validation rule, may be more suited to providing insight into whether this field contains the term “research” in any way.
Alexandra Jorgenson
Admin4 years ago · Edited@tyler.bass.tmrhq2.com I see that you posted to the Data Quality forum but can you confirm that you are trying/wanting to use Collbra DQ (vs DG)? Before we can provide guidance on the validation rule setup, we need a deeper understanding on what you have in your environment and use cases.
Alternatively, our coaching services team would be able to assist in this area and your Account Manager could put you in contact with them (or email [email protected] and I would recommend that you reference the URL of this thread).