Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
titleconfig.json
{
    "sources": {
        "salespeople": {
            "dsnsource_type": "csv:///",
            "source_file": "salespeople.csv",

            "field_id": "name",
            "field_matching": ["name", "email"],
            "hierarchy": "manager -> name",
        }
    }
}

What the above code does is create a new source of known entities called "salespeople", and for this source we set the data source name ("dsn") to point to load the CSV file salespeople.csv which is located in the same folder as the config.json file.

...

Code Block
languagejs
titleconfig.json
{
    "sources": {
        "salespeople": {
            "dsnsource_type": "csv:///salespeople.csv",
             "source_file": "salespeople.csv",

            "field_id": "name",
            "field_matching": ["name", "email"],
			"hierarchy": "manager -> name",
            "strategy": "salesperson_strategy"
        }
    },

    "strategies": {
        "salesperson_strategy": {
            "min_score": 0.9,
            "keywords": [
                "name",
                "position"
            ],
            "parent_keywords": [
                "name -> manager name",
                "position -> manager position"
            ],
        }
    }
}

...

Code Block
languagejs
titleLookup Database
{
  "lookup": {
    "[\"default\", [\"default\"], false]": {
      "jdoe": [
        "Jane Doe"
		...

  "entries": {
    "Jane Doe": {
      "parent_id": "David Cole",
      "data": {
        "email": "jdoe@company.com",
        "manager": "David Cole",
        "position": "District Manager",
        "id": "2",
        "name": "Jane Doe"
      },
      "names": [
        "Jane Doe",
        "jdoe@company.com"
      ],
      "strategy": "salesperson_strategy"
    ...

 


It is important to remember that any time we make changes to the config.json file, we have to rerun "kee compile" for those changes to take affect. 

...

In this example, the KEE project will be available as a pipelet with the title "Salesperson Extraction" once it is uploaded.

Use other Data Sources

This tutorial uses a CSV data source. You can use any other data source which the Data Loader can connect to. For example, to connect directly to Salesforce.com, use the /wiki/spaces/DOWN/pages/54624264 (license required) and then change the source section to something like this:

Code Block
languagejs
titleconfig.json
{
    "sources": {
        "salespeople": {
            "source_script": "salesforce/salesforce.py",
            "salesforce_user": "…",
            "salesforce_password": "…",
            "salesforce_token": "…",
            "salesforce_query": "SELECT Id,Name,Email,ManagerId FROM User WHERE IsActive=true",


            "field_id": "Id",
            "field_matching": ["Name", "Email"],
            "hierarchy": "ManagerId -> Id",
        }
    }
}

Download this Example KEE Project

...