Index: Dev/branches/jos-branch/classes/Answer.php
===================================================================
--- Dev/branches/jos-branch/classes/Answer.php	(revision 148)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<?php
-
-/**
- * Description of Answer
- *
- * @author jkraaijeveld
- */
-class Answer extends ResearchToolObject {
-    public $question;
-    public $values;
-    
-    /**
-     * Constructor for an Answer object
-     * @param type $uid
-     * @param type $question
-     * @param type $values 
-     */
-    public function __construct($uid = null, $question = null, $values = null) {
-      if(!isset($uid))
-      {
-            $uid = md5(uniqid(rand(), true));
-      }
-      $this->uid = $uid;
-      $this->question = $question;
-      $this->values = $values;
-    }
-}
-
-?>
Index: Dev/branches/jos-branch/classes/AnswerConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/AnswerConnector.php	(revision 148)
+++ 	(revision )
@@ -1,169 +1,0 @@
-<?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 AnswerConnector
- *
- * @author jkraaijeveld
- */
-class AnswerConnector implements IConnector{
-    protected $model;
-	protected $fileName = 'data/answers/answers.rdf';
-	protected $db;
-    
-    /**
-     * Constructor for AnswerConnector
-     */
-    public function __construct() {
-        //Ensure the required folder for this connector exists
-        if (!is_dir('data/answers/'))
-            mkdir('data/answers/');
-    }
-    
-    /**
-     * 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()
-	 * Get the answers corresponding to the arguments
-	 * 'Question' argument is supposed to be the question ID
-	 * 'Values' has to be an array to make sure multiple answers can be selected.
-	 */
-    public function get($arguments)
-	{
-		$this->load();
-		$keys = array_keys($arguments);
-		$uid = "?uid"; $question = "?question_code"; $value	= ""; 
-		if(in_array("uid", $keys))
-			$uid = '\''.$arguments["uid"].'\'';
-		if(in_array("question", $keys))
-			$question = '\''.$arguments["question"].'\'';
-		if(in_array("values", $keys))
-		{
-			foreach ($arguments["values"] as $val)
-			{
-				$value = $value . 'predicates:answered \'' . $val . '\' ';
-			}
-		}
-		//Create the querystring
-		$querystring = '
-			PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-			PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-			SELECT DISTINCT ?uid, ?question_code
-			WHERE
-			{
-				_answer predicates:resource_type resources:answer;
-
-				predicates:uid ?uid ;
-				predicates:question_code ?question_code;
-
-				predicates:uid ' . $uid . '
-				predicates:question_code ' . $question . '	
-				' . $value . '
-			}';
-
-		//Query the model
-		$results = $this->model->sparqlQuery($querystring);	
-		//An answer can have multiple values, get all these values for the answer instances found.
-		$answers = array();
-		if(!empty($results))
-		{
-            $this->db = new DatabaseInterface();
-			foreach($results as $result)
-			{
-				$values = $this->getValues($result['?uid']->label);
-				$questionResult = $this->db->get("question", array("uid" => $result['?question_code']->label));
-				$answers[] = new Answer($result['?uid']->label, $questionResult[0], $values);
-			}
-		}
-		return $answers;
-
-	}
-	/**
-	 * Gets the values that belong to the answer
-	 * specified by the UID
-	 */
-	private function getValues($uid)
-	{
-		$querystring = '
-			PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-			PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-			SELECT DISTINCT ?answered
-			WHERE 
-			{
-				_answer predicates:resource_type resources:answer ;
-				predicates:answered ?answered ;
-				predicates:uid \''. $uid . '\'
-		}';
-		$values = $this->model->sparqlQuery($querystring);
-		$returnArray = array();
-		if(!empty($values))
-		{
-			foreach($values as $value)
-			{
-				$returnArray[] = $value['?answered']->label;
-			}
-		}
-		return $returnArray;
-	} 
-
-    /**
-     * Saves the answer Object to the RDF file.
-     * @param type $rToolObject
-     */
-    public function set($rToolObject)
-    {
-        $this->load();
-        
-        $resourceAnswer = new Resource(ANSWER.'/'.$rToolObject->uid);        
-        //Remove the old value stored with the given id
-        $this->model->subtract($this->model->find($resourceAnswer, null, null));
-        
-        //Save all the new values
-        $resourceAnswerType = new Resource(ANSWER);
-        $predicateRType = new Resource(RTYPE);
-        $this->model->add(new Statement($resourceAnswer,$predicateRType,$resourceAnswerType));
-        
-		$answerId = new Literal($rToolObject->uid);
-		$predicateId = new Resource(UID);
-		$this->model->add(new Statement($resourceAnswer, $predicateId, $answerId));
-
-		$questionId = new Literal($rToolObject->question->uid);
-		$predicateQId = new Resource(QCODE);
-		$this->model->add(new Statement($resourceAnswer, $predicateQId, $questionId));
-
-		if(isset($rToolObject->values))
-		{
-			foreach($rToolObject->values as $value)
-			{
-				$answerValue = new Literal($value);
-				$predicateAnswer = new Resource(ANSWERED);
-				$this->model->add(new Statement($resourceAnswer, $predicateAnswer, $answerValue));
-			}
-		}
-        $this->save();
-    }
-}
-
-?>
Index: Dev/branches/jos-branch/classes/AnswerSet.php
===================================================================
--- Dev/branches/jos-branch/classes/AnswerSet.php	(revision 148)
+++ 	(revision )
@@ -1,30 +1,0 @@
-<?php
-
-/**
- * AnswerSet is a collection of answers corresponding to a Session
- *
- */
-class AnswerSet extends ResearchToolObject{
-	public $survey;
-	public $respondent;
-	public $answers;
-
-	/**
-	 * Constructor for an AnswerSet object
-	 * @param type $uid
-	 * @param type $question
-	 * @param type $values
-	 */
-	public function __construct($uid=null, $survey=null, $respondent=null, $answers=null)
-	{
-		if(!isset($uid))
-		{
-			$uid = md5(uniqid(rand(), true));
-		}
-		$this->uid = $uid;
-		$this->survey = $survey;
-		$this->respondent = $respondent;
-		$this->answers = $answers;
-	}
-}
-
Index: Dev/branches/jos-branch/classes/AnswerSetConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/AnswerSetConnector.php	(revision 148)
+++ 	(revision )
@@ -1,170 +1,0 @@
-<?php
-
-/**
- * Description of AnswerSetConnector
- *
- * @author jkraaijeveld
- */
-class AnswerSetConnector implements IConnector{
-    protected $model;
-    protected $fileName = 'data/answers/answersets.rdf';
-    protected $db;
-
-	/**
-	 * Constructor for the AnswerSetConnector
-	 */
-	public function __construct()
-	{
-		//Ensure the required folder for this connector exists
-		if(!is_dir('data/answers'))
-			mkdir('data/answers');
-	}
-
-	/**
-	 * 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'); 
-	}
-
-	/**
-	 * Get the AnswerSets corresponding to the arguments
-	 * Arguments can be one or more of the following:
-	 * uid, survey, respondent, answers
-	 * Where answers is an array of answer ids
-	 */
-	public function get($arguments)
-	{
-		$this->load();
-		
-		$keys = array_keys($arguments);
-		$uid = ""; $survey = ""; $respondent = ""; $answers = "";
-		if(in_array("uid", $keys))
-			$uid = 'predicates:uid \''.$arguments["uid"].'\' ';
-		if(in_array("survey", $keys))
-			$survey = 'predicates:for_survey \''.$arguments["survey"].'\' ';
-		if(in_array("respondent", $keys))
-			$respondent = 'predicates:by_respondent \''.$arguments["respondent"].'\' ';
-		if(in_array("answers", $keys))
-		{
-			foreach ($arguments["answers"] as $answer)
-			{
-				$answers = $answers . 'predicates:given_answer \'' . $answer . '\' ';
-			}
-		}
-
-		//Build the query string
-		$querystring = '
-			PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-			PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-			SELECT DISTINCT ?uid, ?for_survey, ?by_respondent
-			WHERE
-			{
-				_answerset	predicates:resource_type	resources:answerset ;
-				predicates:uid ?uid ;
-				predicates:for_survey ?for_survey ;
-				predicates:by_respondent ?by_respondent ;
-				' . $uid . $survey . $respondent . $answers . '
-			}';
-
-		//Query the model
-		$results = $this->model->sparqlQuery($querystring);
-		$answerSets = array();
-		if(!empty($results))
-		{
-			$this->db = new DatabaseInterface();
-			foreach($results as $result)
-			{
-				$survey = $this->db->get("survey", array("uid" => $result['?for_survey']->label));
-				$respondent = $this->db->get("respondent", array("uid" => $result['?by_respondent']->label));
-				$answers = 	$this->getAnswers($result['?uid']->label);
-				$answerSets[] = new AnswerSet($result['?uid']->label, $survey[0], $respondent[0], $answers);
-			}
-		}
-		return $answerSets;
-	}
-
-	/**
-	 * function getAnswers()
-	 * Gets the answers corresponding to the given answerset uid
-	 */
-	private function getAnswers($uid)
-	{
-		$querystring = '
-			PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE .'>
-			PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE .'>
-			SELECT DISTINCT ?given_answer
-			WHERE
-			{
-				_answerset predicates:resource_type resources:answerset ;
-				predicates:given_answer ?given_answer ;
-				predicates:uid \'' . $uid . '\'
-			}';
-		$answers = $this->model->sparqlQuery($querystring);
-		$returnArray = array();
-		if(!empty($answers))
-		{
-			foreach($answers as $answer)
-			{
-				$answerR = $this->db->get("answer", array("uid" => $answer["?given_answer"]->label));
-				$returnArray[] = $answerR[0];
-			}
-		}
-		return $returnArray;
-	}
-
-	/**
-	 * Save the given AnswerSet in the file.
-	 * @param type $rToolObject
-	 */
-	public function set($rToolObject)
-	{
-		$this->load();
-		$resourceAnswerSet = new Resource(ANSWERSET . '/' . $rToolObject->uid);
-		//Remove the old value stored with the given id
-		$this->model->subtract($this->model->find($resourceAnswerSet, null, null));
-
-		//Set the new values
-		$resourceAnswerSetType = new Resource(ANSWERSET);
-		$predicateRType = new Resource(RTYPE);
-		$this->model->add(new Statement($resourceAnswerSet, $predicateRType, $resourceAnswerSetType));
-
-		$answerSetId = new Literal($rToolObject->uid);
-		$predicateId = new Resource(UID);
-		$this->model->add(new Statement($resourceAnswerSet, $predicateId, $answerSetId));
-
-		$surveyId = new Literal($rToolObject->survey->uid);
-		$predicateSurvey = new Resource(FOR_SURVEY);
-		$this->model->add(new Statement($resourceAnswerSet, $predicateSurvey, $surveyId));
-
-		$respondentId = new Literal($rToolObject->respondent->uid);
-		$predicateRespondent = new Resource(BY_RESPONDENT);
-		$this->model->add(new Statement($resourceAnswerSet, $predicateRespondent, $respondentId));
-		
-		if(isset($rToolObject->answers))
-		{
-			foreach($rToolObject->answers as $answer)
-			{
-				$answerId = new Literal($answer->uid);
-				$predicateAnswer = new Resource(GIVEN_ANSWER);
-				$this->model->add(new Statement($resourceAnswerSet, $predicateAnswer, $answerId));
-			}
-		}
-		$this->save();
-	}
-}
Index: Dev/branches/jos-branch/classes/Application.php
===================================================================
--- Dev/branches/jos-branch/classes/Application.php	(revision 148)
+++ 	(revision )
@@ -1,27 +1,0 @@
-<?php
-
-/**
- * Description of Application
- *
- * @author fpvanagthoven
- */
-class Application extends ResearchToolObject{
-    
-    public $title;
-    public $description;
-    public $style;
-
-    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;
-        $this->description = $description;
-	$this->style = $style;
-    }
-
-}
-?>
Index: Dev/branches/jos-branch/classes/ApplicationConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/ApplicationConnector.php	(revision 148)
+++ 	(revision )
@@ -1,141 +1,0 @@
-<?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 ApplicationConnector
- *
- * @author jkraaijeveld
- */
-class ApplicationConnector implements IConnector{
-    
-    protected $model;
-    protected $fileName = 'data/applications/applications.rdf';
-
-    /**
-     * Constructor for ApplicationConnector.
-     */
-    public function __construct()
-    {
-        //Ensure the required folder for this connector exists
-        if (!is_dir('data/applications/'))
-            mkdir('data/applications/');	
-    }
-    
-    /**
-     * 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 Application objects belonging to arguments supplied.
-     * @param type $arguments : An array containing zero or more of the following keys:
-     *                          'uid', 'title', 'description', 'style'
-     */
-    public function get($arguments) {
-        $this->load();
-        //Determine which arguments are supplied
-        $keys = array_keys($arguments);
-        //Set default values for arguments
-        $uid = "?uid"; $title = "?title"; $description = "?description"; $style = "?style";
-        //Set the arguments if they are supplied
-        if(in_array("uid", $keys))
-            $uid = "\"".$arguments["uid"]."\"";
-        if(in_array("title", $keys))
-            $title = '\''.$arguments["title"].'\'';
-        if(in_array("description", $keys))
-            $description = "\"".$arguments["description"]."\"";
-        if(in_array("style", $keys))
-            $style = "\"".$arguments["style"]."\"";    
-
-        //Create the querystring 
-        $querystring = '
-            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-            SELECT ?uid, ?title, ?description, ?style
-            WHERE 	
-            {
-                    _application	predicates:resource_type	resources:application ;
-					predicates:uid ?uid ;
-					predicates:title ?title ;
-					predicates:description ?description ;
-					predicates:style ?style ;
-                     			predicates:uid ' . $uid . ' 
-					predicates:title ' . $title . ' 
-					predicates:description ' . $description . ' 
-					predicates:style ' . $style . '
-            }';
-
-        //Query the model
-        $results = $this->model->sparqlQuery($querystring);
-        $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;
-    }
-    
-    /**
-     * function set()
-     * Finds the required databaseentry matching the given object and removes
-     * it from the rdf file. Then adds the new RDF entry matching the object.
-     * @param type $rToolObject: The ResearchToolObject to be saved. 
-     */
-    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
-        $resourceApplicationType = new Resource(APPLICATION);
-        $predicateRType = new Resource(RTYPE);
-        $this->model->add(new Statement($resourceApplication,$predicateRType,$resourceApplicationType));
-		
-        $literalApplicationID = new Literal($rToolObject->uid);
-        $predicateUniqueID = new Resource(UID);
-        $this->model->add(new Statement($resourceApplication,$predicateUniqueID,$literalApplicationID));
-
-        $applicationTitle = new Literal($rToolObject->title);
-        $predicateTitle = new Resource(TITLE);	
-        $this->model->add(new Statement($resourceApplication,$predicateTitle,$applicationTitle));
-
-        $applicationDescription = new Literal($rToolObject->description);
-        $predicateDescription = new Resource(DESCRIPTION);
-        $this->model->add(new Statement($resourceApplication,$predicateDescription,$applicationDescription));
-
-        $applicationStyle = new Literal($rToolObject->style);
-        $predicateStyle = new Resource(STYLE);
-        $this->model->add(new Statement($resourceApplication,$predicateStyle,$applicationStyle));
-		
-	$this->save();
-    }
-}
-
-?>
Index: Dev/branches/jos-branch/classes/DatabaseInterface.php
===================================================================
--- Dev/branches/jos-branch/classes/DatabaseInterface.php	(revision 148)
+++ 	(revision )
@@ -1,131 +1,0 @@
-<?php
-
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/**
- * Description of DatabaseInterface
- * Initializes all the connectors, serves as only entrance and exit point
- * for the frontend
- * @author jkraaijeveld
- */
-class DatabaseInterface {
-    
-    /**
-     * Constructor for the DatabaseInterface class
-     */
-    private $applicationConnector;
-    private $questionConnector;
-    private $userConnector;
-    private $surveyConnector;
-    private $respondentConnector;
-	private $answerConnector;
-	private $answerSetConnector;
-	private $sessionConnector;
-    
-    /**
-     * Constructor for DatabaseInterface.
-     * Initializes all the connectors.
-     */
-    public function __construct() {
-        $this->applicationConnector = new ApplicationConnector();
-        $this->questionConnector = new QuestionConnector();
-        $this->userConnector = new UserConnector();
-        $this->surveyConnector = new SurveyConnector();
-        $this->respondentConnector = new RespondentConnector();
-		$this->answerConnector = new AnswerConnector();
-		$this->answerSetConnector = new AnswerSetConnector();
-		$this->sessionConnector = new SessionConnector();
-    }
-    
-    /**
-     * Get the data corresponding to the given type and arguments
-     * @param type $type
-     * @param type $arguments
-     * @return type 
-     */
-    public function get($type, $arguments = array())
-    {
-        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;
-            case "survey":
-                return $this->surveyConnector->get($arguments);
-                break;
-            case "respondent":
-                return $this->respondentConnector->get($arguments);
-                break;
-            case "answer":
-                return $this->answerConnector->get($arguments);
-				break;
-			case "answerset":
-				return $this->answerSetConnector->get($arguments);
-				break;
-			case "session":
-				return $this->sessionConnector->get($arguments);
-				break;
-        }
-    }
-	
-    /**
-     * 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;
-            case "Survey":
-				$this->surveyConnector->set($rToolObject);
-				break;
-            case "Respondent":
-				$this->respondentConnector->set($rToolObject);
-				break;
-            case "Answer":
-				$this->answerConnector->set($rToolObject);
-				break;
-			case "AnswerSet":
-				$this->answerSetConnector->set($rToolObject);
-				break;
-			case "Session":
-				$this->sessionConnector->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/IConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/IConnector.php	(revision 148)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<?php
-
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/**
- * Description of Connector
- *
- * @author jkraaijeveld
- */
-interface IConnector {
-    //This class will outline everything a Connector needs to operate within the system
-    public function get($arguments);
-    public function set($rToolObject);
-    public function load();
-    public function save();
-}
-
-?>
Index: Dev/branches/jos-branch/classes/Question.php
===================================================================
--- Dev/branches/jos-branch/classes/Question.php	(revision 148)
+++ 	(revision )
@@ -1,44 +1,0 @@
-<?php
-
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/**
- * Description of Question
- *
- * @author fpvanagthoven
- */
-class Question extends ResearchToolObject{    
-    public $title;
-    public $type;
-    public $description;
-    public $category;
-    public $answers; // format answers['#']
-    
-    /**
-     * 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)
-    {
-		if(!isset($uid))
-		{
-			$uid = md5(uniqid(rand(), true));
-		}
-        $this->uid = $uid;
-        $this->title = $title;
-        $this->type = $type;
-        $this->description = $description;
-        $this->category =  $category;
-        $this->answers = $answers;
-    }
-}
-
-?>
Index: Dev/branches/jos-branch/classes/QuestionConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/QuestionConnector.php	(revision 148)
+++ 	(revision )
@@ -1,198 +1,0 @@
-<?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 QuestionConnector
- *
- * @author jkraaijeveld
- */
-class QuestionConnector implements IConnector {
-    
-    protected $model;
-    protected $fileName = 'data/questions/questions.rdf';
-    
-    /**
-     * Constructor for QuestionConnector
-     */
-    public function __construct()
-    {
-        //Ensure the required folder for this connector exists
-        if (!is_dir('data/questions/'))
-            mkdir('data/questions/');	
-    }
-    
-    /**
-     * 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'); 
-    }
-    
-    /**
-     * Get the questions corresponding to the arguments.
-     * @param type $arguments 
-     * @return type Array
-     */
-    public function get($arguments)
-    {
-        $this->load();
-        
-        $keys = array_keys($arguments);
-        //Set default values for arguments
-        $uid = "?uid"; $title = "?title"; $type = "?type"; $description = "?description"; $category = "?category"; $has_answer = "";
-        //Set the arguments if they are supplied
-        if(in_array("uid", $keys))
-            $uid = '\''.$arguments["uid"].'\'';
-        if(in_array("title", $keys))
-            $title = '\''.$arguments["title"].'\'';
-        if(in_array("type", $keys))
-            $type = '\''.$arguments["type"].'\'';
-        if(in_array("description", $keys))
-            $description = "\"".$arguments["description"]."\"";
-        if(in_array("category", $keys))
-			$style = "\"".$arguments["category"]."\"";
-		if(in_array("answers", $keys))
-		{
-			foreach($arguments["answers"] as $answer)
-			{
-				$has_answer = $has_answer . 'predicates:has_answer \'' . $answer . '\' ';
-			}
-		}
-           
-        $querystring = '
-            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-            SELECT DISTINCT ?uid, ?title, ?type, ?description, ?category
-            WHERE 	
-            {
-                _question	predicates:resource_type	resources:question ;                
-                predicates:question_code ?uid ;
-                predicates:title ?title ;
-                predicates:question_type ?type ;
-                predicates:description ?description ;
-                predicates:question_category ?category ;
-
-                predicates:question_code ' . $uid . '
-                predicates:title ' . $title . '
-                predicates:question_type ' . $type . '
-                predicates:description ' . $description . '
-				predicates:question_category ' . $category . ' 
-				' . $has_answer . '
-            }';
-        //Create the querystring 
-        $results = $this->model->sparqlQuery($querystring);
-
-        
-        $questions = array();
-        if(!empty($results))
-        {
-            foreach($results as $result)
-            {
-                $answers = $this->getAnswers($result['?uid']->label);
-                $questions[] = new Question($result['?uid']->label, $result['?title']->label, $result['?type']->label, $result['?description']->label, $result['?category']->label, $answers);
-            }
-        }
-        return $questions;
-    }
-    
-    /**
-     * Gets the answers belonging to the given uid.
-     * @param type $uid
-     * @return type Array 
-     */
-    private function getAnswers($uid)
-    {
-        $querystring = '
-            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-            SELECT DISTINCT ?has_answer
-            WHERE
-            {
-                 _question	predicates:resource_type	resources:question ;
-                predicates:has_answer ?has_answer ; 
-                predicates:question_code \'' . $uid . '\'
-            }';
-
-        $answers = $this->model->sparqlQuery($querystring);
-        $returnArray = array();
-        if(!empty($answers))
-        {
-            foreach($answers as $answer)
-            {
-                $returnArray[] = $answer['?has_answer']->label;
-            }
-        }
-        return $returnArray;
-    }
-
-    
-    /**
-     * Save the given ResearchTool object
-     * @param type $rToolObject 
-     */
-    public function set($rToolObject)
-    {
-        $this->load();
-        
-        $resourceQuestion = new Resource(QUESTION.'/'.$rToolObject->uid);        
-        //Remove the old value stored with the given id
-        $this->model->subtract($this->model->find($resourceQuestion, null, null));
-        
-        //Save all the new values
-        $resourceQuestionType = new Resource(QUESTION);
-        $predicateRType = new Resource(RTYPE);
-        $this->model->add(new Statement($resourceQuestion,$predicateRType,$resourceQuestionType));
-        
-        $questionQCode = new Literal($rToolObject->uid);
-        $predicateQCode = new Resource(QCODE);
-        $this->model->add(new Statement($resourceQuestion,$predicateQCode,$questionQCode));
-        
-        $questionTitle = new Literal($rToolObject->title);
-        $predicateTitle = new Resource(TITLE);		
-        $this->model->add(new Statement($resourceQuestion,$predicateTitle,$questionTitle));	
-
-        $questionDescription = new Literal($rToolObject->description);
-        $predicateDescription = new Resource(DESCRIPTION);
-        $this->model->add(new Statement($resourceQuestion,$predicateDescription,$questionDescription));		
-
-        $resourceQuestionType = new Literal($rToolObject->type);
-        $predicateQType = new Resource(QTYPE);
-        $this->model->add(new Statement($resourceQuestion,$predicateQType,$resourceQuestionType));
-        
-        $questionQCategory = new Literal($rToolObject->category);
-        $predicateQCategory = new Resource(QCATEGORY);
-        $this->model->add(new Statement($resourceQuestion,$predicateQCategory,$questionQCategory));
-
-        if(isset($rToolObject->answers))
-        {
-            foreach($rToolObject->answers as $answer)
-            {		
-                $answerValue = new Literal($answer);
-                $predicateAnswer = new Resource(HAS_ANSWER);	
-                $this->model->add(new Statement($resourceQuestion,$predicateAnswer,$answerValue));
-            }
-        }
-        $this->save();
-    }
-}
-
-?>
Index: Dev/branches/jos-branch/classes/ResearchToolObject.php
===================================================================
--- Dev/branches/jos-branch/classes/ResearchToolObject.php	(revision 148)
+++ 	(revision )
@@ -1,11 +1,0 @@
-<?php
-/**
- * Description of ResearchToolObject
- *
- * @author jkraaijeveld
- */
-class ResearchToolObject {
-    public $uid;
-}
-
-?>
Index: Dev/branches/jos-branch/classes/Respondent.php
===================================================================
--- Dev/branches/jos-branch/classes/Respondent.php	(revision 148)
+++ 	(revision )
@@ -1,31 +1,0 @@
-<?php
-
-/**
- * Description of Respondent
- *
- * @author jkraaijeveld
- */
-class Respondent extends ResearchToolObject {
-   public $name;
-   public $password;
-   
-   /**
-    * Constructor for a Respondent object
-    * @param type $uid
-    * @param type $name
-    * @param type $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 148)
+++ 	(revision )
@@ -1,128 +1,0 @@
-<?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 	
-            {
-                    _respondent	predicates:resource_type	resources:respondent ;
-					predicates:uid ?uid ;
-					predicates:name ?name ;
-					predicates:password ?password ;
-          			predicates:uid ' . $uid . ' 
-					predicates:name ' . $name . ' 
-					predicates:password ' . $password . ' 
-            }';
-        //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));
-
-		//Set the new values
-        $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/Session.php
===================================================================
--- Dev/branches/jos-branch/classes/Session.php	(revision 148)
+++ 	(revision )
@@ -1,38 +1,0 @@
-<?php
-/**
- * Description of Session
- *
- * @author jkraaijeveld
- */
-
-class Session extends ResearchToolObject
-{
-	public $title;
-	public $datetime;
-	public $pipeline;
-	public $answersets;
-
-	
-	/**
-	 * Constructor for a Session object
-	 * @param type $uid
-	 * @param type $title
-	 * @param type $datetime
-	 * @param type $pipeline
-	 */
-	public function __construct($uid = null, $title = null, $datetime = null, $pipeline = null, $answersets = null)
-	{
-		if(!isset($uid))
-		{
-			$uid = md5(uniqid(rand(), true));
-		}
-		$this->uid = $uid;
-		$this->title = $title;
-		$this->datetime = $datetime;
-		$this->pipeline = $pipeline;
-		$this->answersets = $answersets;
-	}
-}	
-
-
-?>
Index: Dev/branches/jos-branch/classes/SessionConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/SessionConnector.php	(revision 148)
+++ 	(revision )
@@ -1,222 +1,0 @@
-<?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 SessionConnector
- *
- * @author jkraaijeveld
- */
-class SessionConnector implements IConnector
-{
-	protected $model;
-	protected $fileName = 'data/sessions/sessions.rdf';
-	protected $db;
-
-	/**
-	 * Constructor for the SessionConnector
-	 */
-	public function __construct()
-	{
-		//Ensure the required folder for this connector exists
-		if(!is_dir('data/sessions'))
-			mkdir('data/sessions');
-	}
-
-	/**
-	 * function load()
-	 * Loads the file into the standard MemModel
-	 */
-	public function load()
-	{
-		$this->model = ModelFactory::getDefaultModel();
-		if(file_exists($this->fileName))
-			$this->model->load($this->fileName);
-	}
-
-	/**
-	 * fucntion save()
-	 * Saves the MemModel into the given file.
-	 */
-	public function save()
-	{
-		$this->model->saveAs($this->fileName,'rdf');
-	}
-
-	/**
-	 * Get the Sessions corresponding to the arguments
-	 * @ param type $arguments
-	 * Arguments can be one or more of the following:
-	 * uid, title, datetime, applications, surveys, answersets
-	 * Where applications, surveys and answersets are arrays containing ids
-	 */
-	public function get($arguments)
-	{
-		$this->load();
-
-		$keys = array_keys($arguments);
-		$uid = ""; $title = ""; $datetime = ""; $applications = ""; $surveys = ""; $answersets = "";
-		if(in_array("uid", $keys))
-			$uid = 'predicates:uid \''.$arguements["uid"].'\' ';
-		if(in_array("title", $keys))
-			$title = 'predicates:title \''.$arguments["title"].'\' ';
-		if(in_array("datetime", $keys))
-			$datetime = 'predicates:datetime \''.$arguments["datetime"].'\' ';
-		if(in_array("applications", $keys))
-		{
-			foreach($arguments["applications"] as $application)
-			{
-				$applications = $applications . 'predicates:has_application \'' . $application . '\' ';
-			}
-		}
-		if(in_array("surveys", $keys))
-		{
-			foreach($arguments["surveys"] as $survey)
-			{
-				$surveys = $surveys . 'predicates:has_survey \'' . $survey . '\' ';
-			}
-		}
-		if(in_array("answersets", $keys))
-		{
-			foreach($arguments["answersets"] as $answerset)
-			{
-				$answersets = $answersets . 'predicates:has_answerset \'' . $answerset . '\' ';
-			}
-		}
-	
-		//Build the query string
-		$querystring = '
-			PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-			PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-			SELECT DISTINCT ?uid, ?title, ?datetime
-			WHERE
-			{
-				_session predicates:resource_type resources:session ;
-				predicates:uid ?uid ;
-				predicates:title ?title ;
-				' . $uid . $title . $datetime . $applications . $surveys . $answersets . '
-			}';
-		//Query the model
-		$results = $this->model->sparqlQuery($querystring);
-
-		$sessions = array();
-		if(!empty($results))
-		{
-			$this->db = new DatabaseInterface();
-			foreach($results as $result)
-			{
-				//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);
-				$datetime = new DateTime();
-				$datetime->setTimestamp(intval($result['?datetime']));
-				$sessions[] = new Session($result['?uid']->label, $result['?title']->label, $datetime, $pipeline, $answersets);
-			}
-		}
-		return $sessions;
-	}
-	/**
-	 * function getPipeline
-	 * Get the application and survey objects of the Session in order
-	 */
-	private function getPipeline($uid)
-	{
-		$result = $this->model->findRegex("[(".$uid.")]", "[(has_application)|(has_survey)]" ,null);
-		$iterator = $result->getStatementIterator();
-		$pipeline = array();
-		while($iterator->hasNext())
-		{
-			$element = $iterator->next();
-			if(strpos($element->getLabelPredicate(), "has_application") != false)
-			{
-				$applications = $this->db->get("application", array("uid" => $element->getLabelObject()));
-				$pipeline[] = $applications[0];
-			}
-			else
-			{
-				$surveys = $this->db->get("survey", array("uid" => $element->getLabelObject()));
-				$pipeline[] = $surveys[0];
-			}
-		}
-		return $pipeline;
-	}
-
-	/**
-	 * function getAnswerSets
-	 * Get the answersets belonging to the given session
-	 */
-	private function getAnswerSets($uid)
-	{
-		$result = $this->model->findRegex("[(".$uid.")]", "[(has_answerset)]" ,null);
-		$iterator = $result->getStatementIterator();
-		$answersets = array();
-		while($iterator->hasNext())
-		{
-			$element = $iterator->next();
-			$resultsets = $this->db->get("answerset", array("uid" => $element->getLabelObject()));
-			$answersets[] = $resultsets[0];
-		}
-		return $answersets;
-	}
-
-	/**
-	 * Save the given Session object in the file.
-	 * @param type $rToolObjects
-	 */
-	public function set($rToolObject)
-	{
-		$this->load();
-		$resourceSession = new Resource(SESSION . '/' . $rToolObject->uid);
-		//Remove the old value stored with the given id
-		$this->model->subtract($this->model->find($resourceSession, null, null));
-
-		//Set the new values
-		$resourceSessionType = new Resource(SESSION);
-		$predicateType = new Resource(RTYPE);
-		$this->model->add(new Statement($resourceSession, $predicateType, $resourceSessionType));
-
-		$sessionId = new Literal($rToolObject->uid);
-		$predicateId = new Resource(UID);
-		$this->model->add(new Statement($resourceSession, $predicateId, $sessionId));
-
-		$sessionTitle = new Literal($rToolObject->title);
-		$predicateTitle = new Resource(TITLE);
-		$this->model->add(new Statement($resourceSession, $predicateTitle, $sessionTitle));
-
-		$sessionTimestamp = new Literal($rToolObject->datetime->getTimestamp());
-		$predicateTimestamp = new Resource(DATETIME);
-		$this->model->add(new Statement($resourceSession, $predicateTimestamp, $sessionTimestamp));
-
-		//Create a sequence to store the different applications and surveys.
-		if(isset($rToolObject->pipeline))
-		{
-			foreach($rToolObject->pipeline as $element)
-			{
-				$sessionObject = new Literal($element->uid);
-				$predicateObject = null;
-				if(get_class($element) == "Application")
-					$predicateObject = new Resource(HAS_APPLICATION);
-				else if(get_class($element) == "Survey")
-					$predicateObject = new Resource(HAS_SURVEY);
-				if(isset($predicateObject))
-					$this->model->add(new Statement($resourceSession, $predicateObject, $sessionObject));
-			}
-		}
-
-		if(isset($rToolObject->answersets))
-		{
-			foreach($rToolObject->answersets as $answerset)
-			{
-				$sessionAnswerSet = new Literal($answerset->uid);
-				$predicateAnswerSet = new Resource(HAS_ANSWERSET);
-				$this->model->add(new Statement($resourceSession, $predicateAnswerSet, $sessionAnswerSet));
-			}
-		}
-
-		$this->save();
-	}
-}
-?>
-
Index: Dev/branches/jos-branch/classes/Survey.php
===================================================================
--- Dev/branches/jos-branch/classes/Survey.php	(revision 148)
+++ 	(revision )
@@ -1,27 +1,0 @@
-<?php
-
-/**
- * Description of Survey
- *
- * @author jkraaijeveld
- */
-class Survey extends ResearchToolObject{
-    public $title;
-    public $description;
-    public $creator;
-    public $questions;
-    
-    public function __construct($uid = null, $title = null, $description = null, $creator = null, $questions = null) {
-        if(!isset($uid))
-        {
-            $uid = md5(uniqid(rand(), true));
-        }
-        $this->uid = $uid;
-        $this->title = $title;
-		$this->description = $description;
-		$this->creator = $creator;
-        $this->questions = $questions;
-    }
-}
-
-?>
Index: Dev/branches/jos-branch/classes/SurveyConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/SurveyConnector.php	(revision 148)
+++ 	(revision )
@@ -1,188 +1,0 @@
-<?php
-
-/**
- * Description of SurveyConnector
- *
- * @author jkraaijeveld
- */
-class SurveyConnector implements IConnector{
-    protected $model;
-    protected $fileName = 'data/surveys/surveys.rdf';
-    protected $db;
-
-    /**
-     * Constructor for ApplicationConnector.
-     */
-    public function __construct()
-    {
-        //Ensure the required folder for this connector exists
-        if (!is_dir('data/surveys/'))
-            mkdir('data/surveys/');	
-    }
-    
-    /**
-     * 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 Survey objects belonging to arguments supplied.
-     * @param type $arguments : An array containing zero or more of the following keys:
-     *                          'uid', 'title', 'description', 'questions'
-     * Note: questions has to be an array of question IDs (codes) for this filter to work.
-     */
-    public function get($arguments)
-    {
-        $this->load();
-        
-        $keys = array_keys($arguments);
-        //Set default values for arguments
-        $uid = "?uid"; $title = "?title"; $description = "?description"; $creator = "?creator"; $questions = "";
-        if(in_array("uid", $keys))
-            $uid = '\''.$arguments["uid"].'\'';
-        if(in_array("title", $keys))
-            $title = '\''.$arguments["title"].'\'';
-        if(in_array("description", $keys))
-			$description = "\"".$arguments["description"]."\"";
-		if(in_array("creator", $keys))
-			$creator = "\"".$arguments["creator"]."\"";
-        if(in_array("questions", $keys))
-        {
-            //Append the questions string to filter for questions properly
-            foreach ($arguments["questions"] as $questionUid)
-            {
-                $questions = $questions . 'predicates:has_question \'' . $questionUid . '\' ';
-            }
-        }
-        
-        //Build the query string
-        $querystring = '
-            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-            SELECT DISTINCT ?uid, ?title, ?description, ?creator
-            WHERE
-            {
-                _survey     predicates:resource_type    resources:survey ;
-                predicates:uid ?uid ;
-                predicates:title ?title ;
-                predicates:description ?description ;
-                predicates:uid ' . $uid . ' 
-                predicates:title ' . $title . '
-				predicates:description ' . $description . '
-				predicates:creator ' . $creator . '
-                ' . $questions . '
-            }';
-        
-        //Query the model
-        $results = $this->model->sparqlQuery($querystring);
-        
-        //Create the corresponding Survey objects
-        $surveys = array();
-        if(!empty($results))
-        {
-            $this->db = new DatabaseInterface();
-            foreach($results as $result)
-            {
-				$questions = $this->getQuestions($result['?uid']->label);
-				$creator = $this->db->get("user", array("uid" => $result['?creator']->label));
-                $surveys[] = new Survey($result['?uid']->label, $result['?title']->label, $result['?description']->label, $creator[0], $questions);
-            }
-        }
-        return $surveys;
-    }
-    
-    /**
-     * Gets the questions corresponding to the survey
-     * @param type $uid 
-     */
-    private function getQuestions($uid)
-    {
-        //Create the querystring. Note that the UID is the only argument in this case.
-        $querystring = '
-            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-            SELECT DISTINCT ?has_question
-            WHERE
-            {
-                 _survey	predicates:resource_type	resources:survey ;
-                predicates:has_question ?has_question ; 
-                predicates:uid \'' . $uid . '\'
-            }';
-
-        $results = $this->model->sparqlQuery($querystring);
-        $questions = array();
-        //For every question id, get the corresponding question
-        if(!empty($results))
-        {
-            foreach($results as $questionId)
-            {
-                $resultQ = $this->db->get("question", array("uid" => $questionId['?has_question']->label));
-                $questions[] = $resultQ[0];
-            }
-        }
-        return $questions;
-    }
-    
-    /**
-     * Saves the given Survey object.
-     * @param type $rToolObject 
-     */
-    public function set($rToolObject)
-    {
-        $this->load();
-        
-        $resourceSurvey = new Resource(SURVEY.'/'.$rToolObject->uid);
-        //Remove the old value stored with the given id
-        $this->model->subtract($this->model->find($resourceSurvey, null, null));
-        
-        $resourceSurveyType = new Resource(SURVEY);
-        $predicateRType = new Resource(RTYPE);
-        $this->model->add(new Statement($resourceSurvey,$predicateRType,$resourceSurveyType));
-
-        $predicateUniqueID = new Resource(UID);
-        $literalSurveyID = new Literal($rToolObject->uid);
-        $this->model->add(new Statement($resourceSurvey,$predicateUniqueID,$literalSurveyID));
-
-        $predicateTitle = new Resource(TITLE);		
-        $surveyTitle = new Literal($rToolObject->title);
-        $this->model->add(new Statement($resourceSurvey,$predicateTitle,$surveyTitle));		
-
-        $predicateDescription = new Resource(DESCRIPTION);
-        $surveyDescription = new Literal($rToolObject->description);
-        $this->model->add(new Statement($resourceSurvey,$predicateDescription,$surveyDescription));
-        
-		$predicateCreator = new Resource(CREATOR);
-		$surveyCreator = new Literal($rToolObject->creator->uid);
-		$this->model->add(new Statement($resourceSurvey, $predicateCreator, $surveyCreator));
-
-        if(isset($rToolObject->questions))
-        {
-            foreach($rToolObject->questions as $question)
-            {
-                $questionUid = new Literal($question->uid);
-                $predicateQuid = new Resource(HAS_QUESTION);
-                $this->model->add(new Statement($resourceSurvey,$predicateQuid,$questionUid));
-            }
-        }
-        $this->save();
-    }
-}
-
-?>
Index: Dev/branches/jos-branch/classes/User.php
===================================================================
--- Dev/branches/jos-branch/classes/User.php	(revision 148)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<?php
-
-/**
- * Description of User
- *
- * @author jkraaijeveld
- */
-
-class User extends ResearchToolObject {
-    
-    public $name;
-    public $password;
-    
-    /**
-     * Constructor of User
-     * If the user does not yet exist in the database, call with null as first parameter
-     */
-    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/UserConnector.php
===================================================================
--- Dev/branches/jos-branch/classes/UserConnector.php	(revision 148)
+++ 	(revision )
@@ -1,127 +1,0 @@
-<?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 UserConnector
- *
- * @author jkraaijeveld
- */
-class UserConnector implements IConnector{
-    
-    protected $model;
-    protected $fileName = 'data/users/users.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 User 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 . ' 
-            }';
-        //Query the model
-        $results = $this->model->sparqlQuery($querystring);
-        $users = array();
-        if(!empty($results))
-        {
-            //Run over all results and create appropriate Application objets
-            foreach($results as $result)
-            { 
-                    $users[] = new User($result['?uid']->label, $result['?name']->label, $result['?password']->label);
-            }
-        }
-        return $users;
-    }
-    
-    /**
-     * Save the given User object in the file.
-     * @param type $rToolObject 
-     */
-    public function set($rToolObject)
-    {
-        $this->load();
-        $resourceUser = new Resource(USER . '/' . $rToolObject->uid);
-        //Remove the old value stored with the given id
-        $this->model->subtract($this->model->find($resourceUser, null, null));
-
-        $resourceUserType = new Resource(USER);
-        $predicateRType = new Resource(RTYPE);
-        $this->model->add(new Statement($resourceUser,$predicateRType,$resourceUserType));
-
-        $literalUserID = new Literal($rToolObject->uid);
-        $predicateUniqueID = new Resource(UID);
-        $this->model->add(new Statement($resourceUser,$predicateUniqueID,$literalUserID));
-        
-        $literalUserName = new Literal($rToolObject->name);
-        $predicateName = new Resource(NAME);
-        $this->model->add(new Statement($resourceUser,$predicateName,$literalUserName));			
-
-        $literalPassword = new Literal($rToolObject->password);
-        $predicatePassword = new Resource(PASSWORD);
-        $this->model->add(new Statement($resourceUser,$predicatePassword,$literalPassword));
-        $this->save();
-    }
-}
-
-?>
Index: Dev/branches/jos-branch/classes/master.php
===================================================================
--- Dev/branches/jos-branch/classes/master.php	(revision 148)
+++ 	(revision )
@@ -1,32 +1,0 @@
-<?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();
-}
