Accelerate the Value of Data

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
    By themselves, the following characters cannot be used for scrubbing:
    • Open square bracket - [

    • Closed square bracket - ]

    • Escape - \

    • Double quotation - "

      You can, however, use them along with the escape character, as shown below:

    • \\[

    • \\]

    • \\\\

    • \"
      Note: The caret (^) symbol must be escaped only if it is used as the first character in a pattern. For example: \^.
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 NameMandatoryDescription
InputTextNo
CleanseAttribute1No
CleanseAttribute2No
Note: You cannot define the names for the OutputText attribute.
Mapping Output Fields
Table 2. Mapping Output Fields
Cleanse Attribute NameMandatoryDescription
InputTextNo
CleanseAttribute1No
CleanseAttribute2No
Options
Table 3. String Function Cleanser Option
KeyAllowed ValuesDescription
casingUpper/Lower/TitleOptional. If no value is mentioned it does nothing.

Default: Nothing.

trimBoolean (true/false)Default: false.
padding.positionleft/right/centerDefault: left.
padding.lengthNumberDefault: 0.
padding.padCharAny characterDefault: Space( ).
scrubSupported escape sequences:
  • \b

  • \n

  • \r

  • \t

  • \f

Example: !@#$%\b.
Multi-Field Examples
Table 4. Multi-Field Examples
OptionsCleanse InputCleanse 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
OptionsInput TextOutput Text
{
   “casing” : “Upper”
}
Text Cleanser ExampleTEXT CLEANSER EXAMPLE
{
   “casing” : “Title”
}
text cleanser exampleText 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.