Index: Dev/trunk/classes/SurveyRDFReader.php
===================================================================
--- Dev/trunk/classes/SurveyRDFReader.php	(revision 14)
+++ Dev/trunk/classes/SurveyRDFReader.php	(revision 16)
@@ -20,8 +20,8 @@
 	{
 		$querystring = '
-			PREFIX 	predicate: <' .SURVEYTOOL_PREDICATES_NAMESPACE . '>
-			PREFIX	namespace: <' . SURVEYTOOL_NAMESPACE . '>
-			SELECT 	?surveyTitle 
-			WHERE 	{ namespace:Survey predicate:title ?surveyTitle }';
+			PREFIX 	predicates: <' .SURVEYTOOL_PREDICATES_NAMESPACE . '>
+			PREFIX	resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+			SELECT 	?title
+			WHERE 	{ resources:survey predicates:title ?title }';
 			
 		$result = $this->model->sparqlQuery($querystring);
@@ -30,11 +30,11 @@
 	}
 	
-		public function readSurveyDescription()
+	public function readSurveyDescription()
 	{
 		$querystring = '
-			PREFIX 	predicate: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-			PREFIX	namespace: <' . SURVEYTOOL_NAMESPACE . '>
-			SELECT 	?surveyDescription 
-			WHERE 	{ namespace:Survey predicate:description ?surveyDescription }';
+			PREFIX 	predicates: <' .SURVEYTOOL_PREDICATES_NAMESPACE . '>
+			PREFIX	resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+			SELECT 	?description 
+			WHERE 	{ resources:survey predicates:description ?description }';
 			
 		$result = $this->model->sparqlQuery($querystring);
Index: Dev/trunk/classes/SurveyRDFWriter.php
===================================================================
--- Dev/trunk/classes/SurveyRDFWriter.php	(revision 14)
+++ Dev/trunk/classes/SurveyRDFWriter.php	(revision 16)
@@ -6,7 +6,4 @@
 		
 	var $resourceSurvey;
-	var $resourceTitle;
-	var $resourceDescription;
-	
     /**
     * Use SurveyRDFWriter::getInstance() instead of this
@@ -25,16 +22,54 @@
 	{
 		
-		$this->resourceSurvey = new Resource(SURVEYTOOL_NAMESPACE.'Survey');
-		$this->resourceTitle = new Resource(TITLE);
-		$this->resourceDescription = new Resource(DESCRIPTION);
+		$this->resourceSurvey = new Resource(SURVEY);
 	}
 	
 	public function createSurvey($sTitle, $sDescription)
 	{		
+		
+		$predicateTitle = new Resource(TITLE);		
 		$surveyTitle = new Literal($sTitle);
-		$this->model->add(new Statement($this->resourceSurvey,$this->resourceTitle,$surveyTitle));		
+		$this->model->add(new Statement($this->resourceSurvey,$predicateTitle,$surveyTitle));		
 		
+		$predicateDescription = new Resource(DESCRIPTION);
 		$surveyDescription = new Literal($sDescription);
-		$this->model->add(new Statement($this->resourceSurvey,$this->resourceDescription,$surveyDescription));	
+		$this->model->add(new Statement($this->resourceSurvey,$predicateDescription,$surveyDescription));		
+	}
+	
+	public function addQuestion($qTitle,$qDescription,$qType,$qAnswers)
+	{
+		$resourceQuestion = new Resource(QUESTION);
+		$predicateQuestion = new Resource(HAS_QUESTION);
+		$this->model->add(new Statement($this->resourceSurvey,$predicateQuestion,$resourceQuestion));
+		
+		$predicateTitle = new Resource(TITLE);		
+		$questionTitle = new Literal($qTitle);
+		$this->model->add(new Statement($resourceQuestion,$predicateTitle,$questionTitle));	
+		
+		$predicateDescription = new Resource(DESCRIPTION);
+		$questionDescription = new Literal($qDescription);
+		$this->model->add(new Statement($resourceQuestion,$predicateDescription,$questionDescription));		
+		
+		$predicateType = new Resource(TYPE);
+		$resourceQuestionType = new Resource(QUESTION_TYPE);
+		$this->model->add(new Statement($resourceQuestion,$predicateType,$resourceQuestionType));
+		
+		foreach($qAnswers as $answer)
+		{
+			$resourceAnswer = new Resource(ANSWER);
+			$predicateAnswer = new Resource(HAS_ANSWER);	
+			$this->model->add(new Statement($resourceQuestion,$predicateAnswer,$resourceAnswer));
+			
+			$predicateTitle = new Resource(TITLE);
+			$answerTitle = new Literal($answer['Title']);
+			$this->model->add(new Statement($resourceAnswer,$predicateTitle,$answerTitle));
+			
+			$predicateDescription = new Resource(DESCRIPTION);
+			$answerDescription = new Literal($answer['Description']);
+			$this->model->add(new Statement($resourceAnswer,$predicateDescription,$answerDescription));
+			
+		}
+		
+		
 	}
 	
