Index: Dev/branches/Cartis/Aapje.php
===================================================================
--- Dev/branches/Cartis/Aapje.php	(revision 207)
+++ Dev/branches/Cartis/Aapje.php	(revision 207)
@@ -0,0 +1,155 @@
+<?php
+require 'classes/master.php'; //should be at top of every page
+
+if (!isset($_SESSION['userUid'])) {
+    redirect("index.php");
+}
+
+if (isset($_SESSION['message'])) {
+    echo $_SESSION['message'];
+    unset($_SESSION['message']);
+}
+
+$dbi = new DatabaseInterface();
+
+$sessions = $dbi->get("Session", array());
+
+$questions = $dbi->get("question");
+?>
+<!-- Javascript multiple selection-->   
+<script language="JavaScript" type="text/javascript">
+
+    var infoTimer = null;
+    
+    function loopSelected()
+    {
+        var txtSelectedValuesObj = document.getElementById('txtSelectedValues');
+        var selectedArray = new Array();
+        var selObj = document.getElementById('selSeaShells');
+        var count = 0;
+        for (var i=0; i<selObj.options.length; i++) {
+            if (selObj.options[i].selected) {
+                selectedArray[count] = selObj.options[i].value;
+                count++;
+            }
+        }
+        
+        txtSelectedValuesObj.value = selectedArray;
+    }
+    function openInNewWindow(frm)
+    {
+        // open a blank window
+        var aWindow = window.open('', 'NewWindow',
+        'scrollbars=yes,menubar=no,resizable=no, location=yes, toolbar=no, fullscreen=yes');
+  
+        // set the target to the blank window
+        frm.target = 'NewWindow';
+  
+        // submit
+        frm.submit();
+    }
+    
+    function clickForInfoS(uid) {
+        // Start delay
+        // After delay, call AJAX
+        // Update Info Panel
+        if (infoTimer) {
+            window.clearTimeout(infoTimer);
+        }
+        
+        infoTimer = window.setTimeout(ajaxInfoRequest, 500, uid, ge('iPanel'), "Session");
+    }
+    
+    function clickForInfoQ(uid) {
+        // Start delay
+        // After delay, call AJAX
+        // Update Info Panel
+        if (infoTimer) {
+            window.clearTimeout(infoTimer);
+        }
+        
+        infoTimer = window.setTimeout(ajaxInfoRequest, 500, uid, ge('iPanel'), "Question");
+    }
+</script>
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+        <title>Data selection</title>
+        <script type="text/javascript" src="js/sequencerScripts.js"></script>
+        <script type="text/javascript" src="js/generalScripts.js"></script>
+
+        <?php
+        new StyleSheet("visualeditors");
+        ?>
+
+    </head>
+
+    <body>
+        <div id="header">
+            <?php new Logo(); ?>
+        </div>
+
+        <div id="content">
+            <a href="selectSession.php">Ga naar de selectSession</a>
+        </div>      
+        
+        
+        <div class=largeFrame C" id="sessionResultList">
+            <div class="largeTitle">Sessions</div>
+            <div class="checkboxList">
+                <?php
+                foreach ($sessions as $session) {
+                    // First checkbox, then descriptor
+                    echo "<input type='checkbox' id='" . $session->uid . "' style='margin-right: 10px;' />";
+                    echo "<label for='" . $session->uid . "' onClick='clickForInfoS(this.id);'>" . $session->title . "</label><br />";
+                }
+                ?>
+            </div>
+            <div class="controls">
+                <input type="button" value="Select data" class="smallButton" onclick="loopSelected();" />
+               // <input type="button" value="Submit" class="smallButton" onclick="openInNewWindow(this.form);" />
+            </div>
+        </div>
+
+        
+        <div class="largeFrame C" id="gamedataResultList">
+            <div class="largeTitle">Game Data</div>
+            <div class="checkboxList">
+                <?php
+                $questions = $dbi->get("Question", array());
+                foreach ($questions as $question) {
+                    // First checkbox, then descriptor
+                    echo "<input type='checkbox' id='" . $question->uid . "' style='margin-right: 10px;' />";
+                    echo "<label for='" . $question->uid . "' onClick='clickForInfoQ(this.id);'>" . $question->title . "</label><br />";
+                }
+                ?>
+            </div>
+            <div class="controls">
+                <input type="button" value="Select data" class="smallButton" onclick="loopSelected();" />
+                <input type="button" value="Submit" class="smallButton" onclick="openInNewWindow(this.form);" />
+            </div>
+        </div>
+
+        
+        
+        
+        
+        
+        
+        <div class="largeFrame C">
+            <a href="Dprobeersel.php">
+                <img src="images/icons/dashboard2.png" width="245" height="140"></img>
+            </a>
+        </div>  
+
+        <div class="largeFrame Cu" id="iPanel">
+            INFOPANEL
+        </div>
+    </body>       
+</html>
+
+
+
+
Index: Dev/branches/Cartis/DProbeersel.php
===================================================================
--- Dev/branches/Cartis/DProbeersel.php	(revision 207)
+++ Dev/branches/Cartis/DProbeersel.php	(revision 207)
@@ -0,0 +1,107 @@
+    <?php
+require 'classes/master.php'; //should be at top of every page
+
+if (!isset($_SESSION['userUid'])) {
+    redirect("index.php");
+}
+
+if (isset($_SESSION['message'])) {
+    echo $_SESSION['message'];
+    unset($_SESSION['message']);
+}
+
+$dbi = new DatabaseInterface();
+$data = JSON_decode($_POST['selectedData']);
+
+new StyleSheet("visualEditors");
+
+?>
+
+<html>
+    <head>
+
+    <!-- 1/3. Include the RGraph libraries -->
+    <script src="RGraph/libraries/RGraph.common.core.js" ></script> 
+    <script src="RGraph/libraries/RGraph.common.context.js" ></script> 
+    <script src="RGraph/libraries/RGraph.common.annotate.js" ></script> 
+    <script src="RGraph/libraries/RGraph.common.tooltips.js" ></script> 
+    <script src="RGraph/libraries/RGraph.common.zoom.js" ></script> 
+    <script src="RGraph/libraries/RGraph.radar.js" ></script>   
+    
+   <script> 
+        window.onload = function ()
+        {
+            if (RGraph.isIE8()) {
+                ShowGraph1();
+                ShowGraph2();
+                ShowGraph3();
+            }
+        }
+        
+        function ShowGraph1 ()
+        {
+            var radar1 = new RGraph.Radar('radar5', [43,84,54,64,34,21,21], [52,30,51,41,22,23,56]);
+            radar1.Set('chart.colors', ['rgba(255,0,0,0.3)']);
+            radar1.Set('chart.labels.axes', 'n');
+            radar1.Set('chart.circle', 50);
+            radar1.Set('chart.circle.fill', 'rgba(0, 0, 255, 0.3)');
+            radar1.Set('chart.tooltips', [
+                                           'Dave (43)', 'John (84)', 'Kiffen (54)', 'Peter (64)', 'Lou (34)', 'Igor (21)', 'John (21)',
+                                           'Dave (52)', 'John (30)', 'Kiffen (51)', 'Peter (41)', 'Lou (22)', 'Igor (23)', 'John (56)',
+                                          ]);
+            radar1.Set('chart.colors', ['green', 'red']);
+            radar1.Set('chart.colors.alpha', 0.5);
+            //radar1.Set('chart.title', 'The results of the competition');
+            radar1.Set('chart.labels', ['Dave (43)', 'John (84)', 'Kiffen (54)', 'Peter (64)', 'Lou (34)', 'Igor (21)', 'John (21)']);
+            radar1.Set('chart.tooltips.effect', 'fade');
+            radar1.Draw();
+        }
+        
+        function ShowGraph2 ()
+        {
+            var radar = new RGraph.Radar('radar2', [7,6,6,7,8], [6,7,7,6,6], [4,5,6,10,4]);
+            radar.Set('chart.strokestyle', 'black');
+            radar.Set('chart.colors.alpha', 0.3);
+            radar.Set('chart.colors', ['red', 'green', 'yellow']);
+            //radar.Set('chart.title', 'Multiple datasets, key');
+            radar.Set('chart.tooltips.effect', 'snap');
+            radar.Set('chart.tooltips', [
+                                          'Pete in 2000','Lou in 2000','Jim in 2000','Jack in 2000','Fred in 2000',
+                                          'Pete in 2001','Lou in 2001','Jim in 2001','Jack in 2001','Fred in 2001',
+                                          'Pete in 2002','Lou in 2002','Jim in 2002','Jack in 2002','Fred in 2002'
+                                         ]);
+            radar.Set('chart.key', ['2000','2001','2002']);
+            radar.Set('chart.key.position', 'graph');
+            radar.Set('chart.labels', ['Pete','Lou','Jim','Jack','Fred']);
+            radar.Set('chart.gutter.top', 35);
+            radar.Draw();
+        }
+    </script> 
+ 
+</head> 
+  
+<body>
+    
+    <!-- 2/3. This is the canvas that the graph is drawn on -->
+    <div class="largeFrame">
+                <canvas id="radar5" width="450" height="300">[No canvas support]</canvas>
+                <canvas id="radar2" width="450" height="300">[No canvas support]</canvas> 
+    </div>
+      
+        <script> 
+        if (!RGraph.isIE8()) {
+            ShowGraph1();
+            ShowGraph2();
+        }
+    </script> 
+    
+    
+    <div class="smallFrame" id="dataField">
+        <?php              
+       var_dump($data);
+        ?>
+    </div>
+    
+</body>
+
+</html>
Index: Dev/branches/Cartis/classes/Connector.php
===================================================================
--- Dev/branches/Cartis/classes/Connector.php	(revision 206)
+++ Dev/branches/Cartis/classes/Connector.php	(revision 207)
@@ -66,11 +66,15 @@
 				case "password" : $addition = "predicates:password '" . $arguments[$key] . "'\n"; break;
 				case "creator" : $addition = "predicates:creator '" . $arguments[$key] . "'\n"; break;
-				case "datetime" : $addition = "predicates:datetime '" . $arguments[$key] . "'\n"; break;
+				case "creationdate" : $addition = "predicates:creationdate '" . $arguments[$key] . "'\n"; break;
 				case "applications" : foreach($arguments[$key] as $application) { $addition = $addition . "predicates:has_application '" . $application . "'\n"; } break;
-
 				case "surveys" : foreach($arguments[$key] as $survey) { $addition = $addition . "predicates:has_survey '" . $survey . "'\n"; } break;
 				case "answersets" : foreach($arguments[$key] as $answerset) { $addition = $addition . "predicates:has_answerset '" . $answerset . "'\n"; } break;
 				case "questions" : foreach($arguments[$key] as $question) { $addition = $addition . "predicates:has_question '" . $question . "'\n"; } break;
-
+				case "location" : $addition = "predicates:location '" . $arguments[$key] . "\n"; break;
+				case "facilitator" : $addition = "predicates:facilitator '" . $arguments[$key] . "\n"; break;
+				case "starttime" : $addition = "predicates:starttime '" . $arguments[$key] . "\n"; break;
+				case "endtime" : $addition = "predicates:endtime '" . $arguments[$key] . "\n"; break;
+				case "session" : $addition = "predicates:of_session '" . $arguments[$key] . "\n"; break;
+				case "resultset" : $addition = "predciates:has_resultset '" . $arguments[$key] . "\n"; break;
 			}
 			$argumentString = $argumentString . $addition;
Index: Dev/branches/Cartis/classes/DatabaseInterface.php
===================================================================
--- Dev/branches/Cartis/classes/DatabaseInterface.php	(revision 206)
+++ Dev/branches/Cartis/classes/DatabaseInterface.php	(revision 207)
@@ -25,4 +25,5 @@
 	private $answerSetConnector;
 	private $sessionConnector;
+	private $sessionInstanceConnector;
     
     /**
@@ -39,4 +40,5 @@
 		$this->answerSetConnector = new AnswerSetConnector();
 		$this->sessionConnector = new SessionConnector();
+		$this->sessionInstanceConnector = new SessionInstanceConnector();
     }
     
@@ -75,4 +77,7 @@
 				return $this->sessionConnector->get($arguments);
 				break;
+			case "sessioninstance":
+				return $this->sessionInstanceConnector->get($arguments);
+				break;
         }
     }
@@ -87,26 +92,29 @@
         {
             case "Application":
-                $this->applicationConnector->set($rToolObject);
+                return $this->applicationConnector->set($rToolObject);
                 break;
             case "Question":
-                $this->questionConnector->set($rToolObject);
+                return $this->questionConnector->set($rToolObject);
                 break;
             case "User":
-                $this->userConnector->set($rToolObject);
+                return $this->userConnector->set($rToolObject);
                 break;
             case "Survey":
-				$this->surveyConnector->set($rToolObject);
+				return $this->surveyConnector->set($rToolObject);
 				break;
             case "Respondent":
-				$this->respondentConnector->set($rToolObject);
+				return $this->respondentConnector->set($rToolObject);
 				break;
             case "Answer":
-				$this->answerConnector->set($rToolObject);
+				return $this->answerConnector->set($rToolObject);
 				break;
 			case "AnswerSet":
-				$this->answerSetConnector->set($rToolObject);
+				return $this->answerSetConnector->set($rToolObject);
 				break;
 			case "Session":
-				$this->sessionConnector->set($rToolObject);
+				return $this->sessionConnector->set($rToolObject);
+				break;
+			case "SessionInstance":
+				return $this->sessionInstanceConnector->set($rToolObject);
 				break;
         }
@@ -122,6 +130,8 @@
         foreach ($rToolObjects as $rToolObject)
         {
-            $this->set($rToolObject);
-        }
+			if(!$this->set($rToolObject))
+				return false;
+		}
+		return true;
     }
 
Index: Dev/branches/Cartis/classes/Session.php
===================================================================
--- Dev/branches/Cartis/classes/Session.php	(revision 206)
+++ Dev/branches/Cartis/classes/Session.php	(revision 207)
@@ -10,7 +10,6 @@
 	public $title;
 	public $creator;
-	public $datetime;
+	public $creationdate;
 	public $pipeline;
-	public $answersets;
 
 	
@@ -23,5 +22,5 @@
 	 * @param type $pipeline
 	 */
-	public function __construct($uid = null, $title = null, $creator = null, $datetime = null, $pipeline = null, $answersets = null)
+	public function __construct($uid = null, $title = null, $creator = null, $datetime = null, $pipeline = null)
 	{
 		if(!isset($uid))
@@ -32,7 +31,6 @@
 		$this->title = $title;
 		$this->creator = $creator;
-		$this->datetime = $datetime;
+		$this->creationdate = $datetime;
 		$this->pipeline = $pipeline;
-		$this->answersets = $answersets;
 	}
 
@@ -67,16 +65,4 @@
 			$this->pipeline = $newPipeline;
 		}
-		if(!empty($this->answersets) && is_string($this->answersets[0]))
-		{
-			$newAnswerSets = array();
-			foreach($this->answersets as $element)
-			{
-				$result = $dbi->get("answerset", array("uid" => $element));
-				if(!isset($result[0]))
-					return false;
-				$newAnswerSets[] = $result[0];
-			}
-			$this->answersets = $newAnswerSets;
-		}
 		return true;
 	}
@@ -90,4 +76,5 @@
 	 * are written to the file whilst the others get lost.
 	 */
+	//DO NOT USE - BROKEN AS OF 23/12/2011
 	public function toSPSS($location)
 	{
Index: Dev/branches/Cartis/classes/SessionConnector.php
===================================================================
--- Dev/branches/Cartis/classes/SessionConnector.php	(revision 206)
+++ Dev/branches/Cartis/classes/SessionConnector.php	(revision 207)
@@ -28,5 +28,5 @@
 	 * function get()
 	 * @param type $arguments : An array containing one or more of the following elements:
-	 * 'uid', 'title', 'datetime', 'applications', 'surveys', 'answersets'
+	 * 'uid', 'title', 'creationdate', 'applications', 'surveys'
 	 */
 	public function get($arguments)
@@ -38,5 +38,5 @@
 			PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
 			PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-			SELECT DISTINCT ?uid, ?title, ?creator, ?datetime
+			SELECT DISTINCT ?uid, ?title, ?creator, ?creationdate
 			WHERE
 			{
@@ -45,5 +45,5 @@
 				predicates:title ?title ;
 				predicates:creator ?creator ;
-				predicates:datetime ?datetime ;
+				predicates:creationdate ?creationdate ;
 				' . $this->createArguments($arguments) . '
 			}';
@@ -58,9 +58,8 @@
 				//Create a session object out of every result, get all required fields as well.
 				$pipeline = $this->getPipeline($result['?uid']->label);
-				$answersets = $this->getAnswerSets($result['?uid']->label);
 				$creator = $result['?creator']->label;
-				$datetime = new DateTime();
-				$datetime->setTimestamp(intval($result['?datetime']->label));
-				$sessions[] = new Session($result['?uid']->label, $result['?title']->label, $creator, $datetime, $pipeline, $answersets);
+				$creationdate = new DateTime();
+				$creationdate->setTimestamp(intval($result['?creationdate']->label));
+				$sessions[] = new Session($result['?uid']->label, $result['?title']->label, $creator, $creationdate, $pipeline);
 			}
 		}
@@ -135,7 +134,7 @@
 		$this->model->add(new Statement($resourceSession, $predicateCreator, $sessionCreator));
 
-		$sessionTimestamp = new Literal($rToolObject->datetime->getTimestamp());
+		$sessionTimestamp = new Literal($rToolObject->creationdate->getTimestamp());
         //      $sessionTimestamp = new Literal($rToolObject->datetime);    // Edit of above function, allows for creation of session, but still results in errors...
-        $predicateTimestamp = new Resource(DATETIME);
+        $predicateTimestamp = new Resource(CREATIONDATE);
 		$this->model->add(new Statement($resourceSession, $predicateTimestamp, $sessionTimestamp));
 
Index: Dev/branches/Cartis/classes/SessionInstance.php
===================================================================
--- Dev/branches/Cartis/classes/SessionInstance.php	(revision 207)
+++ Dev/branches/Cartis/classes/SessionInstance.php	(revision 207)
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Description of SessionInstance
+ *
+ * @author jkraaijeveld
+ */
+
+class SessionInstance extends ResearchToolObject
+{
+	public $title;
+	public $location;
+	public $facilitator;
+	public $starttime;
+	public $endtime;
+	public $notes;
+	public $session;
+	public $resultset;
+
+	/**
+	 * Constructor for a SessionInstance object
+	 * @param type $uid
+	 * @param type $title
+	 * @param type $location
+	 * @param type $facilitator
+	 * @param type $starttime
+	 * @param type $endtime
+	 * @param type $notes
+	 * @param type $session
+	 * @param type $resultset
+	 */
+	public function __construct($uid = null, $title = null, $location = null, $facilitator = null, $starttime = null, $endtime = null, $notes = null, $session = null, $resultset = null)
+	{
+		if(!isset($uid))
+		{
+			$uid = md5(uniqid(rand(), true));
+		}
+		$this->uid = $uid;
+		$this->title = $title;
+		$this->location = $location;
+		$this->facilitator = $facilitator;
+		$this->starttime = $starttime;
+		$this->endtime = $endtime;
+		$this->notes = $notes;
+		$this->session = $session;
+		$this->resultset = $resultset;
+	}
+
+	/*
+	 * function evaluate()
+	 * Evaluates all the references of this object.
+	 */
+	public function evaluate()
+	{
+		$dbi = new DatabaseInterface();
+		if(is_string($this->facilitator))
+		{
+			$result = $dbi->get("user", array("uid" => $this->facilitator));
+			if(!isset($result[0]))
+				return false;
+			$this->facilitator = $result[0];
+		}
+
+		if(is_string($this->session))
+		{
+			$result = $dbi->get("session", array("uid" => $this->session));
+			if(!isset($result[0]))
+				return false;
+			$this->session = $result[0]; 
+		}
+
+		if(is_string($this->resultset))
+		{
+			$result = $dbi->get("resultset", array("uid" => $this->resultset));
+			if(!isset($result[0]))
+				return true;
+			$newResultSets[] = $result[0];
+		}
+		return true;
+	}
+			
+
+}
Index: Dev/branches/Cartis/classes/SessionInstanceConnector.php
===================================================================
--- Dev/branches/Cartis/classes/SessionInstanceConnector.php	(revision 207)
+++ Dev/branches/Cartis/classes/SessionInstanceConnector.php	(revision 207)
@@ -0,0 +1,182 @@
+<?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");
+
+/**
+ * Description of SessionInstanceConnector
+ *
+ * @author jkraaijeveld
+ */
+class SessionInstanceConnector extends Connector  
+{
+	protected $db;
+
+	/**
+	 * Constructor for the SessionInstanceConnector.
+	 */
+
+	public function __construct()
+	{
+		$this->fileName = 'data/sessions/sessioninstances.rdf';
+		//Ensure the required folder for this connector exists.
+		if(!is_dir('data/sessions'))
+			mkdir('data/sessions');
+	}
+
+	/**
+	 * function get()
+	 * @param type $arguments : An array containing one or more of the following elements:
+	 * 'uid', 'title', 'location', 'facilitator', 'starttime', 'endtime' 'notes', 'session', 'resultset'
+	 */
+	public function get($arguments)
+	{
+		$this->load();
+
+		//Build the query string
+		$querystring = '
+			PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+			PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+			SELECT DISTINCT ?uid, ?title, ?location, ?facilitator, ?starttime, ?endtime, ?of_session, ?has_resultset 
+			WHERE
+			{
+				_sessioninstance predicates:resource_type resources:sessioninstance ;
+				predicates:uid ?uid ;
+				predicates:title ?title ;
+				predicates:location ?location ;
+				predicates:facilitator ?facilitator ;
+				predicates:starttime ?starttime ;
+				predicates:endtime ?endtime ;
+				predicates:of_session ?of_session ;
+				' . $this->createArguments($arguments) . '
+	}';
+		//Query the model
+		$results = $this->model->sparqlQuery($querystring);
+		$sessioninstances = array();
+		if(!empty($results))
+		{	
+			$this->db = new DatabaseInterface();
+			foreach($results as $result)
+			{
+				//Create a SessionInstance object out of every result. Get all the required fields as well.
+				$notes = $this->getNotes($result['?uid']->label);
+				$resultset = $this->getResultSet($result['?uid']->label);
+				$starttime = new DateTime();
+				$starttime->setTimestamp(intval($result['?starttime']->label));
+				$endtime = new DateTime();
+				$endtime->setTimestamp(intval($result['?endtime']->label));
+				$sessioninstances[] = new SessionInstance(  
+					$result['?uid']->label,
+					$result['?title']->label,
+					$result['?location']->label,
+					$result['?facilitator']->label,
+					$starttime,
+					$endtime,
+					$notes,
+					$result['?of_session'],
+					$resultset
+				);
+			}
+		}
+		return $sessioninstances;
+	}
+	
+	/**
+	 * function getNotes()
+	 * param type $uid : The SessionInstance uid for which the notes should be retrieved.
+	 */
+	public function getNotes($uid)
+	{
+		$result = $this->model->findRegex("[(".$uid.")]", "[(has_note)]", null);
+		$iterator = $result->getStatementIterator();
+		$notes = array();
+		while($iterator->hasNext())
+		{
+			$element = $iterator->next();
+			$notes[] = $element->getLabelObject();
+		}
+		return $notes;
+	}
+
+	/**
+	 * function getResultSet($uid)
+	 * param type $uid : The SessionInstance uid for which the ResultSet should be gotten.
+	 */
+	public function getResultSet($udi)
+	{
+		//TODO: Implement when ResultSet is in.
+		return null;
+	}
+
+	/**
+	 * function set()
+	 * @param type $rToolObject: The ResearchToolObject to be saved.
+	 */
+	public function set($rToolObject)
+	{
+		$this->load();
+		//If evaluation fails, some references are incorrect.
+		//We shouldn't save in this case. Instead - let the user know. This function returns false if the evaluation has failed.
+		//TODO: Decide how to fix invalid references graciously.
+		if(!$rToolObject->evaluate()) 
+			return false;
+		$resourceSInstance = new Resource(SESSIONINSTANCE . '/' . $rToolObject->uid);
+		//Remove the old value stored with the given id
+		$this->model->subtract($this->model->find($resourceSInstance, null, null));
+
+		//Set the new values
+		$resourceSInstanceType = new Resource(SESSIONINSTANCE);
+		$predicateType = new Resource(RTYPE);
+		$this->model->add(new Statement($resourceSInstance, $predicateType, $resourceSInstanceType));
+
+		$sInstanceId = new Literal($rToolObject->uid);
+		$predicateId = new Resource(UID);
+		$this->model->add(new Statement($resourceSInstance, $predicateId, $sInstanceId));
+
+		$sInstanceTitle = new Literal($rToolObject->title);
+		$predicateTitle = new Resource(TITLE);
+		$this->model->add(new Statement($resourceSInstance, $predicateTitle, $sInstanceTitle));
+
+		$sInstanceLocation = new Literal($rToolObject->location);
+		$predicateLocation = new Resource(LOCATION);
+		$this->model->add(new Statement($resourceSInstance, $predicateLocation, $sInstanceLocation));
+
+		$sInstanceFacilitator = new Literal($rToolObject->facilitator->uid);
+		$predicateFacilitator = new Resource(FACILITATOR);
+		$this->model->add(new Statement($resourceSInstance, $predicateFacilitator, $sInstanceFacilitator));
+
+		$sInstanceStartTime = new Literal($rToolObject->starttime->getTimestamp());
+		$predicateStartTime = new Resource(STARTTIME);
+		$this->model->add(new Statement($resourceSInstance, $predicateStartTime, $sInstanceStartTime));
+
+		$sInstanceEndTime = new Literal($rToolObject->endtime->getTimestamp());
+		$predicateEndTime = new Resource(ENDTIME);
+		$this->model->add(new Statement($resourceSInstance, $predicateEndTime, $sInstanceEndTime));
+
+		if(isset($rToolObject->notes))
+		{
+			foreach($rToolObject->notes as $note)
+			{
+				$sInstanceNote = new Literal($note);
+				$predicateNote = new Resource(HAS_NOTE);
+				$this->model->add(new Statement($resourceSInstance, $predicateNote, $sInstanceNote));
+			}
+		}
+
+		$sInstanceSession = new Literal($rToolObject->session->uid);
+		$predicateSession = new Resource(OF_SESSION);
+		$this->model->add(new Statement($resourceSInstance, $predicateSession, $sInstanceSession));
+
+		if(isset($rToolObject->resultset))
+		{
+			//$sInstanceResultSet = new Literal($rToolObject->resultset->uid);
+			$sInstanceResultSet = new Literal($rToolObject->resultset);
+			$predicateResultSet = new Resource(HAS_RESULTSET);
+			$this->model->add(new Statement($resourceSInstance, $predicateResultSet, $sInstanceResultSet));
+		}
+		$this->save();
+		return true;
+	}
+}
+?>
Index: Dev/branches/Cartis/classes/sessionEditorWidget.php
===================================================================
--- Dev/branches/Cartis/classes/sessionEditorWidget.php	(revision 206)
+++ Dev/branches/Cartis/classes/sessionEditorWidget.php	(revision 207)
@@ -88,5 +88,5 @@
 
     public function LoadSession() {   // Initialize variables on page load.
-        // Redirect if no session is set
+		// Redirect if no session is set
         if (!isset($_SESSION['currentSession'])) {
             redirect("selectSession.php");
@@ -94,4 +94,5 @@
         // Store the current session in internal variable
         $results = $this->dbi->get("Session", array("uid"=> $_SESSION['currentSession']));
+		print_r($results);
         if (!empty($results)) {
             if ($results[0]->evaluate()) {
Index: Dev/branches/Cartis/classes/surveyEditorWidget.php
===================================================================
--- Dev/branches/Cartis/classes/surveyEditorWidget.php	(revision 206)
+++ Dev/branches/Cartis/classes/surveyEditorWidget.php	(revision 207)
@@ -10,5 +10,5 @@
  * @author Thijs Schipper
  */
-class surveyEditorWidget {
+class SurveyEditorWidget {
 
     private $loadedSurvey;
Index: Dev/branches/Cartis/fbdataselection.php
===================================================================
--- Dev/branches/Cartis/fbdataselection.php	(revision 207)
+++ Dev/branches/Cartis/fbdataselection.php	(revision 207)
@@ -0,0 +1,26 @@
+<?php
+require 'classes/master.php'; //should be at top of every page
+
+if (!isset($_SESSION['userUid'])) {
+    redirect("index.php");
+}
+
+if (isset($_SESSION['message'])) {
+    echo $_SESSION['message'];
+    unset($_SESSION['message']);
+}
+?>
+
+<!DOCTYPE html>
+<html>
+    <head><?php   new StyleSheet("aapje"); ?>
+          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+          <title>Feedback dataselection</title>
+    </head>
+    <body>
+        
+
+
+        
+    </body>
+</html>
Index: Dev/branches/Cartis/getInfo.php
===================================================================
--- Dev/branches/Cartis/getInfo.php	(revision 206)
+++ Dev/branches/Cartis/getInfo.php	(revision 207)
@@ -38,5 +38,5 @@
         $returnString .= "<span class='property'>Title: </span><span class='value'>$result->title</span>";
         $result->evaluate();
-        $returnString .= "<span class='property'>Created: </span><span class='value'>" . $result->datetime->format("H:i:s, d-m-Y") . " by " . $result->creator->name . "</span>";
+        $returnString .= "<span class='property'>Created: </span><span class='value'>" . $result->creationdate->format("H:i:s, d-m-Y") . " by " . $result->creator->name . "</span>";
         $cS = 0; $cD = 0; $cA = 0;
         foreach ($result->pipeline as $step) {
Index: Dev/branches/Cartis/index.php
===================================================================
--- Dev/branches/Cartis/index.php	(revision 206)
+++ Dev/branches/Cartis/index.php	(revision 207)
@@ -7,5 +7,5 @@
  */
 
-//Even voor tijdelijk, aangezien er nog pagina's missen en redirects daarom niet goed werken: AAP
+//Even voor tijdelijk, aangezien er nog pagina's missen en redirects daarom niet goed werken:
 if (isset($_SESSION['userUid'])) {
     redirect("logout.php");
Index: Dev/branches/Cartis/jahoor.php
===================================================================
--- Dev/branches/Cartis/jahoor.php	(revision 207)
+++ Dev/branches/Cartis/jahoor.php	(revision 207)
@@ -0,0 +1,187 @@
+<?php ob_start('ob_gzhandler') ?> 
+<!DOCTYPE html > 
+<html> 
+<head> 
+    <meta http-equiv="X-UA-Compatible" content="chrome=1"> 
+ 
+    <!--
+        /**
+        * o------------------------------------------------------------------------------o
+        * | This file is part of the RGraph package - you can learn more at:             |
+        * |                                                                              |
+        * |                          http://www.rgraph.net                               |
+        * |                                                                              |
+        * | This package is licensed under the RGraph license. For all kinds of business |
+        * | purposes there is a small one-time licensing fee to pay and for non          |
+        * | commercial  purposes it is free to use. You can read the full license here:  |
+        * |                                                                              |
+        * |                      http://www.rgraph.net/LICENSE.txt                       |
+        * o------------------------------------------------------------------------------o
+        */
+    --> 
+    <title>RGraph: Javascript charts and graph library - line charts</title> 
+    
+    <meta name="keywords" content="rgraph html5 canvas example line chart" /> 
+    <meta name="description" content="RGraph: Javascript charts and graph library - Line chart example" /> 
+    
+    <meta property="og:title" content="RGraph: Javascript charts and graph library" /> 
+    <meta property="og:description" content="A charts library based on the HTML5 canvas tag" /> 
+    <meta property="og:image" content="http://www.rgraph.net/images/logo.png"/> 
+ 
+    <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" /> 
+    <link rel="icon" type="image/png" href="../images/favicon.png"> 
+ 
+    <script src="../libraries/RGraph.common.core.js" ></script> 
+    <script src="../libraries/RGraph.common.context.js" ></script> 
+    <script src="../libraries/RGraph.common.annotate.js" ></script> 
+    <script src="../libraries/RGraph.common.tooltips.js" ></script> 
+    <script src="../libraries/RGraph.common.zoom.js" ></script> 
+    <script src="../libraries/RGraph.common.resizing.js" ></script> 
+    <script src="../libraries/RGraph.line.js" ></script> 
+    <!--[if IE 8]><script src="../excanvas/excanvas.original.js"></script><![endif]--> 
+ 
+    <script> 
+        window.onload = function ()
+        {
+            var line1 = new RGraph.Line('line1', [56,45,43,52,56,65,21,23,34,15,21,-12,-13,-31,-25], [35,43,41,41,42,46,42,39,46,41,45,65,54,54,41,41]);
+            line1.Set('chart.background.barcolor1', 'white');
+            line1.Set('chart.background.barcolor2', 'white');
+            line1.Set('chart.background.grid', true);
+            line1.Set('chart.linewidth', 5);
+            line1.Set('chart.gutter.left', 35);
+            line1.Set('chart.hmargin', 5);
+            line1.Set('chart.shadow', true);
+            line1.Set('chart.tickmarks', null);
+            line1.Set('chart.units.post', 'k');
+            line1.Set('chart.xticks', 8);
+            line1.Set('chart.colors', ['red', 'green']);
+            line1.Set('chart.key', ['Sales (not good)','Costs (reasonably consistent)']);
+            line1.Set('chart.key.shadow', true);
+            line1.Set('chart.key.shadow.offsetx', 0);
+            line1.Set('chart.key.shadow.offsety', 0);
+            line1.Set('chart.key.shadow.blur', 15);
+            line1.Set('chart.key.shadow.color', '#ddd');
+            line1.Set('chart.key.rounded', true);
+            line1.Set('chart.key.position', 'graph');
+            line1.Set('chart.key.position.x', line1.Get('chart.gutter.left') + 4);
+            line1.Set('chart.key.position.y', (line1.canvas.height / 2) + 5);
+            line1.Set('chart.xaxispos', 'center');
+            line1.Set('chart.background.grid.autofit', true);
+            line1.Set('chart.background.grid.autofit.numhlines', 16);
+            line1.Set('chart.title', 'Sales last year');
+            line1.Draw();
+            
+            var line2 = new RGraph.Line('line2', [6,5,4,5,6,4,1,2,3], [7,8,9,9,8,7,8,7,6]);
+            line2.Set('chart.labels', ['13th','14th','15th','16th','15th','16th','17th','18th','19th']);
+            line2.Set('chart.title', 'Range of fuel consumption');
+            line2.Set('chart.title.vpos', 0.5);
+            line2.Set('chart.background.barcolor1', 'white');
+            line2.Set('chart.background.barcolor2', 'white');
+            line2.Set('chart.filled', true);
+            line2.Set('chart.filled.range', true);
+            line2.Set('chart.fillstyle', 'rgba(128,255,128,0.5)');
+            line2.Set('chart.linewidth', 2);
+            line2.Set('chart.colors', ['green']);
+            line2.Set('chart.hmargin', 5);
+            line2.Draw();
+        }
+    </script> 
+ 
+    <script> 
+      var _gaq = _gaq || [];
+      _gaq.push(['_setAccount', 'UA-54706-2']);
+      _gaq.push(['_trackPageview']);
+    
+      (function() {
+        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+      })();
+    </script> 
+    
+        <script>
+    window.onload = function ()
+    {
+        var data = [10,4,17,50,25,19,20,25,30,29,30,29];
+    
+        var line = new RGraph.Line("myLine", data);
+        line.Set('chart.background.barcolor1', 'rgba(255,255,255,1)');
+        line.Set('chart.background.barcolor2', 'rgba(255,255,255,1)');
+        line.Set('chart.background.grid.color', 'rgba(238,238,238,1)');
+        line.Set('chart.colors', ['rgba(255,0,0,1)']);
+        line.Set('chart.linewidth', 2);
+        line.Set('chart.filled', true);
+        line.Set('chart.hmargin', 5);
+        line.Set('chart.labels', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);
+        line.Set('chart.gutter.left', 40);
+        line.Draw();
+    }
+</script>
+
+ 
+</head> 
+<body> 
+ 
+    
+    <!-- Social networking buttons --> 
+        <div id="social_icons" class="warning" style="border-radius: 10px; top: 1px; position: fixed"> 
+            <a title="Bookmark with delicious" href="http://delicious.com/save?jump=close&v=4&noui&jump=close&url=http://www.rgraph.net&notes=RGraph%20is%20a%20HTML5%20based%20javascript%20charts%20library%20supporting%20a%20wide%20range%20of%20different%20charts%20types&title=RGraph:Javascript%20charts%20and%20graphs%20library" target="_blank"><img src="../images/delicious.png" alt="Bookmark with delicious" width="22" height="22" border="0" align="absmiddle" /></a> 
+            <a href="http://twitter.com/home/?status=RGraph%3A%20Javascript+charts+and+graph+library+http%3A%2F%2Fwww.rgraph.net+%23rgraph+%23html5+%23canvas+%23javascript+%23charts+@_rgraph" target="_blank"><img src="../images/twitter.png" id="twitter_icon" alt="tweet this site" width="22" height="22" border="0" align="absmiddle" /></a> 
+        </div> 
+ 
+        <script> 
+            // Opera fix
+            if (navigator.userAgent.indexOf('Opera') == -1) {
+              document.getElementById("social_icons").style.position = 'fixed';
+            }
+        </script> 
+    <!-- Social networking buttons --> 
+ 
+ 
+<div id="breadcrumb"> 
+    <a href="../index.html">RGraph: Javascript charts and graph library</a> 
+    >
+    <a href="./index.html">Examples</a> 
+    >
+    Line chart
+</div> 
+ 
+<h1>RGraph: <span>Javascript charts and graph library</span> - Line charts</h1> 
+ 
+    <script> 
+        if (RGraph.isIE8()) {
+            document.write('<div style="background-color: #fee; border: 2px dashed red; padding: 5px"><b>Important</b><br /><br /> Internet Explorer 8 does not natively support the HTML5 canvas tag, so if you want to see the charts, you can either:<ul><li>Install <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a></li><li>Use ExCanvas. This is provided in the RGraph Archive.</li><li>Use another browser entirely. Your choices are Firefox 3.5+, Chrome 2+, Safari 4+ or Opera 10.5+. </li></ul> <b>Note:</b> Internet Explorer 9 fully supports the canvas tag. Click <a href="http://support.rgraph.net/message/rgraph-in-internet-explorer-9.html" target="_blank">here</a> to see some screenshots.</div>');
+        }
+    </script> 
+    
+    <div> 
+        <p> 
+            Like Bar charts, Line charts are some of the most versatile chart types. It is similar, but can indicate chronological
+            data better. Line charts are good if, for example, you want to illustrate sales figures over a year (or any period of
+            time). You'll then be able to easily see whether sales are going up, down or are stagnant. It will also become apparent
+            which months are busier than others. By using a multiple line chart you can add multiple sets of data (eg two or more years
+            of figures) to your chart. You can customise the line chart by stipulating it as being filled, having drop shadows, keys,
+            having the X axis in the centre, different colors, different tickmark styles and tooltips etc.
+        </p> 
+        
+        <p> 
+            The first chart uses external DIVs for the tooltip contents. The DIVs are at the bottom of this page (they're set not to
+            be visible). Using external DIVs for tooltips can make maintenance easier.
+        </p> 
+    
+        <div> 
+            <ul> 
+                <li><a href="../docs/line.html">Line charts API documentation</a></li> 
+            </ul> 
+        </div> 
+ 
+        <div> 
+            <canvas id="line1" width="475" height="250">[Please wait...]</canvas> 
+            <canvas id="line2" width="475" height="250">[Please wait...]</canvas> 
+        </div> 
+    </div> 
+ 
+
+</body> 
+</html>
+        
Index: Dev/branches/Cartis/rdfConstants.php
===================================================================
--- Dev/branches/Cartis/rdfConstants.php	(revision 206)
+++ Dev/branches/Cartis/rdfConstants.php	(revision 207)
@@ -22,4 +22,6 @@
 define('RESPONDENT',SURVEYTOOL_RESOURCES_NAMESPACE . 'respondent');
 define('APPDATA',SURVEYTOOL_RESOURCES_NAMESPACE . 'graph');
+define('SESSIONINSTANCE', SURVEYTOOL_RESOURCES_NAMESPACE . 'sessioninstance');
+define('RESULTSET', SURVEYTOOL_RESOURCES_NAMESPACE . 'resultset');
 
 // Predicates used for RDF triples
@@ -52,4 +54,11 @@
 define('HAS_SURVEY', SURVEYTOOL_PREDICATES_NAMESPACE . 'has_survey');
 define('HAS_ANSWERSET', SURVEYTOOL_PREDICATES_NAMESPACE . 'has_answerset');
-
+define('LOCATION', SURVEYTOOL_PREDICATES_NAMESPACE . 'location');
+define('FACILITATOR', SURVEYTOOL_PREDICATES_NAMESPACE . 'facilitator');
+define('STARTTIME', SURVEYTOOL_PREDICATES_NAMESPACE . 'starttime');
+define('ENDTIME', SURVEYTOOL_PREDICATES_NAMESPACE . 'endtime');
+define('HAS_NOTE', SURVEYTOOL_PREDICATES_NAMESPACE . 'has_note');
+define('OF_SESSION', SURVEYTOOL_PREDICATES_NAMESPACE . 'of_session');
+define('HAS_RESULTSET', SURVEYTOOL_PREDICATES_NAMESPACE . 'has_resultset');
+define('CREATIONDATE', SURVEYTOOL_PREDICATES_NAMESPACE . 'creationdate');
 ?>
Index: Dev/branches/Cartis/selectSession.php
===================================================================
--- Dev/branches/Cartis/selectSession.php	(revision 206)
+++ Dev/branches/Cartis/selectSession.php	(revision 207)
@@ -36,5 +36,5 @@
 
 if (isset($_POST['deleteSession'])) {
-    if (isset($_POST['sessionUid'])) {
+    if (isset($_POST['sessionUID'])) {
         //Kan de database al objecten verwijderen?
     }
@@ -42,6 +42,8 @@
 
 if (isset($_POST['editSession'])) {
+	var_dump($_POST);
     if (isset($_POST['sessionUid'])) {
         $session_results = $dbi->get("SESSION", array("uid" => $_POST['sessionUid']));
+		var_dump($session_results);
         if (count($session_results) == 1 && $session_results[0] != null) {
             // DEZE SESSION MOET UITEINDELIJK EEN POST WORDEN, WANNEER DEZE HELE PAGINA IS OVERGEZET IN JAVASCRIPT!
@@ -55,6 +57,5 @@
 //Get available sessions for current user
 //$sessions = $dbi->get("Session", array("creator"=>$_SESSION['username']));  //This does not work, session.php does not yet have a property 'creator'
-$sessions = $dbi->get("Session", array());  // Let's just load everything then...
-//var_dump($sessions);
+$sessions = $dbi->get("Session");  // Let's just load everything then...
 ?>
 
@@ -70,7 +71,6 @@
     <body>
         <div id="header">
-            <?php new Logo(); ?>          
+            <?php new Logo(); ?>
         </div>
-          <a href="aapje.php">Ga naar Data selection</a>
 
         <div id="wrapper">
@@ -117,5 +117,4 @@
             </div>
         </div>
-                        
     </body>
 </html>
