/** * Send a request SPARQL of type insert data or delete data to endpoint directly. * If you want check the query before to send, it's better to use the function query() * in the class FourStore_StorePlus. * Example insert : PREFIX ex: <http://example.com/> INSERT DATA { GRAPH ex:mygraph { ex:a ex:p 12 .}} * Example delete : PREFIX ex: <http://example.com/> DELETE DATA { GRAPH ex:mygraph { ex:a ex:p 12 .}} * @param string $query : Query Sparql of type insert data or delete data only * @return boolean true if it did * @access public */ public function queryUpdate($query) { $post_endpoint = array_shift(explode("/sparql/", $this->_endpoint)) . "/update/"; $sUri = $post_endpoint; $data = array("update" => $query); $this->debugLog($query, $sUri); $client = new Curl_HTTP_Client(); $response = $client->send_post_data($sUri, $data); $code = $client->get_http_response_code(); $this->debugLog($query, $sUri, $code, $response); //FIXME in 4Store : check in the next version || $code == 0 || $code == 100 if ($code == 200) { return true; } else { $this->errorLog($query, $sUri, $code, $response); return false; } }