model = $factory->getDefaultModel(); $this->sessionUID = $sessionUID; $this->filePath = 'data/sessions/'; if (!is_dir($this->filePath)) mkdir($this->filePath); } public function saveAs() { $this->model->saveAs($this->filePath. 'session_' . $this->surveyUID . '/.' . $this->surveyUID .'.rdf', 'rdf'); } public function createSession($sTitle,$sDescription) { $this->resourceSession = new Resource(SESSION.'/'.$this->sessionUID); $resourceSessionType = new Resource(SESSION); $predicateRType = new Resource(RTYPE); $this->model->add(new Statement($this->resourceSession,$predicateRType,$resourceSessionType)); $literalSessionID = new Literal($this->sessionUID); $predicateUniqueID = new Resource(UID); $this->model->add(new Statement($this->resourceSession,$predicateUniqueID,$literalSessionID)); $predicateTitle = new Resource(TITLE); $sessionTitle = new Literal($sTitle); $this->model->add(new Statement($this->resourceSession,$predicateTitle,$sessionTitle)); $predicateDescription = new Resource(DESCRIPTION); $sessionDescription = new Literal($sDescription); $this->model->add(new Statement($this->resourceSession,$predicateDescription,$sessionDescription)); } public function addSurveyToPipeline($uid,$index) { $resourceSurvey = new Resource(SURVEY); $predicateHasProcess = new Resource(HAS_PROCESS); $this->model->add(new Statement($this->resourceSession,$predicateHasProcess,$resourceSurvey)); $literalSurveyID = new Literal($uid); $predicateUID = new Resource(UID); $this->model->add(new Statement($$resourceSurvey,$predicateUID,$literalSurveyID)); $literalIndex = new Literal($index); $predicateIndex = new Resource(INDEX); $this->model->add(new Statement($resourceSurvey,$predicateIndex,$literalIndex)); } public function addApplicationToPipeline($uid,$index) { $resourceApplication = new Resource(APPLICATION); $predicateHasProcess = new Resource(HAS_PROCESS); $this->model->add(new Statement($this->resourceSession,$predicateHasProcess,$resourceApplication)); $literalApplicationID = new Literal($uid,$index); $predicateUID = new Resource(UID); $this->model->add(new Statement($resourceApplication,$predicateUID,$literalApplicationID)); $literalIndex = new Literal($index); $predicateIndex = new Resource(INDEX); $this->model->add(new Statement($resourceApplication,$predicateIndex,$literalIndex)); } public function addDashboardToPipeline($uid,$index) { $resourceDashboard = new Resource(DASHBOARD); $predicateHasProcess = new Resource(HAS_PROCESS); $this->model->add(new Statement($this->resourceSession,$predicateHasProcess,$resourceDashboard)); $literalDashboardID = new Literal($uid); $predicateUID = new Resource(UID); $this->model->add(new Statement($resourceDashboard,$predicateUID,$literalDashboardID)); $literalIndex = new Literal($index); $predicateIndex = new Resource(INDEX); $this->model->add(new Statement($resourceDashboard,$predicateIndex,$literalIndex)); } } ?>