Index: Dev/branches/jos-branch/classes/Application.php
===================================================================
--- Dev/branches/jos-branch/classes/Application.php	(revision 129)
+++ Dev/branches/jos-branch/classes/Application.php	(revision 130)
@@ -14,4 +14,8 @@
     public function __construct($uid = null, $title = null, $description = null, $style = null) 
     {
+        if(!isset ($uid))
+        {
+            $uid = md5(uniqid(rand(), true));
+        }
         $this->uid = $uid;
         $this->title = $title;
@@ -19,13 +23,4 @@
 	$this->style = $style;
     }
-    
-    public static function getApplication($info)
-    {
-        return new Application(
-                $info['applicationID'],
-                $info['applicationTitle'],
-                $info['applicationDescription'],
-                $info['applicationStyle']);
-    }
 
 }
Index: Dev/branches/jos-branch/classes/ApplicationConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/ApplicationConnector.php	(revision 129)
+++ Dev/branches/jos-branch/classes/ApplicationConnector.php	(revision 130)
@@ -61,5 +61,5 @@
         //Set the arguments if they are supplied
         if(in_array("uid", $keys))
-            $uid = "\"".$arguments["id"]."\"";
+            $uid = "\"".$arguments["uid"]."\"";
         if(in_array("title", $keys))
             $title = '\''.$arguments["title"].'\'';
@@ -81,27 +81,22 @@
 					predicates:description ?description ;
 					predicates:style ?style ;
-					predicates:uid ' . $uid . ' 
+                     			predicates:uid ' . $uid . ' 
 					predicates:title ' . $title . ' 
 					predicates:description ' . $description . ' 
-					predicates:style ' . $style . ' 
+					predicates:style ' . $style . '
             }';
 
         //Query the model
         $results = $this->model->sparqlQuery($querystring);
-		if(!empty($results))
-			{
-			$applications = array();
-			//Run over all results and create appropriate Application objets
-			foreach($results as $result)
-			{ 
-				$applications[] = new Application($result['?uid']->label, $result['?title']->label, $result['?description']->label, $result['?style']->label);
-			}
-			//Return the list of application objects
-			return $applications;
-		}
-		else
-		{
-			return array();
-		}
+        $applications = array();
+        if(!empty($results))
+        {
+            //Run over all results and create appropriate Application objets
+            foreach($results as $result)
+            { 
+                    $applications[] = new Application($result['?uid']->label, $result['?title']->label, $result['?description']->label, $result['?style']->label);
+            }
+        }
+        return $applications;
     }
     
@@ -114,9 +109,10 @@
     public function set($rToolObject)
     {
+        $this->load();
         $resourceApplication = new Resource(APPLICATION.'/'.$rToolObject->uid);
-		//Remove the old value stored with the given id
-		$this->model->subtract($this->model->find($resourceApplication, null, null));
-		
-		//Add the new statements to the model
+        //Remove the old value stored with the given id
+        $this->model->subtract($this->model->find($resourceApplication, null, null));
+
+        //Add the new statements to the model
         $resourceApplicationType = new Resource(APPLICATION);
         $predicateRType = new Resource(RTYPE);
@@ -139,5 +135,5 @@
         $this->model->add(new Statement($resourceApplication,$predicateStyle,$applicationStyle));
 		
-		$this->save();
+	$this->save();
     }
 }
Index: Dev/branches/jos-branch/classes/DatabaseInterface.php
===================================================================
--- Dev/branches/jos-branch/classes/DatabaseInterface.php	(revision 129)
+++ Dev/branches/jos-branch/classes/DatabaseInterface.php	(revision 130)
@@ -17,29 +17,73 @@
      * Constructor for the DatabaseInterface class
      */
-    protected $applicationConnector;
+    private $applicationConnector;
+    private $questionConnector;
+    private $userConnector;
     
+    /**
+     * Constructor for DatabaseInterface.
+     * Initializes all the connectors.
+     */
     public function __construct() {
         $this->applicationConnector = new ApplicationConnector();
+        $this->questionConnector = new QuestionConnector();
+        $this->userConnector = new UserConnector();
     }
     
+    /**
+     * Get the data corresponding to the given type and arguments
+     * @param type $type
+     * @param type $arguments
+     * @return type 
+     */
     public function get($type, $arguments)
     {
-        switch($type)
+        switch(strtolower($type))
         {
             case "application":
                 return $this->applicationConnector->get($arguments);
-            
+                break;
+            case "question":
+                return $this->questionConnector->get($arguments);
+                break;
+            case "user":
+                return $this->userConnector->get($arguments);
+                break;
         }
     }
 	
-	public function set($rToolObject)
-	{
-		switch(get_class($rToolObject))
-		{
-			case "Application":
-				$this->applicationConnector->set($rToolObject);
-		}
-	}
-	
+    /**
+     * Saves the given object based on its class.
+     * @param type $rToolObject 
+     */
+    public function set($rToolObject)
+    {
+        switch(get_class($rToolObject))
+        {
+            case "Application":
+                $this->applicationConnector->set($rToolObject);
+                break;
+            case "Question":
+                $this->questionConnector->set($rToolObject);
+                break;
+            case "User":
+                $this->userConnector->set($rToolObject);
+                break;
+        }
+    }
+    
+    /**
+     * Saves all the objects in the given array, assuming they are 
+     * valid ResearchToolObjects.
+     * @param type $rToolObjects 
+     */
+    public function batchSet($rToolObjects)
+    {
+        foreach ($rToolObjects as $rToolObject)
+        {
+            $this->set($rToolObject);
+        }
+    }
+
 	
 }
Index: Dev/branches/jos-branch/classes/Question.php
===================================================================
--- Dev/branches/jos-branch/classes/Question.php	(revision 129)
+++ Dev/branches/jos-branch/classes/Question.php	(revision 130)
@@ -11,46 +11,29 @@
  * @author fpvanagthoven
  */
-class Question {    
-    public $code;
+class Question extends ResearchToolObject{    
     public $title;
     public $type;
     public $description;
+    public $category;
     public $answers; // format answers['#']
-    public $category;
     
-    public function __construct($code, $title = null, $type = null, $description = null)
+    /**
+     * Constructor for a Question. $uid equals the corresponding code.
+     * @param type $uid
+     * @param type $title
+     * @param type $type
+     * @param type $description
+     * @param type $category
+     * @param type $answers 
+     */
+    public function __construct($uid, $title = null, $type = null, $description = null, $category = null, $answers = null)
     {
-        $this->code = $code;
+        $this->uid = $uid;
         $this->title = $title;
         $this->type = $type;
         $this->description = $description;
-        $this->answers = array();
+        $this->category =  $category;
+        $this->answers = $answers;
     }
-    
-    /* reminder that constructor doesn't contain category haha */
-    public function setCategory($category)
-    {
-        $this->category = $category;
-    }
-    
-    public static function getQuestion($code, $info)
-    {
-        $question = new Question($code);
-        $question->title = $info['questionTitle'];
-        $question->type = $info['questionType'];
-        if(isset($info['questionDescription']))
-            $question->description = $info['questionDescription'];
-        $question->category = $info['questionCategory'];
-        
-        $i = 1;
-        while (isset($info['ans' . $i]))
-        {
-            array_push($question->answers, $info['ans' . $i]);
-            $i++;
-        }
-        
-        return $question;
-    }
-
 }
 
Index: Dev/branches/jos-branch/classes/ResearchToolObject.php
===================================================================
--- Dev/branches/jos-branch/classes/ResearchToolObject.php	(revision 129)
+++ Dev/branches/jos-branch/classes/ResearchToolObject.php	(revision 130)
@@ -6,5 +6,5 @@
  */
 class ResearchToolObject {
-    private $uid;
+    public $uid;
 }
 
Index: Dev/branches/jos-branch/classes/Survey.php
===================================================================
--- Dev/branches/jos-branch/classes/Survey.php	(revision 129)
+++ 	(revision )
@@ -1,84 +1,0 @@
-<?php
-
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/**
- * Description of Survey
- *
- * @author fpvanagthoven
- */
-class Survey {
-
-    public $id;
-    public $title;
-    public $description;
-    public $questions;
-    public $results;
-    
-    const DEFAULT_DESCRIPTION = "Write a helpful description for this survey here.";
-
-    public function __construct($id, $title, $description = null) {
-        $this->id = $id;
-        $this->title = $title;
-        $this->description = $description;
-        $this->questions = array();
-
-        $this->results = null;
-    }
-
-    public function addQuestion($question) {
-        array_push($this->questions, $question);
-    }
-
-    public function setResults($surveyResults) {
-        $this->results = $surveyResults;
-    }
-
-    public static function getSurvey($info) {
-        $id = $info['surveyID'];
-        $title = $info['surveyTitle'];
-        $description = $info['surveyDescription'];
-
-        $survey = new Survey($id, $title, $description);
-
-        $numQ = 1; //number questions
-        while (isset($info['questionTitle' . $numQ])) {
-            $id = $info['questionID' . $numQ];
-            $code = $info['questionCode' . $numQ];
-            $title = $info['questionTitle' . $numQ];
-            $type = $info['questionType' . $numQ];
-            $description = $info['questionDescription' . $numQ];
-
-            $question = new Question($id, $code, $title, $type, $description);
-
-            $numA = 1; //number answers
-            while (isset($info['q' . $numQ . 'ans' . $numA])) {
-                $answer = $info['q' . $numQ . 'ans' . $numA];
-                $question->answers[$numA] = $answer;
-
-                $numA++;
-            }
-
-
-            $survey->questions[$numQ] = $question;
-
-            $numQ++;
-        }
-
-        return $survey;
-    }
-
-    /**
-     * TODO: Should return Results-object from reading RDF-database
-     * @param type $surveyID 
-     */
-    public static function getResults($surveyID) {
-        
-    }
-
-}
-
-?>
Index: Dev/branches/jos-branch/data/applications/applications.rdf
===================================================================
--- Dev/branches/jos-branch/data/applications/applications.rdf	(revision 129)
+++ Dev/branches/jos-branch/data/applications/applications.rdf	(revision 130)
@@ -8,18 +8,26 @@
    xmlns:ns1="http://tbm.tudelft.nl/researchtool/predicates/">
 
-<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/application/364790b25634bf9b45fa16248a764eff">
+<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/application/c571ae05fa6e69ad63a8793f1484206e">
    <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/application"/>
-   <ns1:uid>364790b25634bf9b45fa16248a764eff</ns1:uid>
-   <ns1:title>app2</ns1:title>
-   <ns1:description>craft</ns1:description>
-   <ns1:style><![CDATA[]]></ns1:style>
+   <ns1:uid>c571ae05fa6e69ad63a8793f1484206f</ns1:uid>
+   <ns1:title>Sup</ns1:title>
+   <ns1:description>herpderp</ns1:description>
+   <ns1:style>derpStyle</ns1:style>
 </rdf:Description>
 
-<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/application/29561e34ea30746a46f3027972a5d5f9">
+<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/application/19770b885bb13f2c5a1e3fd03bf77179">
    <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/application"/>
-   <ns1:uid>29561e34ea30746a46f3027972a5d5f9</ns1:uid>
-   <ns1:title>Sup, testing if the title changes properly.</ns1:title>
-   <ns1:description>test</ns1:description>
-   <ns1:style><![CDATA[]]></ns1:style>
+   <ns1:uid>19770b885bb13f2c5a1e3fd03bf77179</ns1:uid>
+   <ns1:title>NewTestTitle</ns1:title>
+   <ns1:description>NewTestDescription</ns1:description>
+   <ns1:style>NewStylo</ns1:style>
+</rdf:Description>
+
+<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/application/cc91fba98ce357d9eb6709407d8cd4a4">
+   <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/application"/>
+   <ns1:uid>cc91fba98ce357d9eb6709407d8cd4a4</ns1:uid>
+   <ns1:title>NewTestTitle</ns1:title>
+   <ns1:description>NewTestDescription</ns1:description>
+   <ns1:style>NewStylo</ns1:style>
 </rdf:Description>
 
Index: Dev/branches/jos-branch/data/users/users.rdf
===================================================================
--- Dev/branches/jos-branch/data/users/users.rdf	(revision 129)
+++ Dev/branches/jos-branch/data/users/users.rdf	(revision 130)
@@ -4,11 +4,33 @@
 
 <rdf:RDF
+   xml:base="data/users/users.rdf#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:ns1="http://tbm.tudelft.nl/researchtool/predicates/">
 
-<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/user/e978ee6bdc7af674060f558ce7ac1127">
+<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/user/b76cbf38cac7a3f048ca0d64a6c3ef58">
+   <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/user"/>
+   <ns1:name>iets</ns1:name>
+   <ns1:uid>b76cbf38cac7a3f048ca0d64a6c3ef58</ns1:uid>
+   <ns1:password>Vo87e37xIpm4uP4AfyHR9aSERlYpcgwE93Bc+rf2fD0=</ns1:password>
+</rdf:Description>
+
+<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/user/efa84d358d1bbd732c4075a1b3832dc7">
+   <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/user"/>
+   <ns1:name>booya</ns1:name>
+   <ns1:uid>efa84d358d1bbd732c4075a1b3832dc7</ns1:uid>
+   <ns1:password>Zk3CKJGWXcEvljUUmyAU5aLwTuwsMwdZZcDCzAH9Xrk=</ns1:password>
+</rdf:Description>
+
+<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/user/caa33a16c3b30cdcb7a5f0434c23e210">
+   <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/user"/>
+   <ns1:name>frans</ns1:name>
+   <ns1:uid>caa33a16c3b30cdcb7a5f0434c23e210</ns1:uid>
+   <ns1:password>YrNByNHxZwPoreIjW3lpAgeMg+J6kYBdl53uBCsHRKo=</ns1:password>
+</rdf:Description>
+
+<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/user/9043f64705e67ceb8f28242207b83adf">
    <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/user"/>
    <ns1:name>jkraaijeveld</ns1:name>
-   <ns1:uid>e978ee6bdc7af674060f558ce7ac1127</ns1:uid>
+   <ns1:uid>9043f64705e67ceb8f28242207b83adf</ns1:uid>
    <ns1:password>NWCbqdOCRGewETOoMI1YepJsoGQMjKozC5XOjtM5Mm8=</ns1:password>
 </rdf:Description>
Index: Dev/branches/jos-branch/testpage.php
===================================================================
--- Dev/branches/jos-branch/testpage.php	(revision 129)
+++ Dev/branches/jos-branch/testpage.php	(revision 130)
@@ -1,16 +1,11 @@
-<?php 
-	require 'classes/master.php';
-	require 'rdfConstants.php';
+<?php
+    require 'classes/master.php';
 
+    $db = new DatabaseInterface();
+//    $arguments = array("id" => "c571ae05fa6e69ad63a8793f1484206e");
 
-	
-	$di = new DatabaseInterface();
-	
-	
-	$args = array("description" => "test");
-	$apps = $di->get("application", $args);
-	$app = $apps[0];
-	$app->title = "Sup, testing if the title changes properly.";
-	$di->set($app);
-
+   
+    
+    $result = $db->get("user", array("name" => "jkraaijeveld"));
+    print_r($result);
 ?>
