Index: /Dev/trunk/classes/ApplicationRDFWriter.php
===================================================================
--- /Dev/trunk/classes/ApplicationRDFWriter.php	(revision 99)
+++ /Dev/trunk/classes/ApplicationRDFWriter.php	(revision 100)
@@ -24,11 +24,13 @@
 
     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);
@@ -37,9 +39,9 @@
         $applicationTitle = new Literal($aTitle);
         $predicateTitle = new Resource(TITLE);	
-        $this->model->add(new Statement($resourceApplication,$predicateTitle,$applicationTitle));		
+        $this->model->add(new Statement($resourceApplication,$predicateTitle,$applicationTitle));
 
         $applicationDescription = new Literal($aDescription);
         $predicateDescription = new Resource(DESCRIPTION);
-        $this->model->add(new Statement($resourceApplication,$predicateDescription,$applicationDescription));		
+        $this->model->add(new Statement($resourceApplication,$predicateDescription,$applicationDescription));
 
         $applicationStyle = new Literal($aStyle);
Index: /Dev/trunk/classes/DashboardCreationDatabaseInterface.php
===================================================================
--- /Dev/trunk/classes/DashboardCreationDatabaseInterface.php	(revision 99)
+++ /Dev/trunk/classes/DashboardCreationDatabaseInterface.php	(revision 100)
@@ -9,7 +9,45 @@
 class DashboardCreationDatabaseInterface
 {    
-    public function __construct()
+    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]))
+            {
+                
+            }
+            
+        }
     }
 }
Index: /Dev/trunk/classes/DashboardRDFReader.php
===================================================================
--- /Dev/trunk/classes/DashboardRDFReader.php	(revision 99)
+++ /Dev/trunk/classes/DashboardRDFReader.php	(revision 100)
@@ -33,5 +33,118 @@
     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/DashboardRDFWriter.php
===================================================================
--- /Dev/trunk/classes/DashboardRDFWriter.php	(revision 99)
+++ /Dev/trunk/classes/DashboardRDFWriter.php	(revision 100)
@@ -1,5 +1,5 @@
 <?php
 
-class SurveyRDFWriter 
+class DashboardRDFWriter 
 {
     protected $model;
@@ -27,5 +27,5 @@
     }
     
-    public function createDashboard($dTitle, $dDescription,$dRespondentGroup)
+    public function createDashboard($dTitle, $dDescription, $dCreatorID)
     {
         $this->resourceDashboard = new Resource(DASHBOARD.'/'.$this->dashboardID);
@@ -46,7 +46,11 @@
         $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($gTitle,$gDescription,$gTypes,$gData)
+    public function addGraph($gID,$gTitle,$gDescription,$gTypes,$gData)
     {
         $resourceGraph = new Resource(GRAPH);
@@ -60,4 +64,8 @@
         $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)
@@ -67,9 +75,16 @@
         }
         
-        $predicateData = new Resource(DATA);
+        $predicateData = new Resource(HAS_DATA);
         foreach($gData as $gThis)
         {
-            $graphData = new Literal($gThis);
-            $this->model->add(new Statement($resourceGraph,$predicateData,$graphData));
+            $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));            
         }
         
Index: /Dev/trunk/rdfConstants.php
===================================================================
--- /Dev/trunk/rdfConstants.php	(revision 99)
+++ /Dev/trunk/rdfConstants.php	(revision 100)
@@ -17,4 +17,6 @@
 define('DASHBOARD',SURVEYTOOL_RESOURCES_NAMESPACE . 'dashboard');
 define('GRAPH',SURVEYTOOL_RESOURCES_NAMESPACE . 'graph');
+define('DATA',SURVEYTOOL_RESOURCES_NAMESPACE . 'data');
+define('APPDATA',SURVEYTOOL_RESOURCES_NAMESPACE . 'graph');
 
 // Predicates used for RDF triples
@@ -39,5 +41,6 @@
 define('INDEX',SURVEYTOOL_PREDICATES_NAMESPACE . 'index');
 define('GRAPH_TYPE',SURVEYTOOL_PREDICATES_NAMESPACE . 'graph_type');
-define('DATA',SURVEYTOOL_PREDICATES_NAMESPACE . 'data');
+define('HAS_DATA',SURVEYTOOL_PREDICATES_NAMESPACE . 'has_data');
+define('DATA_TYPE',SURVEYTOOL_PREDICATES_NAMESPACE . 'data_type');
 
 ?>
