-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
40 lines (31 loc) · 935 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'sdtout');
require_once "lib/DBhandler.php";
require_once "lib/DLM.php";
//test data sources
$externalSource="./data/demoExternal.csv";
$referenceSource="./data/demoRef.csv";
//creating db
$dbHandler = new DBHandler();
$db = $dbHandler->getDB() ; //todo db object creation here
//var_dump($db->query("create table test(id, name)"));die();
//creating DLM
$matcherParams = array(
'matchingAlgorithm'=>'exactMatch',
'refFieldToMatch'=>'entitycurrentname',
'externalFieldToMatch' =>'name',
'externalTable'=>'demoexternalcsv',
'refTable'=>'demorefcsv',
'refIdField'=>'entityid'
);
$dlm = new DLM($matcherParams, "demoDatasource", $db);
//Import data
$dlm->importRefData($referenceSource);
$dlm->importExternalData($externalSource);
//Matching
$dlm->match();
//Linking
$dlm->link();
//Display restults
$dlm->displayMatches();