public function EasyRdf_GraphStore::delete

Delete a graph from the graph store

The URI can either be a full absolute URI or a URI relative to the URI of the graph store.

Parameters

string $uriRef The URI of graph to be added to:

Return value

object EasyRdf_Http_Response The response from the graph store

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/GraphStore.php, line 179

Class

EasyRdf_GraphStore
A class for fetching, saving and deleting graphs to a Graph Store. Implementation of the SPARQL 1.1 Graph Store HTTP Protocol.

Code

public function delete($uriRef) {
  $graphUri = $this->parsedUri
    ->resolve($uriRef)
    ->toString();
  $dataUrl = $this
    ->urlForGraph($graphUri);
  $client = EasyRdf_Http::getDefaultHttpClient();
  $client
    ->resetParameters(true);
  $client
    ->setUri($dataUrl);
  $client
    ->setMethod('DELETE');
  $response = $client
    ->request();
  if (!$response
    ->isSuccessful()) {
    throw new EasyRdf_Exception("HTTP request to delete {$dataUrl} failed: " . $response
      ->getMessage());
  }
  return $response;
}