Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
OntologyReadQuery.php
Go to the documentation of this file.
1 <?php
2 
5 
11 
77  class OntologyReadQuery extends \StructuredDynamics\osf\php\api\framework\WebServiceQuery
78  {
87  function __construct($network, $appID, $apiKey, $userID)
88  {
89  // Set the OSF network & credentials to use for this query.
90  $this->setNetwork($network);
91  $this->appID = $appID;
92  $this->apiKey = $apiKey;
93  $this->userID = $userID;
94 
95  // Set default configarations for this web service query
96  $this->setSupportedMimes(array("text/xml",
97  "application/json",
98  "application/rdf+xml",
99  "application/rdf+n3",
100  "application/iron+json",
101  "application/iron+csv"));
102 
103  $this->setMethodPost();
104 
105  $this->mime("resultset");
106 
107  $this->setEndpoint("ontology/read/");
108 
109  // Set default parameters for this query
110  $this->ontology("");
111  $this->enableReasoner();
112  $this->sourceInterface("default");
113  }
114 
128  public function ontology($ontologyUri)
129  {
130  $this->params["ontology"] = urlencode($ontologyUri);
131 
132  return($this);
133  }
134 
144  public function enableReasoner()
145  {
146  $this->params["reasoner"] = "True";
147 
148  return($this);
149  }
150 
158  public function disableReasoner()
159  {
160  $this->params["reasoner"] = "False";
161 
162  return($this);
163  }
164 
174  public function getLoadedOntologies(&$function)
175  {
176  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetLoadedOntologiesFunction')
177  {
178  $this->params["function"] = "getLoadedOntologies";
179 
180  $this->params["parameters"] = $function->getParameters();
181  }
182 
183  return($this);
184  }
185 
197  public function getOntologies()
198  {
199  $this->params["function"] = "getOntologies";
200 
201  $this->params["parameters"] = urlencode('mode=uris');
202 
203  return($this);
204  }
205 
215  public function getSerialized()
216  {
217  $this->params["function"] = "getSerialized";
218 
219  return($this);
220  }
221 
233  public function getSerializedClassHierarchy()
234  {
235  $this->params["function"] = "getSerializedClassHierarchy";
236 
237  return($this);
238  }
239 
252  {
253  $this->params["function"] = "getSerializedPropertyHierarchy";
254 
255  return($this);
256  }
257 
270  public function getIronXMLSchema()
271  {
272  $this->params["function"] = "getIronXMLSchema";
273 
274  return($this);
275  }
276 
277 
289  public function getIronJsonSchema()
290  {
291  $this->params["function"] = "getIronJsonSchema";
292 
293  return($this);
294  }
295 
305  public function getClass(&$function)
306  {
307  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetClassFunction')
308  {
309  $this->params["function"] = "getClass";
310 
311  $this->params["parameters"] = $function->getParameters();
312  }
313 
314  return($this);
315  }
316 
327  public function getClasses(&$function)
328  {
329  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetClassesFunction')
330  {
331  $this->params["function"] = "getClasses";
332 
333  $this->params["parameters"] = $function->getParameters();
334  }
335 
336  return($this);
337  }
338 
349  public function getSubClasses(&$function)
350  {
351  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetSubClassesFunction')
352  {
353  $this->params["function"] = "getSubClasses";
354 
355  $this->params["parameters"] = $function->getParameters();
356  }
357 
358  return($this);
359  }
360 
371  public function getSuperClasses(&$function)
372  {
373  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetSuperClassesFunction')
374  {
375  $this->params["function"] = "getSuperClasses";
376 
377  $this->params["parameters"] = $function->getParameters();
378  }
379 
380  return($this);
381  }
382 
393  public function getEquivalentClasses(&$function)
394  {
395  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetEquivalentClassesFunction')
396  {
397  $this->params["function"] = "getEquivalentClasses";
398 
399  $this->params["parameters"] = $function->getParameters();
400  }
401 
402  return($this);
403  }
404 
415  public function getDisjointClasses(&$function)
416  {
417  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetDisjointClassesFunction')
418  {
419  $this->params["function"] = "getDisjointClasses";
420 
421  $this->params["parameters"] = $function->getParameters();
422  }
423 
424  return($this);
425  }
426 
436  public function getProperty(&$function)
437  {
438  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetPropertyFunction')
439  {
440  $this->params["function"] = "getProperty";
441 
442  $this->params["parameters"] = $function->getParameters();
443  }
444 
445  return($this);
446  }
447 
458  public function getProperties(&$function)
459  {
460  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetPropertiesFunction')
461  {
462  $this->params["function"] = "getProperties";
463 
464  $this->params["parameters"] = $function->getParameters();
465  }
466 
467  return($this);
468  }
469 
480  public function getSubProperties(&$function)
481  {
482  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetSubPropertiesFunction')
483  {
484  $this->params["function"] = "getSubProperties";
485 
486  $this->params["parameters"] = $function->getParameters();
487  }
488 
489  return($this);
490  }
491 
502  public function getSuperProperties(&$function)
503  {
504  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetSuperPropertiesFunction')
505  {
506  $this->params["function"] = "getSuperProperties";
507 
508  $this->params["parameters"] = $function->getParameters();
509  }
510 
511  return($this);
512  }
513 
524  public function getDisjointProperties(&$function)
525  {
526  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetDisjointPropertiesFunction')
527  {
528  $this->params["function"] = "getDisjointProperties";
529 
530  $this->params["parameters"] = $function->getParameters();
531  }
532 
533  return($this);
534  }
535 
546  public function getEquivalentProperties(&$function)
547  {
548  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetEquivalentPropertiesFunction')
549  {
550  $this->params["function"] = "getEquivalentProperties";
551 
552  $this->params["parameters"] = $function->getParameters();
553  }
554 
555  return($this);
556  }
557 
567  public function getNamedIndividual(&$function)
568  {
569  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetNamedIndividualFunction')
570  {
571  $this->params["function"] = "getNamedIndividual";
572 
573  $this->params["parameters"] = $function->getParameters();
574  }
575 
576  return($this);
577  }
578 
589  public function getNamedIndividuals(&$function)
590  {
591  if(get_class($function) == 'StructuredDynamics\osf\php\api\ws\ontology\read\GetNamedIndividualsFunction')
592  {
593  $this->params["function"] = "getNamedIndividuals";
594 
595  $this->params["parameters"] = $function->getParameters();
596  }
597 
598  return($this);
599  }
600  }
601 
603 ?>
getSubClasses(&$function)
Get all the sub-classes of a target class of the ontology.
getIronJsonSchema()
Get the ironJSON Schema, used by the Semantic Components, that represents the OWL ontology...
getDisjointClasses(&$function)
Get all the disjoint-classes of a target class of the ontology.
getSubProperties(&$function)
Get all the sub-properties that have been defined in an ontology.
getProperties(&$function)
Get all the properties that have been defined in an ontology.
getEquivalentProperties(&$function)
Get all the equivalent-properties that have been defined in an ontology.
__construct($network, $appID, $apiKey, $userID)
Constructor.
getOntologies()
Get the list of all the ontologies of the import closure of the ontology being queried.
Ontology Read Query to a OSF Ontology Read web service endpoint.
getDisjointProperties(&$function)
Get all the disjoint-properties that have been defined in an ontology.
getEquivalentClasses(&$function)
Get all the equivalent-classes of a target class of the ontology.
getSerializedPropertyHierarchy()
Get the serialized PHP array structure, used by conStruct and OSF, that represents the properties str...
getIronXMLSchema()
Get the serialized PHP array structure, used by conStruct and OSF, that represents the properties str...
enableReasoner()
Enable the reasoner for querying this ontology.
getSerializedClassHierarchy()
Get the serialized PHP array structure, used by conStruct and OSF, that represents the classes struct...
getSuperProperties(&$function)
Get all the super-properties that have been defined in an ontology.
getClasses(&$function)
Get all the classes that have been defined in an ontology.
getNamedIndividual(&$function)
Get the description of a named individual, in a target ontology.
getProperty(&$function)
Get the description of a property, in a target ontology.
getClass(&$function)
Get the description of a class, in a target ontology.
getSerialized()
Get the serialized document that represents the OWL ontology.
disableReasoner()
Disable the reasoner for querying this ontology.
getNamedIndividuals(&$function)
Get all the named individuals that have been defined in an ontology.
getSuperClasses(&$function)
Get all the super-classes of a target class of the ontology.
getLoadedOntologies(&$function)
Get the list of all loaded ontologies on the OSF network instance.