Index: Dev/branches/jos-branch/classes/DatabaseInterface.php
===================================================================
--- Dev/branches/jos-branch/classes/DatabaseInterface.php	(revision 138)
+++ Dev/branches/jos-branch/classes/DatabaseInterface.php	(revision 140)
@@ -21,4 +21,5 @@
     private $userConnector;
     private $surveyConnector;
+    private $respondentConnector;
     
     /**
@@ -31,4 +32,5 @@
         $this->userConnector = new UserConnector();
         $this->surveyConnector = new SurveyConnector();
+        $this->respondentConnector = new RespondentConnector();
     }
     
@@ -54,4 +56,6 @@
             case "survey":
                 return $this->surveyConnector->get($arguments);
+            case "respondent":
+                return $this->respondentConnector->get($arguments);
         }
     }
@@ -76,4 +80,6 @@
             case "Survey":
                 $this->surveyConnector->set($rToolObject);
+            case "Respondent":
+                $this->respondentConnector->set($rToolObject);
         }
     }
Index: Dev/branches/jos-branch/classes/Respondent.php
===================================================================
--- Dev/branches/jos-branch/classes/Respondent.php	(revision 140)
+++ Dev/branches/jos-branch/classes/Respondent.php	(revision 140)
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * Description of Respondent
+ *
+ * @author jkraaijeveld
+ */
+class Respondent extends ResearchToolObject {
+   public $name;
+   public $password;
+   
+   public function __construct($uid = null, $name = null, $password = null) {
+      if(!isset($uid))
+      {
+            $uid = md5(uniqid(rand(), true));
+      }
+      
+      $this->uid = $uid;
+      $this->name = $name;
+      $this->password = $password;
+   }
+   
+}
+
+?>
Index: Dev/branches/jos-branch/classes/RespondentConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/RespondentConnector.php	(revision 140)
+++ Dev/branches/jos-branch/classes/RespondentConnector.php	(revision 140)
@@ -0,0 +1,128 @@
+<?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 RespondentConnector
+ *
+ * @author jkraaijeveld
+ */
+class RespondentConnector implements IConnector{
+    
+    protected $model;
+    protected $fileName = 'data/users/respondents.rdf';
+    
+    /**
+     * Constructor for RespondentConnector.
+     */
+    public function __construct()
+    {
+        //Ensure the required folder for this connector exists
+        if (!is_dir('data/users/'))
+            mkdir('data/users/');	
+    }
+    
+    /**
+     * function load()
+     * Loads the file into the standard MemModel.
+     */
+    public function load() {
+        //Get the Memory Model from the ModelFactory
+        $this->model = ModelFactory::getDefaultModel();
+        
+        //Ensure the required file exists before loading
+        if(file_exists($this->fileName))
+            $this->model->load($this->fileName);
+    }
+    
+    /**
+     * function save()
+     * Saves the MemModel into the given file.
+     */
+    public function save() {
+        $this->model->saveAs($this->fileName,'rdf'); 
+    }
+    
+    /**
+     * function get($arguments)
+     * Gets the array of Respondent objects belonging to arguments supplied.
+     * @param type $arguments : An array containing zero or more of the following keys:
+     *                          'uid', 'name', 'password'
+     */
+    public function get($arguments) {
+        $this->load();
+        //Determine which arguments are supplied
+        $keys = array_keys($arguments);
+        //Set default values for arguments
+        $uid = "?uid"; $name = "?name"; $password = "?password";
+        //Set the arguments if they are supplied
+        if(in_array("uid", $keys))
+            $uid = "\"".$arguments["uid"]."\"";
+        if(in_array("name", $keys))
+            $name = '\''.$arguments["name"].'\'';
+        if(in_array("password", $keys))
+            $password = "\"".$arguments["password"]."\"";
+       
+        //Create the querystring 
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT ?uid, ?name, ?password
+            WHERE 	
+            {
+                    _user	predicates:resource_type	resources:user ;
+					predicates:uid ?uid ;
+					predicates:name ?name ;
+					predicates:password ?password ;
+                     			predicates:uid ' . $uid . ' 
+					predicates:name ' . $name . ' 
+					predicates:password ' . $password . ' 
+            }';
+        echo $querystring;
+        //Query the model
+        $results = $this->model->sparqlQuery($querystring);
+        $respondents = array();
+        if(!empty($results))
+        {
+            //Run over all results and create appropriate Respondent objets
+            foreach($results as $result)
+            { 
+                    $respondents[] = new Respondent($result['?uid']->label, $result['?name']->label, $result['?password']->label);
+            }
+        }
+        return $respondents;
+    }
+    
+    /**
+     * Save the given User object in the file.
+     * @param type $rToolObject 
+     */
+    public function set($rToolObject)
+    {
+        $this->load();
+        $resourceRespondent = new Resource(RESPONDENT . '/' . $rToolObject->uid);
+        //Remove the old value stored with the given id
+        $this->model->subtract($this->model->find($resourceRespondent, null, null));
+
+        $resourceRespondentType = new Resource(RESPONDENT);
+        $predicateRType = new Resource(RTYPE);
+        $this->model->add(new Statement($resourceRespondent,$predicateRType,$resourceRespondentType));
+
+        $literalRespondentID = new Literal($rToolObject->uid);
+        $predicateUniqueID = new Resource(UID);
+        $this->model->add(new Statement($resourceRespondent,$predicateUniqueID,$literalRespondentID));
+        
+        $literalRespondentName = new Literal($rToolObject->name);
+        $predicateName = new Resource(NAME);
+        $this->model->add(new Statement($resourceRespondent,$predicateName,$literalRespondentName));			
+
+        $literalPassword = new Literal($rToolObject->password);
+        $predicatePassword = new Resource(PASSWORD);
+        $this->model->add(new Statement($resourceRespondent,$predicatePassword,$literalPassword));
+        $this->save();
+    }
+}
+
+?>
Index: Dev/branches/jos-branch/classes/UserConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/UserConnector.php	(revision 138)
+++ Dev/branches/jos-branch/classes/UserConnector.php	(revision 140)
@@ -16,5 +16,5 @@
     
     /**
-     * Constructor for ApplicationConnector.
+     * Constructor for RespondentConnector.
      */
     public function __construct()
@@ -50,5 +50,5 @@
      * Gets the array of User objects belonging to arguments supplied.
      * @param type $arguments : An array containing zero or more of the following keys:
-     *                          'uid', 'name', 'password', 'style'
+     *                          'uid', 'name', 'password'
      */
     public function get($arguments) {
