Index: Dev/trunk/classes_old/Application.php
===================================================================
--- Dev/trunk/classes_old/Application.php	(revision 136)
+++ Dev/trunk/classes_old/Application.php	(revision 136)
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * Description of Application
+ *
+ * @author fpvanagthoven
+ */
+class Application {
+    
+    public $id;
+    public $title;
+    public $description;
+    public $style;
+
+    public function __construct($id = null, $title = null, $description = null, $style = null) 
+    {
+        $this->id = $id;
+        $this->title = $title;
+        $this->description = $description;
+	$this->style = $style;
+    }
+    
+    public static function getApplication($info)
+    {
+        return new Application(
+                $info['applicationID'],
+                $info['applicationTitle'],
+                $info['applicationDescription'],
+                $info['applicationStyle']);
+    }
+
+}
+?>
Index: Dev/trunk/classes_old/ApplicationCreationTool.php
===================================================================
--- Dev/trunk/classes_old/ApplicationCreationTool.php	(revision 136)
+++ Dev/trunk/classes_old/ApplicationCreationTool.php	(revision 136)
@@ -0,0 +1,92 @@
+<?php
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of ApplicationCreationTool
+ *
+ * @author fpvanagthoven
+ */
+class ApplicationCreationTool {
+
+    private $application;
+
+    public function __construct($application = null) {
+        $this->application = $application;
+
+        $this->javascript();
+
+        $this->init();
+    }
+
+    private function javascript() {
+        ?>
+        <script type="text/javascript" src="js/creation.js"></script>
+        <script language="JavaScript" type="text/javascript">
+            function save(id){
+                var form = document.getElementById('applicationCreationForm');
+                var applicationUID = id;
+                                        
+                var applicationIDInput = document.createElement('input');
+                applicationIDInput.name = 'applicationUID';
+                applicationIDInput.value = applicationUID;
+                applicationIDInput.type = 'hidden';
+                                
+                form.appendChild(applicationIDInput);
+                                
+                form.submit();
+            }
+        </script>
+        <?php
+    }
+
+    private function init() {
+        ?>
+        <div id="creation">
+            <form id="applicationCreationForm" action="" method="post">
+                <?php
+                $this->title();
+                $this->description();
+
+                $this->save();
+                ?>
+            </form>
+        </div>
+        <?php
+    }
+
+    private function title() {
+        if (isset($this->application->title))
+            $value = $this->application->title;
+        else
+            $value = 'Untitled Application';
+        ?>
+        <input type="text" id="applicationTitle" class="titleBox" name="applicationTitle" value="<?php echo str_replace("\"", "&quot;", $value); ?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" />
+        <?php
+    }
+
+    private function description() {
+        if (isset($this->application->description))
+            $value = $this->application->description;
+        else
+            $value = 'Write a description for this application here.';
+        ?>
+        <textarea id="applicationDescription" class="descriptionBox" name="applicationDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea>
+        <?php
+    }
+
+    private function save() {
+        if (isset($this->application)) {
+            $id = $this->application->id;
+        } else {
+            $id = null;
+        }
+        ?>
+        <input type="button" onclick="save('<?php echo $id; ?>')" class="surveyButton topRight" value="Save" />
+        <?php
+    }
+
+}
+?>
Index: Dev/trunk/classes_old/ApplicationDatabaseInterface.php
===================================================================
--- Dev/trunk/classes_old/ApplicationDatabaseInterface.php	(revision 136)
+++ Dev/trunk/classes_old/ApplicationDatabaseInterface.php	(revision 136)
@@ -0,0 +1,77 @@
+<?php
+
+// Survey database interface class as intermediate for storing data from the site to the RDF database 
+require_once 'rdfConstants.php';
+
+// Include RAP Library to write RDF files
+include(RDFAPI_INCLUDE_DIR . "RDFAPI.php");
+
+
+
+class ApplicationDatabaseInterface
+{		
+    protected $applicationRDFWriter;
+    protected $applicationRDFReader;
+
+    protected $applicationID;
+
+
+    public function __construct($applicationID)
+    {		
+        if($applicationID == null)
+            $this->applicationID = md5( uniqid(rand(), true) );
+        else
+            $this->applicationID = $applicationID;
+			
+        $this->applicationRDFWriter = new ApplicationRDFWriter($this->applicationID);
+        $this->applicationRDFReader = new ApplicationRDFReader();
+    }
+    
+    public function getApplicationID()
+    {
+        return $this->applicationID;
+    }
+
+    public function setApplicationInfo($applicationInfo)
+    {
+        $appTitle = $applicationInfo['applicationTitle'];
+        $appDescription = $applicationInfo['applicationDescription'];
+        $appStyle = null;
+
+        $this->applicationRDFWriter->setApplicationInfo($appTitle, $appDescription, $appStyle);
+
+        $this->applicationRDFWriter->saveApplications();
+    }
+
+    public function getApplicationInfo($applicationID)
+    {
+        $applicationInfo = array();
+
+        $resultApplication = $this->applicationRDFReader->readApplicationInfo($applicationID);
+        
+        $applicationInfo['applicationID'] = $applicationID;
+        $applicationInfo['applicationTitle'] = $resultApplication[0]['?title']->label;
+        $applicationInfo['applicationDescription'] = $resultApplication[0]['?description']->label;
+        $applicationInfo['applicationStyle'] = $resultApplication[0]['?style']->label;
+        return $applicationInfo;
+    }
+
+    public function getExistingApplications()
+    {
+        $applicationInfo = array();
+
+        $resultApplication = $this->applicationRDFReader->readAllApplications();
+        if($resultApplication[0] != false)
+        {
+            for($aNumber = 0;$aNumber<sizeof($resultApplication[0]);$aNumber++)
+            {
+                $aID = $resultApplication[0][$aNumber]['?uid']->label;
+                $aTitle = $resultApplication[1][$aNumber]['?title']->label;
+                $applicationInfo[$aID] = $aTitle;
+            }
+        }
+
+        return $applicationInfo;
+    }
+}
+?>
Index: Dev/trunk/classes_old/ApplicationMenu.php
===================================================================
--- Dev/trunk/classes_old/ApplicationMenu.php	(revision 136)
+++ Dev/trunk/classes_old/ApplicationMenu.php	(revision 136)
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * Description of ApplicationMenu
+ *
+ * @author fpvanagthoven
+ */
+class ApplicationMenu extends Menu {
+
+    public function __construct($applications) {
+        ?><fieldset class="menu"><?php
+        parent::__construct('Application');
+        ?> <div class="menuButtons"> <?php
+        ApplicationMenu::createApplicationButton();
+        ApplicationMenu::loadApplicationButton();
+        ?> </div> <?php
+        ApplicationMenu::loadApplicationList($applications);
+        ?></fieldset><?php
+    }
+
+    public static function createApplicationButton() {
+        ?>
+
+        <form action="applicationcreation.php" method="post">
+
+            <input type="submit" value="New" class="surveyButton bigSurveyButton" />
+
+        </form>
+
+        <?php
+    }
+
+    /**
+     *
+     * @param Survey $surveys An array of surveys
+     */
+    public static function loadApplicationButton() {
+        ?>
+        <form id="loadApplicationForm" action="applicationcreation.php" method="post">
+            <input type="button" onclick="loadApplication()" value="Load / Edit" class="surveyButton bigSurveyButton" />
+        </form>
+
+
+        <?php
+    }
+
+    public static function loadApplicationList($applications) {
+        ?>
+        <select id="applicationsToLoad" class="toLoad" size="1000">
+            <?php
+            if (!empty($applications)) {
+                foreach ($applications as $application) {
+                    ?><option value='<?php echo $application->id; ?>'><?php echo $application->title; ?></option><?php
+            }
+        }
+            ?>
+        </select>
+        <?php
+    }
+
+}
+?>
Index: Dev/trunk/classes_old/ApplicationRDFReader.php
===================================================================
--- Dev/trunk/classes_old/ApplicationRDFReader.php	(revision 136)
+++ Dev/trunk/classes_old/ApplicationRDFReader.php	(revision 136)
@@ -0,0 +1,127 @@
+<?php
+
+class ApplicationRDFReader
+{
+    protected $model;
+    protected $fileName;
+
+    public function __construct()
+    {
+        $this->fileName = 'data/applications/applications.rdf';
+    
+        $this->reloadApplications();
+    }
+    
+    public function reloadApplications()
+    {
+        // Create empty MemModel   
+        $factory = new ModelFactory();
+        $this->model = $factory->getDefaultModel();
+        
+        if(file_exists($this->fileName))
+            $this->model->load($this->fileName);
+    }
+
+    public function readApplicationInfo($applicationID)
+    {        
+        $this->reloadApplications();
+        
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?title ?description ?style
+            WHERE 	
+            {
+                    _application	predicates:resource_type	resources:application ;
+                                        predicates:uid			"' . $applicationID . '"	;
+                                        predicates:title 		?title 	;
+                                        predicates:description		?description	;
+                                        predicates:style		?style
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+
+    public function readAllApplications()
+    {
+        $result = array();
+        $result[] = $this->readApplicationIDs();
+        $result[] = $this->readApplicationTitles();				
+        $result[] = $this->readApplicationDescriptions();
+        $result[] = $this->readApplicationStyles();
+
+        return $result;
+    }
+
+    public function readApplicationIDs()
+    {
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?uid
+            WHERE 	
+            {
+                    _application	predicates:resource_type	resources:application ;
+                                        predicates:uid			?uid
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+
+    public function readApplicationTitles()
+    {
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?title
+            WHERE 	
+            {
+                    _application	predicates:resource_type	resources:application ;
+                                        predicates:title 		?title 
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+
+    public function readApplicationDescriptions()
+    {
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?description
+            WHERE 	
+            {
+                    _application	predicates:resource_type	resources:application ;
+                                        predicates:description		?description	
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+
+    public function readApplicationStyles()
+    {
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?style
+            WHERE 	
+            {
+                    _application	predicates:resource_type	resources:application ;
+                                        predicates:style		?style
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+}
+
+?>
Index: Dev/trunk/classes_old/ApplicationRDFWriter.php
===================================================================
--- Dev/trunk/classes_old/ApplicationRDFWriter.php	(revision 136)
+++ Dev/trunk/classes_old/ApplicationRDFWriter.php	(revision 136)
@@ -0,0 +1,56 @@
+<?php
+
+class ApplicationRDFWriter
+{
+    protected $model;
+    protected $fileName = 'data/applications/applications.rdf';
+
+    public function __construct($applicationID)
+    {
+        // Create empty MemModel
+        $factory = new ModelFactory();
+        $this->model = $factory->getDefaultModel();
+
+        $this->applicationID = $applicationID;		
+        
+        if (!is_dir('data/applications/'))
+            mkdir('data/applications/');	
+        
+        if(file_exists($this->fileName))
+            $this->model->load($this->fileName);
+    }	
+
+    public function saveApplications()
+    {	
+        $this->model->saveAs($this->fileName,'rdf'); 
+    }
+
+    public function setApplicationInfo($aTitle, $aDescription, $aStyle)
+    {              
+        $resourceApplication = new Resource(APPLICATION.'/'.$this->applicationID);
+        //remove the old values...
+        $this->model->subtract($this->model->find($resourceApplication, null, null));        
+       
+        //...and add the new ones!
+        $resourceApplicationType = new Resource(APPLICATION);
+        $predicateRType = new Resource(RTYPE);
+        $this->model->add(new Statement($resourceApplication,$predicateRType,$resourceApplicationType));
+        $literalApplicationID = new Literal($this->applicationID);
+        $predicateUniqueID = new Resource(UID);
+        $this->model->add(new Statement($resourceApplication,$predicateUniqueID,$literalApplicationID));
+
+        $applicationTitle = new Literal($aTitle);
+        $predicateTitle = new Resource(TITLE);	
+        $this->model->add(new Statement($resourceApplication,$predicateTitle,$applicationTitle));
+
+        $applicationDescription = new Literal($aDescription);
+        $predicateDescription = new Resource(DESCRIPTION);
+        $this->model->add(new Statement($resourceApplication,$predicateDescription,$applicationDescription));
+
+        $applicationStyle = new Literal($aStyle);
+        $predicateStyle = new Resource(STYLE);
+        $this->model->add(new Statement($resourceApplication,$predicateStyle,$applicationStyle));
+    }
+}
+
+?>
Index: Dev/trunk/classes_old/DashboardCreationDatabaseInterface.php
===================================================================
--- Dev/trunk/classes_old/DashboardCreationDatabaseInterface.php	(revision 136)
+++ Dev/trunk/classes_old/DashboardCreationDatabaseInterface.php	(revision 136)
@@ -0,0 +1,65 @@
+<?php
+
+// Survey database interface class as intermediate for storing data from the site to the RDF database 
+require_once 'rdfConstants.php';
+
+// Include RAP Library to write RDF files
+include(RDFAPI_INCLUDE_DIR . "RDFAPI.php");
+
+class DashboardCreationDatabaseInterface
+{    
+    protected $dashboardRDFWriter;
+    protected $dashboardRDFReader;
+    
+    public function __construct($dashID)
+    {
+        if($dashID == null)
+            $dashboardID = md5( uniqid(rand(), true) );
+        else
+            $dashboardID = $dashID;
+        
+        $this->dashboardRDFWriter = new DashboardRDFWriter($dashboardID);
+        $this->dashboardRDFReader = new DashboardRDFReader($dashboardID);
+    }
+    
+    public function setDashboardInfo($dashboard,$user)
+    {
+        $dTitle = $dashboard['dashboardTitle'];
+        $dDescription = $dashboard['dashboardDescription'];
+        
+        $dCreatorID = $user['username'];
+        
+        $this->dashboardRDFWriter->createDashboard($dTitle, $dDescription, $dCreatorID);
+        
+        $gNumber = 1;
+        while (isset($dashboard['graphTitle'.$gNumber]))
+        {
+            if (isset($dashboard['graphID'.$gNumber]))
+                $gID = $dashboard['graphID'.$gNumber];
+            else
+                $gID = md5( uniqid(rand(), true) );
+            $gTitle = $dashboard['graphTitle'.$gNumber];
+            $gDescription = $dashboard['graphDescription'.$gNumber];
+            
+            $gTypes = array();
+            $tNumber = 1;
+            while(isset($dashboard['g'.$gNumber.'type'.$tNumber]))
+            {
+                $gTypes[] = $dashboard['g'.$gNumber.'type'.$tNumber];
+                $tNumber++;
+            }
+            $gData = array();
+            $dNumber = 1;
+            while(isset($dashboard['g'.$dNumber.'datatype'.$tNumber]) && isset($dashboard['g'.$gNumber.'dataid'.$dNumber]))
+            {
+                $dData = array();
+                $dData['type'] = $dashboard['g'.$gNumber.'datatype'.$dNumber];
+                $dData['id'] = $dashboard['g'.$gNumber.'dataid'.$dNumber];
+                $gData[] = $dData;
+                $dNumber++;
+            }
+        }
+    }
+}
+
+?>
Index: Dev/trunk/classes_old/DashboardRDFReader.php
===================================================================
--- Dev/trunk/classes_old/DashboardRDFReader.php	(revision 136)
+++ Dev/trunk/classes_old/DashboardRDFReader.php	(revision 136)
@@ -0,0 +1,151 @@
+<?php
+
+class DashboardRDFReader
+{
+    protected $model;
+
+    protected $dashboardID;
+    protected $filePath;
+
+    public function __construct($dashboardID)
+    {
+        // Create empty MemModel
+        $factory = new ModelFactory();
+        $this->model = $factory->getDefaultModel();
+
+        $this->dashboardID = $dashboardID;
+        $this->filePath = 'data/dashboards/dashboard_'.$this->dashboardID.'.rdf';
+    }
+    
+    public function loadDashboard()
+    {
+        if(file_exists($this->filePath))
+        {
+            $this->model->load($this->filePath);
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+    
+    public function getDashboardInfo()
+    {
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?uid ?title ?description ?creator
+            WHERE 	
+            {
+                    _dashboard	predicates:resource_type	resources:dashboard ;
+                                predicates:uid			?uid	;
+                                predicates:title 		?title 	;
+                                predicates:description		?description ;
+                                predicates:creator		?creator
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+    
+    public function readDashboardGraphs()
+    {
+        $result = array();
+        $result[] = $this->readSDashboardGraphsTitle();				
+        $result[] = $this->readDashboardGraphsDescription();
+
+        return $result;
+    }
+
+    public function readDashboardGraphsTitle()
+    {
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?graphTitle
+            WHERE 
+            {	
+                    _graph	predicates:resource_type	resources:graph ;
+                                predicates:title		?graphTitle 		
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+
+    public function readDashboardGraphsDescription()
+    {
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?graphDescription
+            WHERE 
+            {	
+                    _graph	predicates:resource_type	resources:graph ;
+                                predicates:description		?graphDescription 		
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+
+    public function readDashboardGraphsID()
+    {
+        $querystring = '
+            PREFIX 	predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX	resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT 	?graphID
+            WHERE 
+            {	
+                    _graph	predicates:resource_type	resources:graph ;
+                                predicates:uid			?graphID				
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+
+    public function readGraphTypes($graphID)
+    {
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?type
+            WHERE 
+            {
+                    _graph	predicates:resource_type	resources:graph ;
+                                predicates:uid			"' . $graphID . '"  ;
+                                predicates:graph_type		?type
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+    
+    public function readGraphData($graphID)
+    {
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?datatype ?dataid
+            WHERE 
+            {
+                    _graph	predicates:resource_type	resources:graph ;
+                                predicates:uid			"' . $graphID . '"  .
+                    _data       predicates:has_data             resources:data  ;
+                                predicates:data_type		?datatype   ;
+                                predicates:uid                  ?dataid
+            }';
+
+        $result = $this->model->sparqlQuery($querystring);
+
+        return $result;
+    }
+}
+?>
Index: Dev/trunk/classes_old/DashboardRDFWriter.php
===================================================================
--- Dev/trunk/classes_old/DashboardRDFWriter.php	(revision 136)
+++ Dev/trunk/classes_old/DashboardRDFWriter.php	(revision 136)
@@ -0,0 +1,95 @@
+<?php
+
+class DashboardRDFWriter 
+{
+    protected $model;
+
+    protected $resourceDashboard;
+    protected $dashboardID;
+
+    protected $filePath;
+
+    public function __construct($dashboardID)
+    {
+        // Create empty MemModel
+        $factory = new ModelFactory();
+        $this->model = $factory->getDefaultModel();
+
+        $this->dashboardID = $dashboardID;	
+        $this->filePath = 'data/dashboards/';
+        if (!is_dir($this->filePath))
+            mkdir($this->filePath);	
+    }	
+
+    public function saveDashboard()
+    {	
+        $this->model->saveAs($this->filePath.'dashboard_'.$this->dashboardID.'.rdf','rdf');
+    }
+    
+    public function createDashboard($dTitle, $dDescription, $dCreatorID)
+    {
+        $this->resourceDashboard = new Resource(DASHBOARD.'/'.$this->dashboardID);
+
+        $resourceDashboardType = new Resource(DASHBOARD);
+        $predicateRType = new Resource(RTYPE);
+        $this->model->add(new Statement($this->resourceDashboard,$predicateRType,$resourceDashboardType));
+
+        $literalDashboardID = new Literal($this->dashboardID);
+        $predicateUniqueID = new Resource(UID);
+        $this->model->add(new Statement($this->resourceDashboard,$predicateUniqueID,$literalDashboardID));
+
+        $predicateTitle = new Resource(TITLE);		
+        $dashboardTitle = new Literal($dTitle);
+        $this->model->add(new Statement($this->resourceDashboard,$predicateTitle,$dashboardTitle));		
+
+        $predicateDescription = new Resource(DESCRIPTION);
+        $dashboardDescription = new Literal($dDescription);
+        $this->model->add(new Statement($this->resourceDashboard,$predicateDescription,$dashboardDescription));
+        
+        $predicateCreator = new Resource(CREATOR);
+        $userID = new Literal($dCreatorID);
+        $this->model->add(new Statement($this->resourceDashboard,$predicateCreator,$userID));
+    }
+    
+    public function addGraph($gID,$gTitle,$gDescription,$gTypes,$gData)
+    {
+        $resourceGraph = new Resource(GRAPH);
+        
+        $predicateTitle = new Resource(TITLE);		
+        $graphTitle = new Literal($gTitle);
+        $this->model->add(new Statement($resourceGraph,$predicateTitle,$graphTitle));		
+
+        $predicateDescription = new Resource(DESCRIPTION);
+        $graphDescription = new Literal($gDescription);
+        $this->model->add(new Statement($resourceGraph,$predicateDescription,$graphDescription));
+        
+        $predicateUniqueID = new Resource(UID);
+        $graphID = new Literal($gID);
+        $this->model->add(new Statement($resourceQuestion,$predicateUniqueID,$graphID));
+        
+        $predicateGraphType = new Resource(GRAPH_TYPE);
+        foreach($gTypes as $gType)
+        {
+            $graphType = new Literal($gType);
+            $this->model->add(new Statement($resourceGraph,$predicateGraphType,$gType));
+        }
+        
+        $predicateData = new Resource(HAS_DATA);
+        foreach($gData as $gThis)
+        {
+            $resourceData = new Resource(DATA);
+            $this->model->add(new Statement($resourceGraph,$predicateData,$resourceData));
+            
+            $dataType = new Literal($gThis['type']);
+            $predicateDataType = new Resource(DATA_TYPE);
+            $this->model->add(new Statement($resourceData,$predicateDataType,$dataType));
+            
+            $dataID = new Literal($gThis['id']);
+            $this->model->add(new Statement($resourceData,$predicateUniqueID,$dataID));            
+        }
+        
+        $predicateHasGraph = new Resource(HAS_GRAPH);
+        $this->model->add(new Statement($this->resourceDashboard,$predicateHasGraph,$resourceGraph));
+    }
+}
+?>
Index: Dev/trunk/classes_old/DashboardTool.php
===================================================================
--- Dev/trunk/classes_old/DashboardTool.php	(revision 136)
+++ Dev/trunk/classes_old/DashboardTool.php	(revision 136)
@@ -0,0 +1,98 @@
+<?php
+
+/**
+ * Description of DashboardTool
+ *
+ * @author Frans
+ */
+class DashboardTool {
+
+    private $surveys;
+    private $gamedata;
+
+    public function __construct($surveys, $gamedata = null) {
+        $this->surveys = $surveys;
+        $this->gamedata = $gamedata;
+
+        $this->init();
+    }
+
+    private function init() {
+        $this->visualizeSurvey();
+    }
+
+    private function visualizeSurvey() {
+        foreach ($this->surveys as $survey) {
+            $surveyResults = $survey->results;
+
+            /* iterate at the same time through these arrays */
+            $questions = $survey->questions;
+            $questionResults = $surveyResults->getQuestionResults();
+            ?>
+            <div class="resultsDiv borderRadius padding1em">
+                <?php
+                $i = 0;
+                while (isset($questions[$i])) {
+                    ?><div class="resultDiv"><?php        
+                    $this->displayQuestion($questions[$i]);
+                    $this->visualizeResult($questionResults[$i]);
+                    ?></div><?php
+                    
+                    $i++;
+                }
+                ?>
+            </div>
+                <?php
+            }
+        }
+
+        private function visualizeResult($questionResult) {
+            
+        $this->displayVisualization($questionResult);
+        $this->displayChangeVisualizationBar();
+            
+    }
+
+    private function displayQuestion($question) {
+        echo $question->title;
+        echo "<br />";
+        echo $question->description;
+    }
+
+    private function displayVisualization($questionResult) {
+        $type = $questionResult->getType();
+        
+        switch ($type) {
+            case 0:
+                $value = "TEXT";
+
+                break;
+            case 1:
+                $value = "INTEGER";
+                break;
+            case 2:
+                $value = "MULT. CHOICE";
+                break;
+            case 3:
+                $value = "CHECKBOXES";
+                break;
+            case 4:
+                $value = "SCALE";
+                break;
+            default:
+                break;
+        }
+        echo $value;
+        
+        foreach($questionResult->answers as $answer)
+        {
+            echo "<br />" . $answer;
+        }
+    }
+
+    private function displayChangeVisualizationBar() {
+        
+    }
+
+}
+    ?>
Index: Dev/trunk/classes_old/Loader.php
===================================================================
--- Dev/trunk/classes_old/Loader.php	(revision 136)
+++ Dev/trunk/classes_old/Loader.php	(revision 136)
@@ -0,0 +1,73 @@
+<?php
+
+/**
+ * Helper class to load arrays of objects from the database.
+ *
+ * @author fpvanagthoven
+ */
+class Loader {
+
+    public static function load($info, $classname) {
+        $theArray = array();
+        
+        foreach ($info as $id => $title)
+        {
+            $object = new $classname($id, $title);
+            array_push($theArray, $object);
+        }
+        
+        return $theArray;
+    }
+
+    /**
+     *
+     * @return array Array of Surveys with id and title
+     */
+    public static function loadSurveys() {
+    
+        $surveyDBI = new SurveyCreationDatabaseInterface(null);
+        $surveyIDTitles = $surveyDBI->getExistingSurveys();
+
+        return Loader::load($surveyIDTitles, "Survey");
+    }
+
+    public static function loadApplications() {
+        $applicationDBI = new ApplicationDatabaseInterface(null);
+        $applicationTitles = $applicationDBI->getExistingApplications();
+
+        return Loader::load($applicationTitles, "Application");
+    }
+
+    public static function loadSessions() {
+        $sessionDBI = new SessionCreationDatabaseInterface(null);
+        $sessionTitles = $sessionDBI->getExistingSessions();
+
+        return Loader::load($sessionTitles, "Session");
+    }
+
+    public static function loadQuestions() {
+        $questionDBI = new QuestionCreationDatabaseInterface();
+        $questionCodesAndTitles = $questionDBI->getExistingQuestions();
+
+        return Loader::load($questionCodesAndTitles, "Question");
+    }
+    
+    public static function loadFullQuestions() {
+        $questionDBI = new QuestionCreationDatabaseInterface();
+        $questionCodesAndTitles = $questionDBI->getExistingQuestions();
+        
+        $questions = array();
+        
+        foreach ($questionCodesAndTitles as $code => $title) {
+            $info = $questionDBI->getQuestionInfo($code);
+            $question = Question::getQuestion($code, $info);
+            
+            array_push($questions, $question);
+        }
+        
+        return $questions;
+    }
+
+}
+
+?>
Index: Dev/trunk/classes_old/Logo.php
===================================================================
--- Dev/trunk/classes_old/Logo.php	(revision 136)
+++ Dev/trunk/classes_old/Logo.php	(revision 136)
@@ -0,0 +1,21 @@
+<?php
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of Logo
+ *
+ * @author fpvanagthoven
+ */
+class Logo {
+
+    public function __construct() {
+        ?>
+        <div id="logo"><a href="index.php">CPSFacilitator Tool</a></div>
+        <?php
+    }
+
+}
+?>
Index: Dev/trunk/classes_old/master.php
===================================================================
--- Dev/trunk/classes_old/master.php	(revision 136)
+++ Dev/trunk/classes_old/master.php	(revision 136)
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * Description of master
+ * 
+ * For autoloading of classes for example.
+ *
+ * @author fpvanagthoven
+ */
+// Determine our absolute document root
+define('DOC_ROOT', realpath(dirname(__FILE__) . '/../'));
+
+/* Session */
+session_name("cpsft");   // Set a session name
+session_start();  // Start the session
+
+
+
+function __autoload($class_name) {
+    require 'classes/' . $class_name . '.php';
+}
+
+
+// Redirects user to $url
+function redirect($url = null)
+{
+	if (is_null($url))
+		$url = $_SERVER['PHP_SELF'];
+
+	header("Location: $url");
+	exit();
+}
