Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
OntologyUpdateQuery.php
Go to the documentation of this file.
1 <?php
2 
5 
11 
12  use \StructuredDynamics\osf\php\api\framework\CRUDPermission;
13 
118  class OntologyUpdateQuery extends \StructuredDynamics\osf\php\api\framework\WebServiceQuery
119  {
128  function __construct($network, $appID, $apiKey, $userID)
129  {
130  // Set the OSF network & credentials to use for this query.
131  $this->setNetwork($network);
132  $this->appID = $appID;
133  $this->apiKey = $apiKey;
134  $this->userID = $userID;
135 
136  // Set default configarations for this web service query
137  $this->setSupportedMimes(array("text/xml",
138  "application/json",
139  "application/rdf+xml",
140  "application/rdf+n3",
141  "application/iron+json",
142  "application/iron+csv"));
143 
144  $this->setMethodPost();
145 
146  $this->mime("resultset");
147 
148  $this->setEndpoint("ontology/update/");
149 
150  // Set default parameters for this query
151  $this->enableReasoner();
152  $this->sourceInterface("default");
153  }
154 
173  public function ontology($ontologyUri)
174  {
175  $this->params["ontology"] = urlencode($ontologyUri);
176 
177  return($this);
178  }
179 
192  public function enableReasoner()
193  {
194  $this->params["reasoner"] = "True";
195 
196  return($this);
197  }
198 
207  public function disableReasoner()
208  {
209  $this->params["reasoner"] = "False";
210 
211  return($this);
212  }
213 
239  public function createOrUpdateEntity(&$function)
240  {
241  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\update\CreateOrUpdateEntityFunction')
242  {
243  $this->params["function"] = "createOrUpdateEntity";
244 
245  $this->params["parameters"] = $function->getParameters();
246  }
247 
248  return($this);
249  }
250 
262  public function updateEntityUri(&$function)
263  {
264  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\update\UpdateEntityUriFunction')
265  {
266  $this->params["function"] = "updateEntityUri";
267 
268  $this->params["parameters"] = $function->getParameters();
269  }
270 
271  return($this);
272  }
273 
301  public function saveOntology()
302  {
303  $this->params["function"] = "saveOntology";
304 
305  return($this);
306  }
307  }
308 
310 ?>
disableReasoner()
Disable the reasoner for for indexing the ontology into OSF (the triple store and the full text engin...
saveOntology()
When the createOrUpdateEntity, or the updateEntityUri, functions are called via this web service endp...
createOrUpdateEntity(&$function)
Create or update an entity in the ontology.
enableReasoner()
Enable the reasoner for indexing the ontology into OSF (the triple store and the full text engine) ...
The Ontology Update service is used to update an OWL ontology existing in the OSF instance...
__construct($network, $appID, $apiKey, $userID)
Constructor.
updateEntityUri(&$function)
Update (refactor) the URI of an existing entity.