String Cleanser

Reltio provides options to configure the string cleanser.

Cleanser Name - StringFunctionCleanser

Description - This cleanser alters the given text based on the specified options. It also adds an attribute with the ReltioCleanser crosswalk, based on the output mapping. Following are the specific cleanse functions under this category:

  • String value casing - Upper, lower, and title
  • String value trimming - leading/trailing spaces
  • String value padding - padding of characters set to the input attribute value
  • String value scrubbing - removal of any character
Note: Before using the cleanser, consider the following points:
  • These characters are not allowed for scrubbing - '[', ']', '\' and '"'.
  • However, these characters can be used with the escape character - '\[', '\]', '\\\' and '\"'.
Mapping Input Fields - The String Function cleanser uses the given input file name and maps the name to the output file. The system does not validate input & output field names. You can define names for the following attributes:
Table 1. Mapping Input Fields
Cleanse Attribute Name Mandatory Description
InputText No  
CleanseAttribute1 No  
CleanseAttribute2 No  
Note: You cannot define the names for the OutputText attribute.
Mapping Output Fields
Table 2. Mapping Output Fields
Cleanse Attribute Name Mandatory Description
InputText No  
CleanseAttribute1 No  
CleanseAttribute2 No  
Options
Table 3. String Function Cleanser Option
Key Allowed Values Description
casing Upper/Lower/Title Optional. If no value is mentioned it does nothing.

Default: Nothing.

trim Boolean (true/false) Default: false.
padding.position left/right/center Default: left.
padding.length Number Default: 0.
padding.padChar Any character Default: Space( ).
scrub Any character sequence Example: !@#$%.
Multi-Field Examples
Table 4. Multi-Field Examples
Options Cleanse Input Cleanse Output
{"casing" : "Upper"}
{
"InputText": "Work",
"Email": "Ent.One@gmail.com",
"Address1": "amr Tech park"
}
{
"OutputText": "WORK",
"Email": "ENT.ONE@GMAIL.COM",
"Address1": "AMR TECH PARK"
}
{"scrub" : "!@#$"}
{
"PhoneType": "Home@Phone#",
"FirstName": "!Wa@lter",
"Organization": "@Reltio #India Pvt!. Ltd.$"
}
{
"PhoneType": "HomePhone",
"FirstName": "Walter",
"Organization": "Reltio India Pvt. Ltd."
}

L3 Configuration - Map the StringFunctionCleanser for any entity in your L3 configuration. The configuration looks as shown below:

{
  "uri": "configuration/entityTypes/HCP1",
  "cleanseConfig": {
    "infos": [
      {
        "uri": "configuration/entityTypes/HCP1/cleanse/infos/StringFunctionCleanser",
        "useInCleansing": true,
        "sequence": [
          {
            "chain": [
              {
                "cleanseFunction": "StringFunctionCleanser",
                "resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
                "proceedOnSuccess": true,
                "proceedOnFailure": true,
                "mapping": {
                  "inputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP1/attributes/Name",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "InputText"
                    }
                  ],
                  "outputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP1/attributes/Name",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "OutputText"
                    }
                  ]
                },
                "params": {
                  "trim": true
                }
              }
            ]
          }
        ]
      },
      {
        "uri": "configuration/entityTypes/HCP1/cleanse/infos/StringFunctionCleanser2",
        "useInCleansing": true,
        "sequence": [
          {
            "chain": [
              {
                "cleanseFunction": "StringFunctionCleanser",
                "resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
                "proceedOnSuccess": true,
                "proceedOnFailure": true,
                "mapping": {
                  "inputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP1/attributes/Country",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "InputText"
                    }
                  ],
                  "outputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP1/attributes/Country",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "OutputText"
                    }
                  ]
                },
                "params": {
                  "casing": "Upper"
                }
              }
            ]
          }
        ]
      },
      {
        "uri": "configuration/entityTypes/HCP1/cleanse/infos/StringFunctionCleanser3",
        "useInCleansing": true,
        "sequence": [
          {
            "chain": [
              {
                "cleanseFunction": "StringFunctionCleanser",
                "resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
                "proceedOnSuccess": true,
                "proceedOnFailure": true,
                "mapping": {
                  "inputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP1/attributes/Description",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "InputText"
                    }
                  ],
                  "outputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP1/attributes/Description",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "OutputText"
                    }
                  ]
                },
                "params": {
                  "scrub": "!@#$&*()<>/^"
                }
              }
            ]
          }
        ]
      },
      {
        "uri": "configuration/entityTypes/HCP1/cleanse/infos/StringFunctionCleanser4",
        "useInCleansing": true,
        "sequence": [
          {
            "chain": [
              {
                "cleanseFunction": "StringFunctionCleanser",
                "resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
                "proceedOnSuccess": true,
                "proceedOnFailure": true,
                "mapping": {
                  "inputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP1/attributes/Salary",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "InputText"
                    }
                  ],
                  "outputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP1/attributes/Salary",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "OutputText"
                    }
                  ]
                },
                "params": {
                  "padding": {
                    "position": "left",
                    "length": 20,
                    "padChar": "*"
                  }
                }
              }
            ]
          }
        ]
      }
    ]
  },
  "attributes": [
    {
      "uri": "configuration/entityTypes/HCP1/attributes/Name",
      "label": "Name",
      "name": "Name",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    },
    {
      "uri": "configuration/entityTypes/HCP1/attributes/Country",
      "label": "Country",
      "name": "Country",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    },
    {
      "uri": "configuration/entityTypes/HCP1/attributes/Description",
      "label": "Description",
      "name": "Description",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    },
    {
      "uri": "configuration/entityTypes/HCP1/attributes/Salary",
      "label": "Salary",
      "name": "Salary",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    }
  ]
}

Example

Table 5. Example
Options Input Text Output Text
{
   “casing” : “Upper”
}
Text Cleanser Example TEXT CLEANSER EXAMPLE
{
   “casing” : “Title”
}
text cleanser example Text Cleanser Example
{
   “padding” : 
   {
      “position”: “left”,
      “length”: 15,
   }
}
"Pad Me" "*********Pad Me"
{
   “padding” : 
   {
      “position”: “right”,
      “length”: 15,
      “padChar”: “*”
   }
}
"Pad Me" "Pad Me*********"
{
   “padding” : 
   {
      “position”: “center”,
      “length”: 15,
      “padChar”: “*”
   }
}
"Pad Me" "****Pad Me*****"
{
   “scrub” : “!@#$&*()<>/^”
}
"Scrub !this #text: /Four #4 score$ and* @seven #7 years ago!." Scrub this text: Four 4 score and seven 7 years ago.