コード例 #1
0
 function dump()
 {
     /* this method create the base if it is new */
     if (!$this->exist()) {
         $prefixes[] = "@prefix ktbs: <http://liris.cnrs.fr/silex/2009/ktbs#>.";
         $prefixes[] = "@prefix owl: <http://www.w3.org/2002/07/owl#>.";
         $prefixes[] = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.";
         $prefixes[] = "@prefix rdfrest: <http://liris.cnrs.fr/silex/2009/rdfrest#>.";
         $prefixes[] = "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.";
         $prefixes[] = "@prefix xml: <http://www.w3.org/XML/1998/namespace>.";
         $prefixes[] = "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.";
         $statements[] = "<> ktbs:hasBase <" . $this->Base_name . "> .";
         $statements[] = "<" . $this->Base_name . "> a ktbs:Base .";
         $statements[] = "<" . $this->Base_name . "> rdfs:label " . '"' . "Transform base" . '"' . " .";
         $script = implode("\n", $prefixes) . "\n" . implode("\n", $statements);
         $req = RestfulHelper::post($this->root, $script);
         if ($req == true) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
コード例 #2
0
 function dump()
 {
     if (!$this->exist()) {
         $prefixes[] = "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.";
         $prefixes[] = "@prefix : <http://liris.cnrs.fr/silex/2009/ktbs#>.";
         $statements[] = "<> :contains <" . $this->name . ">.";
         $statements[] = "<" . $this->name . "> a :TraceModel.";
         $statements[] = "<" . $this->name . "> rdfs:label " . '"' . "An example model" . '"' . " .";
         $script = implode("\n", $prefixes) . "\n" . implode("\n", $statements);
         RestfulHelper::post($this->base_uri, $script);
     }
 }
コード例 #3
0
 function sparql()
 {
     if ($this->hasMethod == 'sparql') {
         $tr = $this->hasSource[0];
         if ($this->model_uri == null) {
             $this->model_uri = $tr->getModel();
         }
         $this->hasParameter[] = '"model=' . $this->model_uri . '"';
         $prefixes[] = "@prefix : <http://liris.cnrs.fr/silex/2009/ktbs#> .";
         $statements[] = "<> :contains <" . $this->name . "> .";
         $statements[] = "<" . $this->name . "> a :ComputedTrace ;";
         $statements[] = ":hasMethod :sparql ;";
         $statements[] = ":hasSource " . $this->listSources() . " ;";
         $statements[] = ':hasParameter ' . implode(',', $this->hasParameter) . ' .';
         $this->script = implode("\n", $prefixes) . "\n" . implode("\n", $statements);
         $this->result = RestfulHelper::post($this->base_uri, $this->script);
         if ($this->model_uri != $tr->getModel()) {
             $model = new TraceModel($this->model_uri);
             $Gene = new GenerateModel($this->uri, $model->getName());
             $Gene->PutModel();
         }
     }
 }
コード例 #4
0
 public function dump()
 {
     $prefixes[] = "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .";
     $prefixes[] = "@prefix ktbs: <http://liris.cnrs.fr/silex/2009/ktbs#> .";
     $prefixes[] = "@prefix : <" . $this->type . "/> .";
     $statements[] = "<" . $this->name . "> a <" . $this->type . ">.";
     $statements[] = "<" . $this->name . "> ktbs:hasTrace <> .";
     $statements[] = "<" . $this->name . "> ktbs:hasSubject " . '"' . $this->Subject . '"' . " .";
     $statements[] = "<" . $this->name . "> :hasDate " . '"' . $this->hasDate . '"' . " .";
     //user information
     $statements[] = "<" . $this->name . "> :hasUser_UserID " . '"' . $this->UserID . '"' . " .";
     $statements[] = "<" . $this->name . "> :hasUser_UserName " . '"' . $this->UserName . '"' . " .";
     $statements[] = "<" . $this->name . "> :hasUser_FirstName " . '"' . $this->FirstName . '"' . " .";
     $statements[] = "<" . $this->name . "> :hasUser_LastName " . '"' . $this->LastName . '"' . " .";
     // tool information
     if ($this->WorkspaceName) {
         $statements[] = "<" . $this->name . "> :hasTool_WorkspaceName " . '"' . $this->WorkspaceName . '"' . " .";
     }
     if ($this->ResourceNode) {
         $statements[] = "<" . $this->name . "> :hasTool_ResourceName " . '"' . $this->ResourceNode . '"' . " .";
     }
     if ($this->ResourcePath) {
         $statements[] = "<" . $this->name . "> :hasTool_ResourcePath " . '"' . $this->ResourcePath . '"' . " .";
     }
     if ($this->ResourceType) {
         $statements[] = "<" . $this->name . "> :hasTool_ResourceType " . '"' . $this->ResourceType . '"' . " .";
     }
     if ($this->oldName) {
         $statements[] = "<" . $this->name . "> :hasTool_OldName " . '"' . $this->oldName . '"' . " .";
     }
     // forum
     if ($this->newName) {
         $statements[] = "<" . $this->name . "> :hasTool_NewName " . '"' . $this->newName . '"' . " .";
     }
     if ($this->CategoryId) {
         $statements[] = "<" . $this->name . "> :hasTool_CategoryId " . '"' . $this->CategoryId . '"' . " .";
     }
     if ($this->subjectId) {
         $statements[] = "<" . $this->name . "> :hasTool_subjectId " . '"' . $this->subjectId . '"' . " .";
     }
     if ($this->MessageId) {
         $statements[] = "<" . $this->name . "> :hasTool_MessageId " . '"' . $this->MessageId . '"' . " .";
     }
     if ($this->subjectold_title) {
         $statements[] = "<" . $this->name . "> :hasTool_subjectOldContent " . '"' . $this->subjectold_title . '"' . " .";
     }
     if ($this->subjectNew_title) {
         $statements[] = "<" . $this->name . "> :hasTool_subjectNew_title " . '"' . $this->subjectNew_title . '"' . " .";
     }
     if ($this->MessageOldContent) {
         $statements[] = "<" . $this->name . "> :hasTool_MessageOldContent " . '"' . $this->MessageOldContent . '"' . " .";
     }
     if ($this->Messagenew_content) {
         $statements[] = "<" . $this->name . "> :hasTool_Messagenew_content " . '"' . $this->Messagenew_content . '"' . " .";
     }
     //blog
     if ($this->postTitle) {
         $statements[] = "<" . $this->name . "> :hasTool_Post_Title " . '"' . $this->postTitle . '"' . " .";
     }
     //exercice
     if ($this->ExerciceId) {
         $statements[] = "<" . $this->name . "> :hasTool_Exercice_Id " . '"' . $this->ExerciceId . '"' . " .";
     }
     if ($this->Exercisetitle) {
         $statements[] = "<" . $this->name . "> :hasTool_Exercise_Title " . '"' . $this->Exercisetitle . '"' . " .";
     }
     if ($this->ExerciseResult) {
         $statements[] = "<" . $this->name . "> :hasTool_Exercise_Result " . '"' . $this->ExerciseResult . '"' . " .";
     }
     if ($this->BlogId) {
         $statements[] = "<" . $this->name . "> :hasTool_BlogId " . '"' . $this->BlogId . '"' . " .";
     }
     if ($this->postBlogId) {
         $statements[] = "<" . $this->name . "> :hasTool_postBlogId " . '"' . $this->postBlogId . '"' . " .";
     }
     if ($this->blog_authorizeComment !== null) {
         $statements[] = "<" . $this->name . "> :hasTool_blog_authorizeComment " . '"' . $this->blog_authorizeComment . '"' . " .";
     }
     if ($this->blog_authorizeAnonymousComment !== null) {
         $statements[] = "<" . $this->name . "> :hasTool_blog_authorizeAnonymousComment " . '"' . $this->blog_authorizeAnonymousComment . '"' . " .";
     }
     if ($this->blog_autoPublishPost !== null) {
         $statements[] = "<" . $this->name . "> :hasTool_blog_autoPublishPost " . '"' . $this->blog_autoPublishPost . '"' . " .";
     }
     if ($this->blog_autoPublishComment !== null) {
         $statements[] = "<" . $this->name . "> :hasTool_blog_autoPublishComment " . '"' . $this->blog_autoPublishComment . '"' . " .";
     }
     $this->script = implode("\n", $prefixes) . "\n" . implode("\n", $statements);
     $this->numAttr = count($statements);
     $this->result = RestfulHelper::post($this->trace_uri, $this->script);
 }
コード例 #5
0
 function dump()
 {
     if (!$this->exist()) {
         $prefixes[] = "@prefix : <http://liris.cnrs.fr/silex/2009/ktbs#> .";
         $statements[] = "<> :contains <" . $this->name . "> .";
         $statements[] = "<" . $this->name . "> a :StoredTrace .";
         $statements[] = "<" . $this->name . "> :hasModel <" . $this->model_uri . "> .";
         $statements[] = "<" . $this->name . "> :hasOrigin " . '"' . $this->hasOrigin . '"' . " .";
         $statements[] = "<" . $this->name . "> :hasDefaultSubject " . '"' . "trace for activity" . '"' . " .";
         $this->script = implode("\n", $prefixes) . "\n" . implode("\n", $statements);
         $this->result = RestfulHelper::post($this->base_uri, $this->script);
     }
 }