Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
CrudUpdateQuery.php
Go to the documentation of this file.
1 <?php
2 
5 
11 
145  class CrudUpdateQuery extends \StructuredDynamics\osf\php\api\framework\WebServiceQuery
146  {
155  function __construct($network, $appID, $apiKey, $userID)
156  {
157  // Set the OSF network & credentials to use for this query.
158  $this->setNetwork($network);
159  $this->appID = $appID;
160  $this->apiKey = $apiKey;
161  $this->userID = $userID;
162 
163  // Set default configarations for this web service query
164  $this->setSupportedMimes(array("text/xml",
165  "application/json",
166  "application/rdf+xml",
167  "application/rdf+n3",
168  "application/iron+json",
169  "application/iron+csv"));
170 
171  $this->setMethodPost();
172 
173  $this->mime("resultset");
174 
175  $this->setEndpoint("crud/update/");
176 
177  // Set default parameters for this query
178  $this->sourceInterface("default");
179 
180  $this->createRevision();
181 
182  $this->isPublished();
183  }
184 
197  public function document($document)
198  {
199  $this->params["document"] = urlencode($document);
200 
201  return($this);
202  }
203 
213  public function documentMimeIsRdfXml()
214  {
215  $this->params["mime"] = urlencode("application/rdf+xml");
216 
217  return($this);
218  }
219 
229  public function documentMimeIsRdfN3()
230  {
231  $this->params["mime"] = urlencode("application/rdf+n3");
232 
233  return($this);
234  }
235 
247  public function dataset($uri)
248  {
249  $this->params["dataset"] = urlencode($uri);
250 
251  return($this);
252  }
253 
263  public function createRevision()
264  {
265  $this->params["revision"] = 'true';
266 
267  return($this);
268  }
269 
279  public function ignoreRevision()
280  {
281  $this->params["revision"] = 'false';
282 
283  return($this);
284  }
285 
295  public function isPublished()
296  {
297  $this->params["lifecycle"] = 'published';
298 
299  return($this);
300  }
301 
311  public function isArchive()
312  {
313  $this->params["lifecycle"] = 'archive';
314 
315  return($this);
316  }
317 
327  public function isExperimental()
328  {
329  $this->params["lifecycle"] = 'experimental';
330 
331  return($this);
332  }
333 
343  public function isPreRelease()
344  {
345  $this->params["lifecycle"] = 'pre_release';
346 
347  return($this);
348  }
349 
359  public function isStaging()
360  {
361  $this->params["lifecycle"] = 'staging';
362 
363  return($this);
364  }
365 
375  public function isHarvesting()
376  {
377  $this->params["lifecycle"] = 'harvesting';
378 
379  return($this);
380  }
381 
391  public function isUnspecified()
392  {
393  $this->params["lifecycle"] = 'unspecified';
394 
395  return($this);
396  }
397  }
398 
400 ?>
Crud Update Query to a OSF Crud Update web service endpoint.
isPublished()
Specify that the record(s) beind update have a lifecycle stage status 'published'.
documentMimeIsRdfN3()
Specifies that the serialization format of the input document is in RDF+N3.
isStaging()
Specify that the record(s) beind update have a lifecycle stage status 'staging'.
dataset($uri)
Set the URI(s) of the dataset where the instance record is indexed.
isHarvesting()
Specify that the record(s) beind update have a lifecycle stage status 'harvesting'.
isExperimental()
Specify that the record(s) beind update have a lifecycle stage status 'experimental'.
isUnspecified()
Specify that the record(s) beind update have a lifecycle stage status 'unspecified'.
documentMimeIsRdfXml()
Specifies that the serialization format of the input document is in RDF+XML.
isArchive()
Specify that the record(s) beind update have a lifecycle stage status 'archive'.
__construct($network, $appID, $apiKey, $userID)
Constructor.
isPreRelease()
Specify that the record(s) beind update have a lifecycle stage status 'pre-release'.
ignoreRevision()
Specify that we do not want to create a revision record for this update.
document($document)
Set the RDF document where instance record(s) are described.
createRevision()
Specify that we want to create a revision record for this update.