Index: Dev/trunk/classes/QuestionRDFReader.php
===================================================================
--- Dev/trunk/classes/QuestionRDFReader.php	(revision 91)
+++ Dev/trunk/classes/QuestionRDFReader.php	(revision 105)
@@ -31,43 +31,17 @@
     }
     
-    public function readQuestionByID($questionID)
+    public function readQuestionByCode($questionCode)
     {        
         $result = array();
-        $result['title'] = $this->readQuestionTitle($questionID);				
-        $result['description'] = $this->readQuestionDescription($questionID);
-        $result['type'] = $this->readQuestionType($questionID);
-        $result['code'] = $this->readQuestionCode($questionID);
-        $result['category'] = $this->readQuestionCategory($questionID);
-        $result['answers'] = $this->readQuestionAnswers($questionID);
+        $result['title'] = $this->readQuestionTitle($questionCode);				
+        $result['description'] = $this->readQuestionDescription($questionCode);
+        $result['type'] = $this->readQuestionType($questionCode);
+        $result['code'] = $this->readQuestionCode($questionCode);
+        $result['category'] = $this->readQuestionCategory($questionCode);
+        $result['answers'] = $this->readQuestionAnswers($questionCode);
 
         return $result;
     }
-    
-    public function readQuestionIDs()
-    {
-        $result = null;
-        
-        if(file_exists($this->filePath.'questions.rdf'))
-        {
-            // Create empty MemModel
-            $factory = new ModelFactory();
-            $tempmodel= $factory->getDefaultModel();
-            $tempmodel->load($this->filePath.'questions.rdf');
-
-            $querystring = '
-            PREFIX 	predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-            PREFIX	resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-            SELECT 	?questionID
-            WHERE 
-            {	
-                    _question	predicates:resource_type	resources:question ;
-                                predicates:uid			?questionID				
-            }';
-            
-            $result = $tempmodel->sparqlQuery($querystring);
-        }
-        return $result; 
-    }
-    
+     
     public function readQuestionCodes()
     {
@@ -96,5 +70,5 @@
     }
 
-    public function readQuestionTitle($questionID)
+    public function readQuestionTitle($questionCode)
     {
         $querystring = '
@@ -103,7 +77,7 @@
             SELECT  ?questionTitle
             WHERE 
-            {	
+            {
                     _question	predicates:resource_type	resources:question ;
-                                predicates:uid			"' . $questionID . '"  ;
+                                predicates:question_code    "' . $questionCode . '"  ;
                                 predicates:title		?questionTitle 		
             }';
@@ -114,5 +88,5 @@
     }
 
-    public function readQuestionDescription($questionID)
+    public function readQuestionDescription($questionCode)
     {
         $querystring = '
@@ -123,5 +97,5 @@
             {	
                     _question	predicates:resource_type	resources:question ;
-                                predicates:uid			"' . $questionID . '"  ;
+                                predicates:question_code        "' . $questionCode . '"  ;
                                 predicates:description		?questionDescription 		
             }';
@@ -132,5 +106,5 @@
     }
 
-    public function readQuestionType($questionID)
+    public function readQuestionType($questionCode)
     {
         $querystring = '
@@ -141,5 +115,5 @@
             {	
                     _question	predicates:resource_type	resources:question ;
-                                predicates:uid			"' . $questionID . '"  ;
+                                predicates:question_code	"' . $questionCode . '"  ;
                                 predicates:question_type	?questionType				
             }';
@@ -149,24 +123,6 @@
         return $result;
     }
-    
-    public function readQuestionCode($questionID)
-    {
-        $querystring = '
-            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
-            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
-            SELECT  ?questionCode
-            WHERE 
-            {	
-                    _question	predicates:resource_type	resources:question ;
-                                predicates:uid			"' . $questionID . '"  ;
-                                predicates:question_code	?questionCode				
-            }';
-
-        $result = $this->model->sparqlQuery($querystring);
-
-        return $result;
-    }
-    
-    public function readQuestionCategory($questionID)
+        
+    public function readQuestionCategory($questionCode)
     {
         $querystring = '
@@ -177,5 +133,5 @@
             {	
                     _question	predicates:resource_type	resources:question ;
-                                predicates:uid			"' . $questionID . '"  ;
+                                predicates:question_code	"' . $questionCode . '"  ;
                                 predicates:question_category	?questionCategory				
             }';
@@ -186,5 +142,5 @@
     }
 
-    public function readQuestionAnswers($questionID)
+    public function readQuestionAnswers($questionCode)
     {
         $querystring = '
@@ -195,5 +151,5 @@
             {
                     _question	predicates:resource_type	resources:question ;
-                                predicates:uid			"' . $questionID . '"  ;
+                                predicates:question_code	"' . $questionCode . '"  ;
                                 predicates:has_answer		?answerDescription
             }';
