Changeset 45 for Dev/trunk/classes
- Timestamp:
- 07/25/11 15:11:23 (14 years ago)
- Location:
- Dev/trunk/classes
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/ApplicationDatabaseInterface.php
r40 r45 2 2 3 3 // Survey database interface class as intermediate for storing data from the site to the RDF database 4 require 'rdfConstants.php';4 require_once 'rdfConstants.php'; 5 5 6 6 // Include RAP Library to write RDF files 7 define("RDFAPI_INCLUDE_DIR", "rdfapi/");8 7 include(RDFAPI_INCLUDE_DIR . "RDFAPI.php"); 9 8 -
Dev/trunk/classes/ApplicationRDFReader.php
r40 r45 11 11 $this->model = $factory->getDefaultModel(); 12 12 13 $fileName = ' applications/applications.rdf';13 $fileName = 'data/applications/applications.rdf'; 14 14 15 15 if(file_exists($fileName)) -
Dev/trunk/classes/ApplicationRDFWriter.php
r40 r45 4 4 { 5 5 protected $model; 6 protected $fileName = ' applications/applications.rdf';6 protected $fileName = 'data/applications/applications.rdf'; 7 7 8 8 public function __construct($applicationID) -
Dev/trunk/classes/SurveyAnswerDatabaseInterface.php
r40 r45 2 2 3 3 // Survey class as intermediate for storing data from the site to the RDF database 4 require 'rdfConstants.php';4 require_once 'rdfConstants.php'; 5 5 6 6 // Include RAP Library to write RDF files 7 define("RDFAPI_INCLUDE_DIR", "rdfapi/");8 7 include(RDFAPI_INCLUDE_DIR . "RDFAPI.php"); 9 8 -
Dev/trunk/classes/SurveyAnswerRDFReader.php
r40 r45 4 4 { 5 5 protected $tempModel; 6 protected $answerPath 6 7 7 8 public function __construct($surveyUID) … … 12 13 $factory = new ModelFactory(); 13 14 $this->tempModel = $factory->getDefaultModel(); 15 $this->answerPath = 'data/surveys/answers_'.$this->surveyUID; 14 16 } 15 17 … … 24 26 $this->tempModel->loadModel($this->model); 25 27 26 $answerPath = 'surveys/answers_'.$this->surveyUID;27 28 $answers = array(); 28 29 29 if($handle = opendir( '$answerPath'))30 if($handle = opendir($this->answerPath)) 30 31 { 31 32 while (false !== ($file = readdir($handle))) { … … 37 38 foreach($answers as $answer) 38 39 { 39 $this->tempModel->load($ answerPath.'/'.$answer);40 $this->tempModel->load($this->answerPath.'/'.$answer); 40 41 } 41 42 … … 66 67 $this->tempModel->loadModel($this->model); 67 68 68 $answerPath = 'surveys/answers_'.$this->surveyUID; 69 70 $this->tempModel->load($answerPath . '/$answer_' . $respondentID); 69 $this->tempModel->load($this->answerPath . '/$answer_' . $respondentID); 71 70 72 71 $this->tempModel->visualize(); … … 94 93 { 95 94 $this->tempModel->loadModel($this->model); 96 97 $answerPath = 'surveys/answers_'.$this->surveyUID; 98 99 $this->tempModel->load($answerPath . '/$answer_' . $respondentID); 95 96 $this->tempModel->load($this->answerPath . '/$answer_' . $respondentID); 100 97 101 98 $this->tempModel->visualize(); -
Dev/trunk/classes/SurveyAnswerRDFWriter.php
r40 r45 4 4 { 5 5 protected $userUID; 6 protected $answerPath 6 7 7 8 public function __construct($surveyUID,$userUID) … … 10 11 11 12 $this->userUID = $userUID; 13 $this->answerPath = 'data/surveys/answers_'.$this->surveyUID; 12 14 } 13 15 14 16 public function saveSurvey() 15 17 { 16 $answerPath = 'surveys/answers_'.$this->surveyUID; 17 if (!is_dir($answerPath)) 18 mkdir($answerPath); 19 $this->model->saveAs($answerPath.'/answer_'.$this->userUID.'.rdf','rdf'); 18 if (!is_dir($this->answerPath)) 19 mkdir($this->answerPath); 20 $this->model->saveAs($this->answerPath.'/answer_'.$this->userUID.'.rdf','rdf'); 20 21 } 21 22 22 23 public function setRespondentData($name) 23 24 { 24 $resourceUser = new Resource(USER); 25 $resourceUser = new Resource(USER . '/' . $userID); 26 27 $resourceUserType = new Resource(USER); 28 $predicateRType = new Resource(RTYPE); 29 $this->model->add(new Statement($resourceUser,$predicateRType,$resourceUserType)); 25 30 26 31 $LiteralUserName = new Literal($name); -
Dev/trunk/classes/SurveyDatabaseInterface.php
r44 r45 99 99 $surveys = array(); 100 100 101 if($handle = opendir(' surveys/'))101 if($handle = opendir('data/surveys/')) 102 102 { 103 103 while (false !== ($file = readdir($handle))) { -
Dev/trunk/classes/SurveyRDFReader.php
r44 r45 6 6 7 7 protected $surveyUID; 8 protected $filePath; 8 9 9 10 public function __construct($surveyUID) … … 14 15 15 16 $this->surveyUID = $surveyUID; 17 $this->filePath = 'data/surveys/survey_'.$this->surveyUID.'.rdf'; 16 18 } 17 19 18 20 public function loadSurvey() 19 21 { 20 $this->model->load( 'surveys/survey_'.$this->surveyUID.'.rdf');22 $this->model->load($this->filePath); 21 23 } 22 24 … … 155 157 $factory = new ModelFactory(); 156 158 $tempmodel= $factory->getDefaultModel(); 157 $tempmodel->load(' surveys/survey_'.$surveyID.'.rdf');159 $tempmodel->load('data/surveys/survey_'.$surveyID.'.rdf'); 158 160 159 161 $querystring = ' -
Dev/trunk/classes/SurveyRDFWriter.php
r44 r45 7 7 protected $resourceSurvey; 8 8 protected $surveyUID; 9 protected $filePath; 9 10 10 11 public function __construct($surveyUID) … … 15 16 16 17 $this->surveyUID = $surveyUID; 18 $this->filePath = 'data/surveys/survey_'.$this->surveyUID.'.rdf'; 17 19 18 20 } … … 20 22 public function saveSurvey() 21 23 { 22 $this->model->saveAs( 'surveys/survey_'.$this->surveyUID.'.rdf','rdf');24 $this->model->saveAs($this->filePath); 23 25 } 24 26 -
Dev/trunk/classes/UserRDFReader.php
r44 r45 4 4 { 5 5 protected $model; 6 protected $fileName = 'data/users/users.rdf'; 6 7 7 8 public function __construct() … … 11 12 $this->model = $factory->getDefaultModel(); 12 13 13 $fileName = 'users/users.rdf';14 14 15 if(file_exists($ fileName))16 $this->model->load($ fileName);15 if(file_exists($this->fileName)) 16 $this->model->load($this->fileName); 17 17 } 18 18 -
Dev/trunk/classes/UserRDFWriter.php
r44 r45 5 5 6 6 protected $model; 7 protected $fileName = ' users/users.rdf';7 protected $fileName = 'data/users/users.rdf'; 8 8 9 9 public function __construct()
Note: See TracChangeset
for help on using the changeset viewer.