Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
DatasetDeleteQuery Class Reference

Dataset Delete Query to a OSF Dataset Delete web service endpoint. More...

Inheritance diagram for DatasetDeleteQuery:

Public Member Functions

 __construct ($network, $appID, $apiKey, $userID)
 Constructor. More...
 uri ($uri)
 Specifies the URI of the dataset to delete. More...

Detailed Description

Dataset Delete Query to a OSF Dataset Delete web service endpoint.

The Dataset: Delete Web service is used to delete an existing dataset in a WSF (Web Services Framework). When a dataset gets deleted, all of the information archived in it is deleted as well. There is no way to recover any data once this query is issued.

Here is a code example of how this class can be used by developers:

use \StructuredDynamics\osf\php\api\ws\dataset\create\DatasetCreateQuery;
use \StructuredDynamics\osf\php\api\ws\dataset\delete\DatasetDeleteQuery;
use \StructuredDynamics\osf\php\api\ws\auth\lister\AuthListerQuery;
use \StructuredDynamics\osf\framework\Namespaces;
use \StructuredDynamics\osf\php\api\framework\CRUDPermission;
// First, let's create a new dataset to delete after
// Create the DatasetCreateQuery object
$dcreate = new DatasetCreateQuery("http://localhost/ws/");
// Set the URI of the new dataset
// Set the title of the dataset
$dcreate->title("My Brand New Dataset to delete!");
// Set the description of the dataset
$dcreate->description("This is something to look at!");
// Set the creator's URI
// Get all the web services registered on this instance with a
// Create the AuthListerQuery object
$authlister = new AuthListerQuery("http://localhost/ws/");
// Specifies that we want to get all the list of all registered web service endpoints.
// Send the auth lister query to the endpoint
// Get back the resultset returned by the endpoint
$resultset = $authlister->getResultset()->getResultset();
$webservices = array();
// Get all the URIs from the resultset array
foreach($resultset["unspecified"] as $list)
foreach($list[Namespaces::$rdf."li"] as $item)
array_push($webservices, $item["uri"]);
// We make sure that this dataset will be accessible by all the
// registered web service endpoints of the network.
// We make this new dataset world readable
$dcreate->globalPermissions(new CRUDPermission(FALSE, TRUE, FALSE, FALSE));
// Send the crud read query to the endpoint
// Now, let's delete that dataset!
$dDelete = new DatasetDeleteQuery("http://localhost/ws/");
// Specify the URI of the dataset we want to remove
// Send que request
// Get the RDF+N3 serialization of the resultset
echo "Dataset deleted!";
echo "Dataset deletation failed: ".$dDelete->getStatus()." (".$dDelete->getStatusMessage().")\n";
echo $dDelete->getStatusMessageDescription();
See also
Frederick Giasson, Structured Dynamics LLC.

Definition at line 111 of file DatasetDeleteQuery.php.

Constructor & Destructor Documentation

__construct (   $network,


mixed$networkOSF network where to send this query. Ex: http://localhost/ws/
mixed$appIDThe Application ID of the instance instance to key. The APP-ID is related to the API-KEY
mixed$apiKeyThe API Key of the OSF web service endpoints
mixed$userIDThe ID of the user that is doing the query

Definition at line 121 of file DatasetDeleteQuery.php.

Member Function Documentation

uri (   $uri)

Specifies the URI of the dataset to delete.

Required: This function must be called before sending the query

mixed$uriURI of the dataset to delete
See also
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 158 of file DatasetDeleteQuery.php.