Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
DatasetCreateQuery.php
Go to the documentation of this file.
1 <?php
2 
5 
11 
12  use \StructuredDynamics\osf\php\api\framework\CRUDPermission;
13 
108  class DatasetCreateQuery extends \StructuredDynamics\osf\php\api\framework\WebServiceQuery
109  {
118  function __construct($network, $appID, $apiKey, $userID)
119  {
120  // Set the OSF network & credentials to use for this query.
121  $this->setNetwork($network);
122  $this->appID = $appID;
123  $this->apiKey = $apiKey;
124  $this->userID = $userID;
125 
126  // Set default configarations for this web service query
127  $this->setSupportedMimes(array("text/xml",
128  "application/json",
129  "application/rdf+xml",
130  "application/rdf+n3",
131  "application/iron+json",
132  "application/iron+csv"));
133 
134  $this->setMethodPost();
135 
136  $this->mime("resultset");
137 
138  $this->setEndpoint("dataset/create/");
139 
140  // Set default parameters for this query
141  $this->sourceInterface("default");
142  }
143 
155  public function uri($uri)
156  {
157  $this->params["uri"] = urlencode($uri);
158 
159  return($this);
160  }
161 
173  public function title($title)
174  {
175  $this->params["title"] = urlencode($title);
176 
177  return($this);
178  }
179 
191  public function description($description)
192  {
193  $this->params["description"] = urlencode($description);
194 
195  return($this);
196  }
197 
209  public function creator($creatorUri)
210  {
211  $this->params["creator"] = urlencode($creatorUri);
212 
213  return($this);
214  }
215 
230  public function targetWebservices($webservicesUri)
231  {
232  // Encode potential ";" characters
233  foreach($webservicesUri as $key => $wsuri)
234  {
235  $webservicesUri[$key] = str_replace(";", "%3B", $wsuri);
236  }
237 
238  $this->params["webservices"] = urlencode(implode(";", $webservicesUri));
239 
240  return($this);
241  }
242  }
243 
244 
245 
247 ?>
Dataset Create Query to a OSF Dataset Create web service endpoint.
description($description)
Set the description of the dataset to create.
creator($creatorUri)
Set the reference to the creator of this new dataset.
__construct($network, $appID, $apiKey, $userID)
Constructor.
targetWebservices($webservicesUri)
Specifies which web service endpoint can have access to the data contained in this new dataset...