{"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":"2019-11-20T14:07:18","modified_gmt":"2019-11-20T19:07:18","slug":"data-class-validator-workbench","status":"publish","type":"post","link":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/","title":{"rendered":"How to Create a Custom Data Class Validator"},"content":{"rendered":"<p><i><span style=\"font-weight: 400;\">This is the second of a two-part blog 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;\">, provided 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&#8217;t be going into detail on how to setup 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<h4><b>How does IRI Workbench interpret and use the code?<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Before we get into the tutorial, it might be helpful to give a brief overview on how our platform interprets a validation script. When a Javascript file is uploaded into a custom data class, the IRI 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><a href=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13370 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-1.png\" alt=\"\" width=\"681\" height=\"254\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-1.png 711w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-1-300x112.png 300w\" sizes=\"(max-width: 681px) 100vw, 681px\" \/><\/a><\/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 below image displays sample Java code calling and executing a method contained in the validation script.<\/span><\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13371 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-2-1024x764.png\" alt=\"\" width=\"680\" height=\"507\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-2-1024x764.png 1024w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-2-300x224.png 300w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-2-768x573.png 768w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-2.png 1030w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<h4><b>Limitations of the Java ScriptingEngine API<\/b><\/h4>\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;\">\u00a0for 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;\"><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;\"><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 standard out.\u00a0\u00a0<\/span><\/li>\n<\/ul>\n<p><b>Step 1: Create the File<\/b><\/p>\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><a href=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13372 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png\" alt=\"\" width=\"681\" height=\"199\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png 746w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3-300x88.png 300w\" sizes=\"(max-width: 681px) 100vw, 681px\" \/><\/a><\/p>\n<h4><b>Step 2: Define the Validate Method<\/b><\/h4>\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;\">in order to work properly. This function will take in a single argument and returns 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. Thus all validation logic should be contained in this function.\u00a0<\/span><\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13373 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-4.png\" alt=\"\" width=\"680\" height=\"187\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-4.png 687w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-4-300x83.png 300w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<h4><b>Step 3: Write the Logic<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Logic will vary depending on the data your 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&#8217;t 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;\"><span style=\"font-weight: 400;\">The input argument will always be a String<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The return value must be either true or false.<\/span><\/li>\n<\/ul>\n<p><a href=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13374 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-5.png\" alt=\"\" width=\"626\" height=\"746\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-5.png 625w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-5-252x300.png 252w\" sizes=\"(max-width: 626px) 100vw, 626px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">You may be wondering why the function is void of any pattern matching. That\u2019s because the 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\u00a0<\/span><\/p>\n<h4><b>Adding a Validation Script to a Custom Data Class<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">This section uses some elements of <\/span><i><span style=\"font-weight: 400;\">Data Classification<\/span><\/i><span style=\"font-weight: 400;\">, an integrated data cataloging paradigm for defining the search methods used for finding PII independently from the source of the data.\u00a0 While this section provides a small introduction to Data Classification, you may find it useful to read <\/span><a href=\"https:\/\/www.iri.com\/blog\/vldb-operations\/data-classification-in-iri-workbench\/\"><span style=\"font-weight: 400;\">this<\/span><\/a><span style=\"font-weight: 400;\"> article that explores the topic in depth.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now that the validation script is finished, let&#8217;s create a new data class so we can add the script to the IRI Workbench. <\/span><span style=\"font-weight: 400;\">To get started, open up the IRI preferences screen. Select the <\/span><i><span style=\"font-weight: 400;\">IRI Menu <\/span><\/i><span style=\"font-weight: 400;\"> dropdown and select <\/span><i><span style=\"font-weight: 400;\">IRI Preferences<\/span><\/i><span style=\"font-weight: 400;\">. Then select the dropdown for <\/span><i><span style=\"font-weight: 400;\">IRI <\/span><\/i><span style=\"font-weight: 400;\">(within the preferences window) and select <\/span><i><span style=\"font-weight: 400;\">Data Classes and Groups.<\/span><\/i><\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-6.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13375 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-6-1024x584.png\" alt=\"\" width=\"751\" height=\"428\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-6-1024x584.png 1024w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-6-300x171.png 300w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-6-768x438.png 768w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-6.png 1174w\" sizes=\"(max-width: 751px) 100vw, 751px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Select <\/span><i><span style=\"font-weight: 400;\">Add <\/span><\/i><span style=\"font-weight: 400;\">and it will bring you to this window (below)<\/span><i><span style=\"font-weight: 400;\">. <\/span><\/i><\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-7.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13376 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-7.png\" alt=\"\" width=\"650\" height=\"490\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-7.png 731w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-7-300x226.png 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Fill in the relevant fields and select <\/span><i><span style=\"font-weight: 400;\">Add<\/span><\/i><span style=\"font-weight: 400;\"> in the <\/span><i><span style=\"font-weight: 400;\">Matchers <\/span><\/i><span style=\"font-weight: 400;\">section. <\/span><\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-8.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13377 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-8.png\" alt=\"\" width=\"649\" height=\"491\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-8.png 792w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-8-300x227.png 300w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-8-768x581.png 768w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">In the <\/span><i><span style=\"font-weight: 400;\">Data Class Matcher <\/span><\/i><span style=\"font-weight: 400;\">window, I added a <\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Regular_expression\"><span style=\"font-weight: 400;\">regular expression<\/span><\/a><span style=\"font-weight: 400;\"> pattern to the <\/span><i><span style=\"font-weight: 400;\">Details<\/span><\/i><span style=\"font-weight: 400;\"> field. This will check that the credit card number matches a specified pattern.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In the <\/span><i><span style=\"font-weight: 400;\">Validator Script<\/span><\/i><span style=\"font-weight: 400;\"> field, I added the file path to our validation script created in the previous section. Select <\/span><i><span style=\"font-weight: 400;\">OK <\/span><\/i><span style=\"font-weight: 400;\">and then <\/span><i><span style=\"font-weight: 400;\">Apply And Close <\/span><\/i><span style=\"font-weight: 400;\">to save the new data class into the IRI Workbench.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Doing so creates a new Data Class that can be used for any future data classification or data discovery job. If you have any questions about how to classify data for IRI Workbench-supported software like FieldShield, DarkShield or Voracity, email\u00a0<a href=\"mailto:info@iri.com\">info@iri.com<\/a>.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the second of a two-part blog series detailing data class validation in IRI Workbench. The first article, here, provided 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:\/\/beta.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":13372,"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 plugin v23.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create a Custom Data Class Validator - IRI<\/title>\n<meta name=\"description\" content=\"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\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/beta.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 - IRI\" \/>\n<meta property=\"og:description\" content=\"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\" \/>\n<meta property=\"og:url\" content=\"https:\/\/beta.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=\"2019-11-20T19:07:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"746\" \/>\n\t<meta property=\"og:image:height\" content=\"218\" \/>\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:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\"},\"author\":{\"name\":\"Avory Richie and Adam Lewis\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3\"},\"headline\":\"How to Create a Custom Data Class Validator\",\"datePublished\":\"2019-11-14T21:45:36+00:00\",\"dateModified\":\"2019-11-20T19:07:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\"},\"wordCount\":889,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.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:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\",\"url\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\",\"name\":\"How to Create a Custom Data Class Validator - IRI\",\"isPartOf\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png\",\"datePublished\":\"2019-11-14T21:45:36+00:00\",\"dateModified\":\"2019-11-20T19:07:18+00:00\",\"description\":\"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\",\"breadcrumb\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage\",\"url\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png\",\"contentUrl\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png\",\"width\":746,\"height\":218},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/beta.iri.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create a Custom Data Class Validator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#website\",\"url\":\"https:\/\/beta.iri.com\/blog\/\",\"name\":\"IRI\",\"description\":\"Total Data Management Blog\",\"publisher\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/beta.iri.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#organization\",\"name\":\"IRI\",\"url\":\"https:\/\/beta.iri.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png\",\"contentUrl\":\"https:\/\/beta.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:\/\/beta.iri.com\/blog\/#\/schema\/logo\/image\/\"}},[{\"@type\":[\"Person\"],\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3\",\"name\":\"Avory Richie\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/image\/\",\"inLanguage\":\"en_US\",\"url\":\"\",\"caption\":\"Avory Richie\"}},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3\",\"name\":\"Adam Lewis\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/image\/\",\"inLanguage\":\"en_US\",\"url\":\"\",\"caption\":\"Adam Lewis\"}}]]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a Custom Data Class Validator - IRI","description":"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","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:\/\/beta.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 - IRI","og_description":"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","og_url":"https:\/\/beta.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":"2019-11-20T19:07:18+00:00","og_image":[{"width":746,"height":218,"url":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.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:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#article","isPartOf":{"@id":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/"},"author":{"name":"Avory Richie and Adam Lewis","@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3"},"headline":"How to Create a Custom Data Class Validator","datePublished":"2019-11-14T21:45:36+00:00","dateModified":"2019-11-20T19:07:18+00:00","mainEntityOfPage":{"@id":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/"},"wordCount":889,"commentCount":0,"publisher":{"@id":"https:\/\/beta.iri.com\/blog\/#organization"},"image":{"@id":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage"},"thumbnailUrl":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.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:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/","url":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/","name":"How to Create a Custom Data Class Validator - IRI","isPartOf":{"@id":"https:\/\/beta.iri.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage"},"image":{"@id":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage"},"thumbnailUrl":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png","datePublished":"2019-11-14T21:45:36+00:00","dateModified":"2019-11-20T19:07:18+00:00","description":"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","breadcrumb":{"@id":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#primaryimage","url":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png","contentUrl":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png","width":746,"height":218},{"@type":"BreadcrumbList","@id":"https:\/\/beta.iri.com\/blog\/iri\/iri-workbench\/data-class-validator-workbench\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/beta.iri.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create a Custom Data Class Validator"}]},{"@type":"WebSite","@id":"https:\/\/beta.iri.com\/blog\/#website","url":"https:\/\/beta.iri.com\/blog\/","name":"IRI","description":"Total Data Management Blog","publisher":{"@id":"https:\/\/beta.iri.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/beta.iri.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/beta.iri.com\/blog\/#organization","name":"IRI","url":"https:\/\/beta.iri.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png","contentUrl":"https:\/\/beta.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:\/\/beta.iri.com\/blog\/#\/schema\/logo\/image\/"}},[{"@type":["Person"],"@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3","name":"Avory Richie","image":{"@type":"ImageObject","@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/image\/","inLanguage":"en_US","url":"","caption":"Avory Richie"}},{"@type":["Person"],"@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/c43f5ebe932234ac4883cdf194d144c3","name":"Adam Lewis","image":{"@type":"ImageObject","@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/image\/","inLanguage":"en_US","url":"","caption":"Adam Lewis"}}]]}},"jetpack_featured_media_url":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/11\/data-class-validator-3.png","_links":{"self":[{"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/posts\/13366"}],"collection":[{"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/users\/122"}],"replies":[{"embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/comments?post=13366"}],"version-history":[{"count":11,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/posts\/13366\/revisions"}],"predecessor-version":[{"id":17323,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/posts\/13366\/revisions\/17323"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/media\/13372"}],"wp:attachment":[{"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/media?parent=13366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/categories?post=13366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/tags?post=13366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}