{"id":13366,"date":"2019-11-14T16:45:36","date_gmt":"2019-11-14T21:45:36","guid":{"rendered":"http:\/\/www.iri.com\/blog\/?p=13366"},"modified":"2024-02-08T19:41:04","modified_gmt":"2024-02-09T00:41:04","slug":"data-class-validator-workbench","status":"publish","type":"post","link":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/","title":{"rendered":"How to Create a Custom Data Class Validator"},"content":{"rendered":"<p><b><i>Abstract: <\/i><\/b><i><span style=\"font-weight: 400;\">This is the second of a two-part series detailing data class validation in <\/span><\/i><a href=\"https:\/\/www.iri.com\/products\/workbench\"><i><span style=\"font-weight: 400;\">IRI Workbench<\/span><\/i><\/a><i><span style=\"font-weight: 400;\">. The first article, <\/span><\/i><a href=\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validation-workbench\/\"><i><span style=\"font-weight: 400;\">here<\/span><\/i><\/a><i><span style=\"font-weight: 400;\">, provides an overview of the validation scripts and how to use them in a data discovery or classification job. This article shows how to create a custom validation script for a special data class or group.\u00a0<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">In this article, we will create and format a credit card validation script for use in a custom data class. It should be noted that IRI Workbench already provides a credit card data class and validation script for your convenience.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As a prerequisite, you should probably be familiar with ES5 JavaScript and Java 8. To follow along, you will need an IDE or text editor that supports JavaScript 5 (ES5) and Java 8.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I will be using <\/span><a href=\"https:\/\/code.visualstudio.com\/\"><span style=\"font-weight: 400;\">Visual Studio Code<\/span><\/a><span style=\"font-weight: 400;\">, an open source IDE from Microsoft for this section of the tutorial. Although I won\u2019t be going into detail on how to set up Visual Studio Code, you can find more information about the setup process <\/span><a href=\"https:\/\/code.visualstudio.com\/docs\/languages\/java\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\"> and <\/span><a href=\"https:\/\/code.visualstudio.com\/docs\/languages\/javascript\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0\u00a0<\/span><\/p>\n<h5><b>How IRI Workbench Interprets and Uses the Code<\/b><\/h5>\n<p><span style=\"font-weight: 400;\">Before we get into the tutorial, it might be helpful to give a brief overview on how IRI Workbench platform interprets a validation script. When a JavaScript file is uploaded into a custom data class, Workbench will attempt to run the code through the use of the Java <\/span><a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/technotes\/guides\/scripting\/programmer_guide\/\"><span style=\"font-weight: 400;\">ScriptingEngine API<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The ScriptingEngine will then make the JavaScript file implement a validation interface that contains a method called <\/span><i><span style=\"font-weight: 400;\">validate. <\/span><\/i><span style=\"font-weight: 400;\">An example of the validation interface can be seen in the below image (written in Java):\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17315\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/validation-interface-300x112.png\" alt=\"\" width=\"539\" height=\"201\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/validation-interface-300x112.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/validation-interface.png 711w\" sizes=\"(max-width: 539px) 100vw, 539px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">This will search the JavaScript file for a function of the same name and make it executable in Java. For your convenience, the image below displays sample Java code calling and executing a method contained in the validation script.<\/span><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17316\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/sample-Java-code-calling-and-executing-300x224.png\" alt=\"\" width=\"621\" height=\"464\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/sample-Java-code-calling-and-executing-300x224.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/sample-Java-code-calling-and-executing-768x573.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/sample-Java-code-calling-and-executing.png 1024w\" sizes=\"(max-width: 621px) 100vw, 621px\" \/><\/p>\n<h5><b>Limitations of the Java Scripting Engine API<\/b><\/h5>\n<p><span style=\"font-weight: 400;\">The Java Scripting Engine API utilizes the <\/span><a href=\"https:\/\/docs.oracle.com\/javase\/9\/nashorn\/JSNUG.pdf\"><span style=\"font-weight: 400;\">Nashorn engine<\/span><\/a><span style=\"font-weight: 400;\"> for interpreting JavaScript code. With this, there are a few notable limitations to keep in mind when creating your script:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The engine only implements the ECMAScript 5.1 Specification. ES6 syntax is not supported.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The Nashorn engine does not have a console object. Running a script with <\/span><i><span style=\"font-weight: 400;\">console.log(\u201cHello World\u201d)<\/span><\/i><span style=\"font-weight: 400;\"> will throw an error. Use the Nashorn <\/span><i><span style=\"font-weight: 400;\">print <\/span><\/i><span style=\"font-weight: 400;\">function instead. For example, using <\/span><i><span style=\"font-weight: 400;\">print(\u201cHello\u201d, \u201cWorld\u201d) <\/span><\/i><span style=\"font-weight: 400;\">will print its arguments to standardize out. <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<\/ul>\n<h5><b>Step 1: Create the File<\/b><\/h5>\n<p><span style=\"font-weight: 400;\">To get started, open up your preferred text editor and create a new JavaScript file. In the image below you can see I created a JavaScript file named <\/span><i><span style=\"font-weight: 400;\">validator-creditcard.js<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17317\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/validator-creditcard-js-300x88.png\" alt=\"\" width=\"538\" height=\"158\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/validator-creditcard-js-300x88.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/validator-creditcard-js.png 746w\" sizes=\"(max-width: 538px) 100vw, 538px\" \/><\/p>\n<h5><b>Step 2: Define the Validate Method<\/b><\/h5>\n<p><span style=\"font-weight: 400;\">The JavaScript file must have a function named <\/span><i><span style=\"font-weight: 400;\">validate <\/span><\/i><span style=\"font-weight: 400;\">to work properly. This function will take in a single argument and will return either true or false.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can consider this the most important function within the script since it will be the one invoked by IRI Workbench. Therefore, all validation logic should be contained in this function.\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17318\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/all-validation-logic-should-be-contained-300x83.png\" alt=\"\" width=\"499\" height=\"138\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/all-validation-logic-should-be-contained-300x83.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/all-validation-logic-should-be-contained.png 687w\" sizes=\"(max-width: 499px) 100vw, 499px\" \/><\/p>\n<h5><b>Step 3: Write the Logic<\/b><\/h5>\n<p><span style=\"font-weight: 400;\">Logic will vary depending on the data you&#8217;re working on. For credit cards, the only validation logic that will need to be performed is a simple checksum using the <\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Luhn_algorithm\"><span style=\"font-weight: 400;\">Luhn Algorithm<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I won\u2019t be going into detail on how to implement this algorithm but a good example can be found <\/span><a href=\"https:\/\/simplycalc.com\/luhn-source.php\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\">. In the image below, you can see I implemented the validation logic using a helper function.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A few things to note:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The input argument will always be a String<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The return value must be either true or false.<\/span><\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17319\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/function-validate-value-252x300.png\" alt=\"\" width=\"412\" height=\"490\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/function-validate-value-252x300.png 252w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/function-validate-value.png 625w\" sizes=\"(max-width: 412px) 100vw, 412px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">You may be wondering why the function is void of any pattern matching. That\u2019s because IRI Workbench has a separate field for uploading patterns (more on this in the next section). It will run your provided pattern first and then run the validation script.\u00a0 <\/span><\/p>\n<h5><b>Adding a Validation Script to a Data Matcher<\/b><\/h5>\n<p><span style=\"font-weight: 400;\">Validation scripts are used during the <\/span><a href=\"https:\/\/www.iri.com\/blog\/data-protection\/iri-data-classification\/\"><span style=\"font-weight: 400;\">data classification process<\/span><\/a><span style=\"font-weight: 400;\">, and are assigned inside Data Matchers. <\/span><a href=\"https:\/\/www.iri.com\/blog\/data-protection\/data-matchers\/\"><span style=\"font-weight: 400;\">Data Matchers<\/span><\/a><span style=\"font-weight: 400;\"> are used in the data classification process to match data, versus <\/span><a href=\"https:\/\/www.iri.com\/blog\/data-protection\/location-matchers\/\"><span style=\"font-weight: 400;\">Location Matchers<\/span><\/a><span style=\"font-weight: 400;\"> which match against the structure\/metadata of a source. Currently, the only type of Data Matcher that supports the use of validation scripts is pattern matchers. <\/span><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17320\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/credit-card-data-pattern-300x164.png\" alt=\"\" width=\"675\" height=\"369\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/credit-card-data-pattern-300x164.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/credit-card-data-pattern-1024x560.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/credit-card-data-pattern-768x420.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/credit-card-data-pattern.png 1054w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">To assign a validation script to a pattern matcher we can either create a new pattern matcher or edit an existing pattern matcher in a Data Class from the Data Class &amp; Rule Library. In the example above, there is a data class called <\/span><i><span style=\"font-weight: 400;\">Credit_Card_Char<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This data class contains a data matcher that uses a pattern to match credit card numbers. Clicking <\/span><i><span style=\"font-weight: 400;\">Edit \u2026 <\/span><\/i><span style=\"font-weight: 400;\">will open the dialog to edit the parameters of the data matcher.<\/span><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17322\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/parameters-of-data-matcher-300x293.png\" alt=\"\" width=\"447\" height=\"437\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/parameters-of-data-matcher-300x293.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/parameters-of-data-matcher.png 550w\" sizes=\"(max-width: 447px) 100vw, 447px\" \/><\/p>\n<p><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">On this page, I added the file path to a validation script. Click OK to close the dialog. Now the Data Matcher stored inside the <\/span><i><span style=\"font-weight: 400;\">Credit_Card_Char <\/span><\/i><span style=\"font-weight: 400;\">data class will match credit card numbers based on a pattern and then be validated using the validation script provided.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you have any questions about how to classify data for IRI Workbench-supported software like FieldShield, DarkShield or CellShield EE (or Voracity which includes them), email <\/span><a href=\"mailto:support@iri.com\"><span style=\"font-weight: 400;\">support@iri.com<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Abstract: This is the second of a two-part series detailing data class validation in IRI Workbench. The first article, here, provides an overview of the validation scripts and how to use them in a data discovery or classification job. This article shows how to create a custom validation script for a special data class or<\/p>\n<div><a class=\"btn-filled btn\" href=\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\" title=\"How to Create a Custom Data Class Validator\">Read More<\/a><\/div>\n","protected":false},"author":122,"featured_media":17324,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[8,363,91],"tags":[1304,1451,850,1106,149],"class_list":["post-13366","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-protection","category-data-quality","category-iri-workbench","tag-data-class","tag-data-class-matcher","tag-iri-workbench","tag-javascript","tag-pii"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.4 (Yoast SEO v23.4) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create a Custom Data Class Validator - IRI<\/title>\n<meta name=\"description\" content=\"Abstract: This is the second of a two-part series detailing data class validation in IRI Workbench. The first article, here, provides an overview of the validation scripts and how to use them in a data discovery or classification job. This article shows how to create a custom validation script for a special data class or group.\u00a0In this article, we will create and format a credit card validation script for use in a custom data class. It should be noted that IRI Workbench already provides a credit card data class and validation script for your convenience.\u00a0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a Custom Data Class Validator\" \/>\n<meta property=\"og:description\" content=\"Abstract: This is the second of a two-part series detailing data class validation in IRI Workbench. The first article, here, provides an overview of the validation scripts and how to use them in a data discovery or classification job. This article shows how to create a custom validation script for a special data class or group.\u00a0In this article, we will create and format a credit card validation script for use in a custom data class. It should be noted that IRI Workbench already provides a credit card data class and validation script for your convenience.\u00a0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\" \/>\n<meta property=\"og:site_name\" content=\"IRI\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-14T21:45:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-09T00:41:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"768\" \/>\n\t<meta property=\"og:image:height\" content=\"368\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Avory Richie and Adam Lewis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Avory Richie and Adam Lewis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\"},\"author\":{\"name\":\"Avory Richie and Adam Lewis\",\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3\"},\"headline\":\"How to Create a Custom Data Class Validator\",\"datePublished\":\"2019-11-14T21:45:36+00:00\",\"dateModified\":\"2024-02-09T00:41:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\"},\"wordCount\":855,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.iri.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png\",\"keywords\":[\"data class\",\"data class matcher\",\"IRI Workbench\",\"JavaScript\",\"PII\"],\"articleSection\":[\"Data Masking\/Protection\",\"Data Quality (DQ&#041;\",\"IRI Workbench\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\",\"url\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\",\"name\":\"How to Create a Custom Data Class Validator - IRI\",\"isPartOf\":{\"@id\":\"https:\/\/www.iri.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png\",\"datePublished\":\"2019-11-14T21:45:36+00:00\",\"dateModified\":\"2024-02-09T00:41:04+00:00\",\"description\":\"Abstract: This is the second of a two-part series detailing data class validation in IRI Workbench. The first article, here, provides an overview of the validation scripts and how to use them in a data discovery or classification job. This article shows how to create a custom validation script for a special data class or group.\u00a0In this article, we will create and format a credit card validation script for use in a custom data class. It should be noted that IRI Workbench already provides a credit card data class and validation script for your convenience.\u00a0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage\",\"url\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png\",\"contentUrl\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png\",\"width\":768,\"height\":368},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.iri.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create a Custom Data Class Validator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.iri.com\/blog\/#website\",\"url\":\"https:\/\/www.iri.com\/blog\/\",\"name\":\"IRI\",\"description\":\"Total Data Management Blog\",\"publisher\":{\"@id\":\"https:\/\/www.iri.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.iri.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.iri.com\/blog\/#organization\",\"name\":\"IRI\",\"url\":\"https:\/\/www.iri.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png\",\"contentUrl\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png\",\"width\":750,\"height\":206,\"caption\":\"IRI\"},\"image\":{\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/logo\/image\/\"}},[{\"@type\":[\"Person\"],\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3\",\"name\":\"Avory Richie\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/person\/image\/\",\"inLanguage\":\"en_US\",\"url\":\"\",\"caption\":\"Avory Richie\"}},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3\",\"name\":\"Adam Lewis\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/person\/image\/\",\"inLanguage\":\"en_US\",\"url\":\"\",\"caption\":\"Adam Lewis\"}}]]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Create a Custom Data Class Validator - IRI","description":"Abstract: This is the second of a two-part series detailing data class validation in IRI Workbench. The first article, here, provides an overview of the validation scripts and how to use them in a data discovery or classification job. This article shows how to create a custom validation script for a special data class or group.\u00a0In this article, we will create and format a credit card validation script for use in a custom data class. It should be noted that IRI Workbench already provides a credit card data class and validation script for your convenience.\u00a0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a Custom Data Class Validator","og_description":"Abstract: This is the second of a two-part series detailing data class validation in IRI Workbench. The first article, here, provides an overview of the validation scripts and how to use them in a data discovery or classification job. This article shows how to create a custom validation script for a special data class or group.\u00a0In this article, we will create and format a credit card validation script for use in a custom data class. It should be noted that IRI Workbench already provides a credit card data class and validation script for your convenience.\u00a0","og_url":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/","og_site_name":"IRI","article_published_time":"2019-11-14T21:45:36+00:00","article_modified_time":"2024-02-09T00:41:04+00:00","og_image":[{"width":768,"height":368,"url":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png","type":"image\/png"}],"author":"Avory Richie and Adam Lewis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Avory Richie and Adam Lewis","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#article","isPartOf":{"@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/"},"author":{"name":"Avory Richie and Adam Lewis","@id":"https:\/\/www.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3"},"headline":"How to Create a Custom Data Class Validator","datePublished":"2019-11-14T21:45:36+00:00","dateModified":"2024-02-09T00:41:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/"},"wordCount":855,"commentCount":0,"publisher":{"@id":"https:\/\/www.iri.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage"},"thumbnailUrl":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png","keywords":["data class","data class matcher","IRI Workbench","JavaScript","PII"],"articleSection":["Data Masking\/Protection","Data Quality (DQ&#041;","IRI Workbench"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/","url":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/","name":"How to Create a Custom Data Class Validator - IRI","isPartOf":{"@id":"https:\/\/www.iri.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage"},"image":{"@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage"},"thumbnailUrl":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png","datePublished":"2019-11-14T21:45:36+00:00","dateModified":"2024-02-09T00:41:04+00:00","description":"Abstract: This is the second of a two-part series detailing data class validation in IRI Workbench. The first article, here, provides an overview of the validation scripts and how to use them in a data discovery or classification job. This article shows how to create a custom validation script for a special data class or group.\u00a0In this article, we will create and format a credit card validation script for use in a custom data class. It should be noted that IRI Workbench already provides a credit card data class and validation script for your convenience.\u00a0","breadcrumb":{"@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage","url":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png","contentUrl":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png","width":768,"height":368},{"@type":"BreadcrumbList","@id":"https:\/\/www.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.iri.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create a Custom Data Class Validator"}]},{"@type":"WebSite","@id":"https:\/\/www.iri.com\/blog\/#website","url":"https:\/\/www.iri.com\/blog\/","name":"IRI","description":"Total Data Management Blog","publisher":{"@id":"https:\/\/www.iri.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.iri.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.iri.com\/blog\/#organization","name":"IRI","url":"https:\/\/www.iri.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.iri.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png","contentUrl":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png","width":750,"height":206,"caption":"IRI"},"image":{"@id":"https:\/\/www.iri.com\/blog\/#\/schema\/logo\/image\/"}},[{"@type":["Person"],"@id":"https:\/\/www.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3","name":"Avory Richie","image":{"@type":"ImageObject","@id":"https:\/\/www.iri.com\/blog\/#\/schema\/person\/image\/","inLanguage":"en_US","url":"","caption":"Avory Richie"}},{"@type":["Person"],"@id":"https:\/\/www.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3","name":"Adam Lewis","image":{"@type":"ImageObject","@id":"https:\/\/www.iri.com\/blog\/#\/schema\/person\/image\/","inLanguage":"en_US","url":"","caption":"Adam Lewis"}}]]}},"jetpack_featured_media_url":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-Create-a-Custom-Data-Class-Validator-feature-image.png","_links":{"self":[{"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/posts\/13366"}],"collection":[{"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/users\/122"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/comments?post=13366"}],"version-history":[{"count":11,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/posts\/13366\/revisions"}],"predecessor-version":[{"id":17323,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/posts\/13366\/revisions\/17323"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/media\/17324"}],"wp:attachment":[{"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/media?parent=13366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/categories?post=13366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/tags?post=13366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}