Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
CrudCreateQuery.php
Go to the documentation of this file.
1 <?php
2 
5 
11 
109  class CrudCreateQuery extends \StructuredDynamics\osf\php\api\framework\WebServiceQuery
110  {
119  function __construct($network, $appID, $apiKey, $userID)
120  {
121  // Set the OSF network & credentials to use for this query.
122  $this->setNetwork($network);
123  $this->appID = $appID;
124  $this->apiKey = $apiKey;
125  $this->userID = $userID;
126 
127  // Set default configarations for this web service query
128  $this->setSupportedMimes(array("text/xml",
129  "application/json",
130  "application/rdf+xml",
131  "application/rdf+n3",
132  "application/iron+json",
133  "application/iron+csv"));
134 
135  $this->setMethodPost();
136 
137  $this->mime("resultset");
138 
139  $this->setEndpoint("crud/create/");
140 
141  // Set default parameters for this query
142  $this->enableFullIndexationMode();
143  $this->sourceInterface("default");
144  }
145 
158  public function document($document)
159  {
160  $this->params["document"] = urlencode($document);
161 
162  return($this);
163  }
164 
174  public function documentMimeIsRdfXml()
175  {
176  $this->params["mime"] = urlencode("application/rdf+xml");
177 
178  return($this);
179  }
180 
190  public function documentMimeIsRdfN3()
191  {
192  $this->params["mime"] = urlencode("application/rdf+n3");
193 
194  return($this);
195  }
196 
206  public function enableFullIndexationMode()
207  {
208  $this->params["mode"] = "full";
209 
210  return($this);
211  }
212 
221  {
222  $this->params["mode"] = "triplestore";
223 
224  return($this);
225  }
226 
234  public function enableSearchIndexationMode()
235  {
236  $this->params["mode"] = "searchindex";
237 
238  return($this);
239  }
240 
252  public function dataset($uri)
253  {
254  $this->params["dataset"] = urlencode($uri);
255 
256  return($this);
257  }
258  }
259 
261 ?>
__construct($network, $appID, $apiKey, $userID)
Constructor.
documentMimeIsRdfXml()
Specifies that the serialization format of the input document is in RDF+XML.
enableFullIndexationMode()
Specifies that you want the document to be indexed everywhere in the system.
enableTripleStoreIndexationMode()
Specifies that you want the document to be indexed in the triple store only.
enableSearchIndexationMode()
Specifies that you want the document to be indexed in the search engine only.
Crud Create Query to a OSF Crud Create web service endpoint.
document($document)
Set the RDF document where instance record(s) are described.
dataset($uri)
Set the URI(s) of the dataset where the instance record is indexed.
documentMimeIsRdfN3()
Specifies that the serialization format of the input document is in RDF+N3.