About

The eLog library was initially developed as a research prototype and later published for lifelogging researchers in 2010 to help them easily analyze heterogenous data and complex visualization. It has been kept growing with the progress of mobile computing environments and recently its UI part is released with GPL v3 license for wider usage. The eLog UI library is optimized for mobile environment and can get easily integrated with existing Web services.

Who We Are

The original work was proposed by Pil Ho and later extended the work with collaboration with 28 researchers around the world who contributed their lifelogs, collaborated for lifelog analysis and share research results to build up an open lifelogging platform for the public. Pil Ho has been keeping the development updating the library following up the progress in mobile computing.

Updates

  • Nov. 2014: Change the web page skin using bootstrap.
  • Nov. 2014: Published elog UI library as GPL v3.
  • Oct. 2014: Version up eLog library and documentation.

 

Process the Nokia MDC Data

Prepare the database

The SQL script to prepare the data tables. 

Below SQL statements are for the Nokia MDC data processing. We did not actually analyze their data since their data are too much anonymized and intentionally degraded (ex. GPS coordinates) to track one's activities. It has no multimedia data . Also the data set assigned to us includes only a few members lifelog (not hundreds as advertised) living far away with each other.
-- MySQL dump 10.13  Distrib 5.5.11, for Win64 (x86)
--
-- Host: localhost    Database: nokiamdc
-- ------------------------------------------------------
-- Server version	5.5.11

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `accel`
--

DROP TABLE IF EXISTS `accel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accel` (
  `userid` int(11) NOT NULL,
  `tz` int(11) NOT NULL,
  `start` int(11) NOT NULL,
  `stop` int(11) NOT NULL,
  `avdelt` double(15,3) DEFAULT NULL,
  `data` longtext,
  PRIMARY KEY (`userid`,`tz`,`start`,`stop`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `application`
--

DROP TABLE IF EXISTS `application`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `application` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) NOT NULL DEFAULT '0',
  `event` varchar(255) DEFAULT NULL,
  `uid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`,`tz`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bluetooth`
--

DROP TABLE IF EXISTS `bluetooth`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bluetooth` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) NOT NULL DEFAULT '0',
  `mac_prefix` varchar(50) NOT NULL DEFAULT '',
  `mac_address` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`,`tz`,`mac_prefix`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `calendar`
--

DROP TABLE IF EXISTS `calendar`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `calendar` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) NOT NULL DEFAULT '0',
  `uid` int(10) NOT NULL DEFAULT '0',
  `status` varchar(50) DEFAULT NULL,
  `begin` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `class` varchar(50) DEFAULT NULL,
  `last_mod` int(11) DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`,`tz`,`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `calllog`
--

DROP TABLE IF EXISTS `calllog`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `calllog` (
  `userid` int(10) DEFAULT NULL,
  `tz` int(10) DEFAULT NULL,
  `call_time` int(10) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `direction` varchar(50) DEFAULT NULL,
  `description` varchar(50) DEFAULT NULL,
  `number_prefix` varchar(50) DEFAULT NULL,
  `number` varchar(255) DEFAULT NULL,
  `in_phonebook` int(11) DEFAULT NULL,
  `duration` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contacts`
--

DROP TABLE IF EXISTS `contacts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contacts` (
  `userid` int(10) DEFAULT NULL,
  `time` int(10) DEFAULT NULL,
  `tz` int(10) DEFAULT NULL,
  `first_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `mobile_1_prefix` varchar(50) DEFAULT NULL,
  `mobile_1` varchar(255) DEFAULT NULL,
  `mobile_2_prefix` varchar(50) DEFAULT NULL,
  `mobile_2` varchar(255) DEFAULT NULL,
  `mobile_3_prefix` varchar(50) DEFAULT NULL,
  `mobile_3` varchar(255) DEFAULT NULL,
  `tel_1_prefix` varchar(50) DEFAULT NULL,
  `tel_1` varchar(255) DEFAULT NULL,
  `tel_2_prefix` varchar(50) DEFAULT NULL,
  `tel_2` varchar(255) DEFAULT NULL,
  `tel_3_prefix` varchar(50) DEFAULT NULL,
  `tel_3` varchar(255) DEFAULT NULL,
  `last_mod` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `devices`
--

DROP TABLE IF EXISTS `devices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `devices` (
  `mac_prefix` varchar(50) NOT NULL DEFAULT '',
  `mac_address` varchar(255) NOT NULL DEFAULT '',
  `model` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`mac_prefix`,`mac_address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `gps`
--

DROP TABLE IF EXISTS `gps`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gps` (
  `userid` int(10) NOT NULL,
  `time` int(10) NOT NULL,
  `tz` int(10) NOT NULL,
  `gps_time` int(10) NOT NULL,
  `altitude` double DEFAULT NULL,
  `longitude` double DEFAULT NULL,
  `latitude` double DEFAULT NULL,
  `speed` double DEFAULT NULL,
  `heading` double DEFAULT NULL,
  `horizontal_accuracy` double DEFAULT NULL,
  `horizontal_dop` double DEFAULT NULL,
  `vertical_accuracy` double DEFAULT NULL,
  `vertical_dop` double DEFAULT NULL,
  `speed_accuracy` double DEFAULT NULL,
  `heading_accuracy` double DEFAULT NULL,
  `time_since_gps_boot` double DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `gsm`
--

DROP TABLE IF EXISTS `gsm`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gsm` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) DEFAULT NULL,
  `country_code` int(10) DEFAULT NULL,
  `network_code` int(10) DEFAULT NULL,
  `cell_id` int(10) DEFAULT NULL,
  `area_code` int(10) DEFAULT NULL,
  `signal` double DEFAULT NULL,
  `signaldbm` double DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `media`
--

DROP TABLE IF EXISTS `media`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `media` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) DEFAULT NULL,
  `media_time` int(10) DEFAULT NULL,
  `media_tz` int(10) DEFAULT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `size` int(11) DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mediaplay`
--

DROP TABLE IF EXISTS `mediaplay`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mediaplay` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) DEFAULT NULL,
  `album` varchar(255) DEFAULT NULL,
  `artist` varchar(255) DEFAULT NULL,
  `track` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `uri` varchar(255) DEFAULT NULL,
  `state` int(11) DEFAULT NULL,
  `duration` int(11) DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `process`
--

DROP TABLE IF EXISTS `process`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `process` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) NOT NULL DEFAULT '0',
  `path` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`userid`,`time`,`tz`,`path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `questionnaire1`
--

DROP TABLE IF EXISTS `questionnaire1`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `questionnaire1` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `q1` int(10) DEFAULT NULL,
  `q3` int(10) DEFAULT NULL,
  `q5` int(10) DEFAULT NULL,
  `q7a` int(10) DEFAULT NULL,
  `q7b` int(10) DEFAULT NULL,
  `q7c` int(10) DEFAULT NULL,
  `q7d` int(10) DEFAULT NULL,
  `q7e` int(10) DEFAULT NULL,
  `q7f` int(10) DEFAULT NULL,
  `q7g` int(10) DEFAULT NULL,
  `q10a` int(10) DEFAULT NULL,
  `q10b` int(10) DEFAULT NULL,
  `q10c` int(10) DEFAULT NULL,
  `q10d` int(10) DEFAULT NULL,
  `q10e` int(10) DEFAULT NULL,
  `q10f` int(10) DEFAULT NULL,
  `q10g` int(10) DEFAULT NULL,
  `q10h` int(10) DEFAULT NULL,
  `q11ar1` int(10) DEFAULT NULL,
  `q11ar2` int(10) DEFAULT NULL,
  `q11ar3` int(10) DEFAULT NULL,
  `q11ar4` int(10) DEFAULT NULL,
  `q11ar5` int(10) DEFAULT NULL,
  `q11ar6` int(10) DEFAULT NULL,
  `q11ar7` int(10) DEFAULT NULL,
  `q11ar8` int(10) DEFAULT NULL,
  `q11br1` int(10) DEFAULT NULL,
  `q11br2` int(10) DEFAULT NULL,
  `q11br3` int(10) DEFAULT NULL,
  `q11br4` int(10) DEFAULT NULL,
  `q11br5` int(10) DEFAULT NULL,
  `q11br6` int(10) DEFAULT NULL,
  `q11br7` int(10) DEFAULT NULL,
  `q11br8` int(10) DEFAULT NULL,
  `q11cr1` int(10) DEFAULT NULL,
  `q11cr2` int(10) DEFAULT NULL,
  `q11cr3` int(10) DEFAULT NULL,
  `q11cr4` int(10) DEFAULT NULL,
  `q11cr5` int(10) DEFAULT NULL,
  `q11cr6` int(10) DEFAULT NULL,
  `q11cr7` int(10) DEFAULT NULL,
  `q11cr8` int(10) DEFAULT NULL,
  `q11dr1` int(10) DEFAULT NULL,
  `q11dr2` int(10) DEFAULT NULL,
  `q11dr3` int(10) DEFAULT NULL,
  `q11dr4` int(10) DEFAULT NULL,
  `q11dr5` int(10) DEFAULT NULL,
  `q11dr6` int(10) DEFAULT NULL,
  `q11dr7` int(10) DEFAULT NULL,
  `q11dr8` int(10) DEFAULT NULL,
  `q11er1` int(10) DEFAULT NULL,
  `q11er2` int(10) DEFAULT NULL,
  `q11er3` int(10) DEFAULT NULL,
  `q11er4` int(10) DEFAULT NULL,
  `q11er5` int(10) DEFAULT NULL,
  `q11er6` int(10) DEFAULT NULL,
  `q11er7` int(10) DEFAULT NULL,
  `q11er8` int(10) DEFAULT NULL,
  `q11fr1` int(10) DEFAULT NULL,
  `q11fr2` int(10) DEFAULT NULL,
  `q11fr3` int(10) DEFAULT NULL,
  `q11fr4` int(10) DEFAULT NULL,
  `q11fr5` int(10) DEFAULT NULL,
  `q11fr6` int(10) DEFAULT NULL,
  `q11fr7` int(10) DEFAULT NULL,
  `q11fr8` int(10) DEFAULT NULL,
  `q11gr1` int(10) DEFAULT NULL,
  `q11gr2` int(10) DEFAULT NULL,
  `q11gr3` int(10) DEFAULT NULL,
  `q11gr4` int(10) DEFAULT NULL,
  `q11gr5` int(10) DEFAULT NULL,
  `q11gr6` int(10) DEFAULT NULL,
  `q11gr7` int(10) DEFAULT NULL,
  `q11gr8` int(10) DEFAULT NULL,
  `q11hr1` int(10) DEFAULT NULL,
  `q11hr2` int(10) DEFAULT NULL,
  `q11hr3` int(10) DEFAULT NULL,
  `q11hr4` int(10) DEFAULT NULL,
  `q11hr5` int(10) DEFAULT NULL,
  `q11hr6` int(10) DEFAULT NULL,
  `q11hr7` int(10) DEFAULT NULL,
  `q11hr8` int(10) DEFAULT NULL,
  `q12ar1` int(10) DEFAULT NULL,
  `q12ar2` int(10) DEFAULT NULL,
  `q12ar3` int(10) DEFAULT NULL,
  `q12br1` int(10) DEFAULT NULL,
  `q12br2` int(10) DEFAULT NULL,
  `q12br3` int(10) DEFAULT NULL,
  `q12cr1` int(10) DEFAULT NULL,
  `q12cr2` int(10) DEFAULT NULL,
  `q12cr3` int(10) DEFAULT NULL,
  `q12dr1` int(10) DEFAULT NULL,
  `q12dr2` int(10) DEFAULT NULL,
  `q12dr3` int(10) DEFAULT NULL,
  `q12er1` int(10) DEFAULT NULL,
  `q12er2` int(10) DEFAULT NULL,
  `q12er3` int(10) DEFAULT NULL,
  `q12fr1` int(10) DEFAULT NULL,
  `q12fr2` int(10) DEFAULT NULL,
  `q12fr3` int(10) DEFAULT NULL,
  `q12gr1` int(10) DEFAULT NULL,
  `q12gr2` int(10) DEFAULT NULL,
  `q12gr3` int(10) DEFAULT NULL,
  `q12hr1` int(10) DEFAULT NULL,
  `q12hr2` int(10) DEFAULT NULL,
  `q12hr3` int(10) DEFAULT NULL,
  `q12ir1` int(10) DEFAULT NULL,
  `q12ir2` int(10) DEFAULT NULL,
  `q12ir3` int(10) DEFAULT NULL,
  `q12jr1` int(10) DEFAULT NULL,
  `q12jr2` int(10) DEFAULT NULL,
  `q12jr3` int(10) DEFAULT NULL,
  `q12kr1` int(10) DEFAULT NULL,
  `q12kr2` int(10) DEFAULT NULL,
  `q12kr3` int(10) DEFAULT NULL,
  `q13` int(10) DEFAULT NULL,
  `q14a` int(10) DEFAULT NULL,
  `q14b` int(10) DEFAULT NULL,
  `q15ar1` int(10) DEFAULT NULL,
  `q15ar2` int(10) DEFAULT NULL,
  `q15ar3` int(10) DEFAULT NULL,
  `q15ar4` int(10) DEFAULT NULL,
  `q15ar5` int(10) DEFAULT NULL,
  `q15ar6` int(10) DEFAULT NULL,
  `q15ar7` int(10) DEFAULT NULL,
  `q15ar8` int(10) DEFAULT NULL,
  `q15br1` int(10) DEFAULT NULL,
  `q15br2` int(10) DEFAULT NULL,
  `q15br3` int(10) DEFAULT NULL,
  `q15br4` int(10) DEFAULT NULL,
  `q15br5` int(10) DEFAULT NULL,
  `q15br6` int(10) DEFAULT NULL,
  `q15br7` int(10) DEFAULT NULL,
  `q15br8` int(10) DEFAULT NULL,
  `q15cr1` int(10) DEFAULT NULL,
  `q15cr2` int(10) DEFAULT NULL,
  `q15cr3` int(10) DEFAULT NULL,
  `q15cr4` int(10) DEFAULT NULL,
  `q15cr5` int(10) DEFAULT NULL,
  `q15cr6` int(10) DEFAULT NULL,
  `q15cr7` int(10) DEFAULT NULL,
  `q15cr8` int(10) DEFAULT NULL,
  `q15dr1` int(10) DEFAULT NULL,
  `q15dr2` int(10) DEFAULT NULL,
  `q15dr3` int(10) DEFAULT NULL,
  `q15dr4` int(10) DEFAULT NULL,
  `q15dr5` int(10) DEFAULT NULL,
  `q15dr6` int(10) DEFAULT NULL,
  `q15dr7` int(10) DEFAULT NULL,
  `q15dr8` int(10) DEFAULT NULL,
  `q15er1` int(10) DEFAULT NULL,
  `q15er2` int(10) DEFAULT NULL,
  `q15er3` int(10) DEFAULT NULL,
  `q15er4` int(10) DEFAULT NULL,
  `q15er5` int(10) DEFAULT NULL,
  `q15er6` int(10) DEFAULT NULL,
  `q15er7` int(10) DEFAULT NULL,
  `q15er8` int(10) DEFAULT NULL,
  `q15fr1` int(10) DEFAULT NULL,
  `q15fr2` int(10) DEFAULT NULL,
  `q15fr3` int(10) DEFAULT NULL,
  `q15fr4` int(10) DEFAULT NULL,
  `q15fr5` int(10) DEFAULT NULL,
  `q15fr6` int(10) DEFAULT NULL,
  `q15fr7` int(10) DEFAULT NULL,
  `q15fr8` int(10) DEFAULT NULL,
  `q15gr1` int(10) DEFAULT NULL,
  `q15gr2` int(10) DEFAULT NULL,
  `q15gr3` int(10) DEFAULT NULL,
  `q15gr4` int(10) DEFAULT NULL,
  `q15gr5` int(10) DEFAULT NULL,
  `q15gr6` int(10) DEFAULT NULL,
  `q15gr7` int(10) DEFAULT NULL,
  `q15gr8` int(10) DEFAULT NULL,
  `q15hr1` int(10) DEFAULT NULL,
  `q15hr2` int(10) DEFAULT NULL,
  `q15hr3` int(10) DEFAULT NULL,
  `q15hr4` int(10) DEFAULT NULL,
  `q15hr5` int(10) DEFAULT NULL,
  `q15hr6` int(10) DEFAULT NULL,
  `q15hr7` int(10) DEFAULT NULL,
  `q15hr8` int(10) DEFAULT NULL,
  `q15ir1` int(10) DEFAULT NULL,
  `q15ir2` int(10) DEFAULT NULL,
  `q15ir3` int(10) DEFAULT NULL,
  `q15ir4` int(10) DEFAULT NULL,
  `q15ir5` int(10) DEFAULT NULL,
  `q15ir6` int(10) DEFAULT NULL,
  `q15ir7` int(10) DEFAULT NULL,
  `q15ir8` int(10) DEFAULT NULL,
  `q16a` int(10) DEFAULT NULL,
  `q16b` int(10) DEFAULT NULL,
  `q16c` int(10) DEFAULT NULL,
  `q16d` int(10) DEFAULT NULL,
  `q16f` int(10) DEFAULT NULL,
  `q16g` int(10) DEFAULT NULL,
  `q16h` int(10) DEFAULT NULL,
  `q16i` int(10) DEFAULT NULL,
  `q16j` int(10) DEFAULT NULL,
  `q16k` int(10) DEFAULT NULL,
  `q16l` int(10) DEFAULT NULL,
  `q16m` int(10) DEFAULT NULL,
  `q16n` int(10) DEFAULT NULL,
  `q16o` int(10) DEFAULT NULL,
  `q16p` int(10) DEFAULT NULL,
  `q16q` int(10) DEFAULT NULL,
  `q16r` int(10) DEFAULT NULL,
  `q16s` int(10) DEFAULT NULL,
  `q16t` int(10) DEFAULT NULL,
  `q16u` int(10) DEFAULT NULL,
  `q16v` int(10) DEFAULT NULL,
  `q16w` int(10) DEFAULT NULL,
  `q16x` int(10) DEFAULT NULL,
  `q16y` int(10) DEFAULT NULL,
  `q16z` int(10) DEFAULT NULL,
  `q17a_part` int(10) DEFAULT NULL,
  `q17a_freq` int(10) DEFAULT NULL,
  `q17b_part` int(10) DEFAULT NULL,
  `q17b_freq` int(10) DEFAULT NULL,
  `q17c_part` int(10) DEFAULT NULL,
  `q17c_freq` int(10) DEFAULT NULL,
  `q17d_part` int(10) DEFAULT NULL,
  `q17d_freq` int(10) DEFAULT NULL,
  `q17e_part` int(10) DEFAULT NULL,
  `q17e_freq` int(10) DEFAULT NULL,
  `q17f_part` int(10) DEFAULT NULL,
  `q17f_freq` int(10) DEFAULT NULL,
  `q17g_part` int(10) DEFAULT NULL,
  `q17g_freq` int(10) DEFAULT NULL,
  `q17h_part` int(10) DEFAULT NULL,
  `q17h_freq` int(10) DEFAULT NULL,
  `q17i_part` int(10) DEFAULT NULL,
  `q17i_freq` int(10) DEFAULT NULL,
  `q17j_part` int(10) DEFAULT NULL,
  `q17j_freq` int(10) DEFAULT NULL,
  `q17k_part` int(10) DEFAULT NULL,
  `q17k_freq` int(10) DEFAULT NULL,
  `q17l_part` int(10) DEFAULT NULL,
  `q17l_freq` int(10) DEFAULT NULL,
  PRIMARY KEY (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sys`
--

DROP TABLE IF EXISTS `sys`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sys` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) NOT NULL DEFAULT '0',
  `profile` varchar(50) DEFAULT NULL,
  `battery` int(11) DEFAULT NULL,
  `charging` int(11) DEFAULT NULL,
  `freespace_c` int(11) DEFAULT NULL,
  `freespace_d` int(11) DEFAULT NULL,
  `freespace_e` int(11) DEFAULT NULL,
  `freespace_y` int(11) DEFAULT NULL,
  `freespace_z` int(11) DEFAULT NULL,
  `inactive` int(11) DEFAULT NULL,
  `ring` varchar(50) DEFAULT NULL,
  `freeram` int(11) DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`,`tz`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_presence`
--

DROP TABLE IF EXISTS `user_presence`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_presence` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `day` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`userid`,`day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `phone_prefix` varchar(50) NOT NULL DEFAULT '',
  `phonenumber` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`userid`,`phone_prefix`,`phonenumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wlan`
--

DROP TABLE IF EXISTS `wlan`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wlan` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) NOT NULL DEFAULT '0',
  `mac_prefix` varchar(50) NOT NULL DEFAULT '',
  `mac_address` varchar(255) NOT NULL DEFAULT '',
  `ssid` varchar(255) DEFAULT NULL,
  `rx` int(10) DEFAULT NULL,
  `channel` int(10) DEFAULT NULL,
  `security` varchar(50) DEFAULT NULL,
  `opmode` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`,`tz`,`mac_prefix`,`mac_address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wlan_loc`
--

DROP TABLE IF EXISTS `wlan_loc`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wlan_loc` (
  `userid` int(10) NOT NULL DEFAULT '0',
  `time` int(10) NOT NULL DEFAULT '0',
  `tz` int(10) DEFAULT NULL,
  `longitude` double DEFAULT NULL,
  `latitude` double DEFAULT NULL,
  `mac_prefix` varchar(50) DEFAULT NULL,
  `mac_address` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`userid`,`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2012-01-09 15:29:57

Process the MDC data

The PHP script to import the data set. 

query($query))) {
		printf("Table truncation error: %s\n", $mysqli->error);
		exit();
	}
}

// Recursively read all files in the selected directory 
$ite = new RecursiveDirectoryIterator($path);
foreach (new RecursiveIteratorIterator($ite) as $filename=>$cur) {
	if (strstr($cur, ".csv") != "") {
		echo "Processing: ".$cur->getPathName().PHP_EOL;

		$basename = substr($cur->getFilename(), 0, strlen($cur->getFilename()) - 4);
		$filepath = str_ireplace("\\", "/", $cur->getPathname());

		$query = "LOAD DATA LOW_PRIORITY LOCAL INFILE '".$filepath."' IGNORE INTO TABLE `".$basename."` FIELDS TERMINATED BY '\\t' LINES TERMINATED BY '\\n' IGNORE 1 LINES";
		// $query = mysql_real_escape_string($query);

		if (!($result = $mysqli->query($query))) {
			echo $query.PHP_EOL;
			printf("Data insertion error: %s".PHP_EOL."Errors: %s".PHP_EOL, $query, $mysqli->error);
		}
	}
}	

/* Update the photo timestamp by the location */

$mysqli->close();

?>