/**
  * 
  *  
  * @param mixed $uri
  *  
  * @author Frederick Giasson, Structured Dynamics LLC.
  */
 public function deleteProperty($uri)
 {
     if ($this->isValid()) {
         if ($uri == "") {
             $this->ws->returnError(400, "Bad Request", "_202");
             return;
         }
         $this->initiateOwlBridgeSession();
         $this->getOntologyReference();
         // Delete the OWLAPI property entity
         $this->ws->ontology->removeProperty($uri);
         // Check to delete potential datasets that have been created within structWSF
         $crudDelete = new CrudDelete($uri, $this->ws->ontologyUri, $this->ws->registered_ip, $this->ws->requester_ip);
         $crudDelete->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], $_SERVER['HTTP_ACCEPT_LANGUAGE']);
         $crudDelete->process();
         if ($crudDelete->pipeline_getResponseHeaderStatus() != 200) {
             $this->ws->conneg->setStatus($crudDelete->pipeline_getResponseHeaderStatus());
             $this->ws->conneg->setStatusMsg($crudDelete->pipeline_getResponseHeaderStatusMsg());
             $this->ws->conneg->setStatusMsgExt($crudDelete->pipeline_getResponseHeaderStatusMsgExt());
             $this->ws->conneg->setError($crudDelete->pipeline_getError()->id, $crudDelete->pipeline_getError()->webservice, $crudDelete->pipeline_getError()->name, $crudDelete->pipeline_getError()->description, $crudDelete->pipeline_getError()->debugInfo, $crudDelete->pipeline_getError()->level);
             return;
         }
         // Update the name of the file of the ontology to mark it as "changed"
         $this->ws->ontology->addOntologyAnnotation("http://purl.org/ontology/wsf#ontologyModified", "true");
     }
 }
 /**
  * Update the URI of an entity
  * 
  * @param mixed $oldUri
  * @param mixed $newUri
  * @param mixed $advancedIndexation
  *  
  * @author Frederick Giasson, Structured Dynamics LLC.
  */
 public function updateEntityUri($oldUri, $newUri, $advancedIndexation)
 {
     $this->initiateOwlBridgeSession();
     $this->getOntologyReference();
     if ($this->isValid()) {
         if ($oldUri == "") {
             $this->ws->returnError(400, "Bad Request", "_202");
             return;
         }
         if ($newUri == "") {
             $this->ws->returnError(400, "Bad Request", "_203");
             return;
         }
         $this->ws->ontology->updateEntityUri($oldUri, $newUri);
         if ($advancedIndexation === TRUE) {
             // Find the type of entity manipulated here
             $entity = $this->ws->ontology->_getEntity($newUri);
             $function = "";
             $params = "";
             if ((bool) java_values($entity->isOWLClass())) {
                 $function = "getClass";
                 $params = "uri=" . $newUri;
             } elseif ((bool) java_values($entity->isOWLDataProperty()) || (bool) java_values($entity->isOWLObjectProperty()) || (bool) java_values($entity->isOWLAnnotationProperty())) {
                 $function = "getProperty";
                 $params = "uri=" . $newUri;
             } elseif ((bool) java_values($entity->isNamedIndividual())) {
                 $function = "getNamedIndividual";
                 $params = "uri=" . $newUri;
             } else {
                 return;
             }
             // Get the description of the newly updated entity.
             $ontologyRead = new OntologyRead($this->ws->ontologyUri, $function, $params, $this->ws->registered_ip, $this->ws->requester_ip);
             // Since we are in pipeline mode, we have to set the owlapisession using the current one.
             // otherwise the java bridge will return an error
             $ontologyRead->setOwlApiSession($this->OwlApiSession);
             $ontologyRead->ws_conneg("application/rdf+xml", $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], $_SERVER['HTTP_ACCEPT_LANGUAGE']);
             if ($this->ws->reasoner) {
                 $ontologyRead->useReasoner();
             } else {
                 $ontologyRead->stopUsingReasoner();
             }
             $ontologyRead->process();
             if ($ontologyRead->pipeline_getResponseHeaderStatus() != 200) {
                 $this->ws->conneg->setStatus($ontologyRead->pipeline_getResponseHeaderStatus());
                 $this->ws->conneg->setStatusMsg($ontologyRead->pipeline_getResponseHeaderStatusMsg());
                 $this->ws->conneg->setStatusMsgExt($ontologyRead->pipeline_getResponseHeaderStatusMsgExt());
                 $this->ws->conneg->setError($ontologyRead->pipeline_getError()->id, $ontologyRead->pipeline_getError()->webservice, $ontologyRead->pipeline_getError()->name, $ontologyRead->pipeline_getError()->description, $ontologyRead->pipeline_getError()->debugInfo, $ontologyRead->pipeline_getError()->level);
                 return;
             }
             $entitySerialized = $ontologyRead->pipeline_serialize();
             unset($ontologyRead);
             // Delete the old entity in Solr
             // Update the classes and properties into the Solr index
             $crudDelete = new CrudDelete($oldUri, $this->ws->ontologyUri, $this->ws->registered_ip, $this->ws->requester_ip);
             $crudDelete->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], $_SERVER['HTTP_ACCEPT_LANGUAGE']);
             $crudDelete->process();
             if ($crudDelete->pipeline_getResponseHeaderStatus() != 200) {
                 $this->ws->conneg->setStatus($crudDelete->pipeline_getResponseHeaderStatus());
                 $this->ws->conneg->setStatusMsg($crudDelete->pipeline_getResponseHeaderStatusMsg());
                 $this->ws->conneg->setStatusMsgExt($crudDelete->pipeline_getResponseHeaderStatusMsgExt());
                 $this->ws->conneg->setError($crudDelete->pipeline_getError()->id, $crudDelete->pipeline_getError()->webservice, $crudDelete->pipeline_getError()->name, $crudDelete->pipeline_getError()->description, $crudDelete->pipeline_getError()->debugInfo, $crudDelete->pipeline_getError()->level);
                 return;
             }
             unset($crudDelete);
             // Add the new entity in Solr
             // Update the classes and properties into the Solr index
             $crudCreate = new CrudCreate($entitySerialized, "application/rdf+xml", "full", $this->ws->ontologyUri, $this->ws->registered_ip, $this->ws->requester_ip);
             $crudCreate->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], $_SERVER['HTTP_ACCEPT_LANGUAGE']);
             $crudCreate->process();
             if ($crudCreate->pipeline_getResponseHeaderStatus() != 200) {
                 $this->ws->conneg->setStatus($crudCreate->pipeline_getResponseHeaderStatus());
                 $this->ws->conneg->setStatusMsg($crudCreate->pipeline_getResponseHeaderStatusMsg());
                 $this->ws->conneg->setStatusMsgExt($crudCreate->pipeline_getResponseHeaderStatusMsgExt());
                 $this->ws->conneg->setError($crudCreate->pipeline_getError()->id, $crudCreate->pipeline_getError()->webservice, $crudCreate->pipeline_getError()->name, $crudCreate->pipeline_getError()->description, $crudCreate->pipeline_getError()->debugInfo, $crudCreate->pipeline_getError()->level);
                 return;
             }
             unset($crudCreate);
         }
         // Update the name of the file of the ontology to mark it as "changed"
         $this->ws->ontology->addOntologyAnnotation("http://purl.org/ontology/wsf#ontologyModified", "true");
     }
 }