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

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

Inheritance diagram for DatasetCreateQuery:

Public Member Functions

 __construct ($network, $appID, $apiKey, $userID)
 Constructor. More...
 
 uri ($uri)
 Set the URI of the new dataset to create. More...
 
 title ($title)
 Set the title of the dataset to create. More...
 
 description ($description)
 Set the description of the dataset to create. More...
 
 creator ($creatorUri)
 Set the reference to the creator of this new dataset. More...
 
 targetWebservices ($webservicesUri)
 Specifies which web service endpoint can have access to the data contained in this new dataset. More...
 

Detailed Description

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

The Dataset: Create Web service is used to create a new dataset in a WSF (Web Services Framework). When a dataset is created, it gets described and registered to the WSF and accessible to the other Web services.

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

// Use the DatasetCreateQuery class
use \StructuredDynamics\osf\php\api\ws\dataset\create\DatasetCreateQuery;
// Create the DatasetCreateQuery object
$dcreate = new DatasetCreateQuery("http://localhost/ws/");
// Set the URI of the new dataset
$dcreate->uri("http://localhost/ws/dataset/my-new-dataset/");
// Set the title of the dataset
$dcreate->title("My Brand New Dataset");
// Set the description of the dataset
$dcreate->description("This is something to look at!");
// Set the creator's URI
$dcreate->creator("http://localhost/people/bob/");
// Get all the web services registered on this instance with a
use \StructuredDynamics\osf\php\api\ws\auth\lister\AuthListerQuery;
use \StructuredDynamics\osf\framework\Namespaces;
// 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.
$authlister->getRegisteredWebServiceEndpointsUri();
// Send the auth lister query to the endpoint
$authlister->send();
// 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"]);
}
}
unset($authlister);
// We make sure that this dataset will be accessible by all the
// registered web service endpoints of the network.
$dcreate->targetWebservices($webservices);
use \StructuredDynamics\osf\php\api\framework\CRUDPermission;
// We make this new dataset world readable
$dcreate->globalPermissions(new CRUDPermission(FALSE, TRUE, FALSE, FALSE));
// Send the crud read query to the endpoint
$dcreate->send();
// Now we make sure we create the new dataset by looking into the system
// using the Auth Lister again
// 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.
$authlister->getDatasetGroupsAccesses("http://localhost/ws/dataset/my-new-dataset/");
// Send the auth lister query to the endpoint
$authlister->send();
// Get back the resultset returned by the endpoint
$resultset = $authlister->getResultset();
print_r($resultset);
See also
http://wiki.opensemanticframework.org/index.php/Dataset:_Create
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 108 of file DatasetCreateQuery.php.

Constructor & Destructor Documentation

__construct (   $network,
  $appID,
  $apiKey,
  $userID 
)

Constructor.

Parameters
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 118 of file DatasetCreateQuery.php.

Member Function Documentation

creator (   $creatorUri)

Set the reference to the creator of this new dataset.

Optional: This function could be called before sending the query

Parameters
mixed$creatorUriURI of the creator of this new dataset
See also
http://wiki.opensemanticframework.org/index.php/Dataset:_Create#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 209 of file DatasetCreateQuery.php.

description (   $description)

Set the description of the dataset to create.

Required: This function must be called before sending the query

Parameters
$descriptiondescription of the dataset to create
See also
http://wiki.opensemanticframework.org/index.php/Dataset:_Create#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 191 of file DatasetCreateQuery.php.

targetWebservices (   $webservicesUri)

Specifies which web service endpoint can have access to the data contained in this new dataset.

Required: This function must be called before sending the query

Note: you can get the complete list of webservice endpoint URIs registered to a OSF network instance by using the AuthListerQuery class and by using the getWebServicesList() function.

Parameters
$webservicesUriAn array of webservice URIs that have access to the content of this dataset.
See also
http://wiki.opensemanticframework.org/index.php/Dataset:_Create#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 230 of file DatasetCreateQuery.php.

title (   $title)

Set the title of the dataset to create.

Required: This function must be called before sending the query

Parameters
$titletitle of the dataset to create
See also
http://wiki.opensemanticframework.org/index.php/Dataset:_Create#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 173 of file DatasetCreateQuery.php.

uri (   $uri)

Set the URI of the new dataset to create.

Required: This function must be called before sending the query

Parameters
mixed$uriURI of the new dataset to create
See also
http://wiki.opensemanticframework.org/index.php/Dataset:_Create#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 155 of file DatasetCreateQuery.php.