Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
OntologyReadQuery Class Reference

Ontology Read Query to a OSF Ontology Read web service endpoint. More...

Inheritance diagram for OntologyReadQuery:

Public Member Functions

 __construct ($network, $appID, $apiKey, $userID)
 Constructor. More...
 
 ontology ($ontologyUri)
 URI of the ontology to query. More...
 
 enableReasoner ()
 Enable the reasoner for querying this ontology. More...
 
 disableReasoner ()
 Disable the reasoner for querying this ontology. More...
 
 getLoadedOntologies (&$function)
 Get the list of all loaded ontologies on the OSF network instance. More...
 
 getOntologies ()
 Get the list of all the ontologies of the import closure of the ontology being queried. More...
 
 getSerialized ()
 Get the serialized document that represents the OWL ontology. More...
 
 getSerializedClassHierarchy ()
 Get the serialized PHP array structure, used by conStruct and OSF, that represents the classes structure of the OWL ontology. More...
 
 getSerializedPropertyHierarchy ()
 Get the serialized PHP array structure, used by conStruct and OSF, that represents the properties structure of the OWL ontology. More...
 
 getIronXMLSchema ()
 Get the serialized PHP array structure, used by conStruct and OSF, that represents the properties structure of the OWL ontology. More...
 
 getIronJsonSchema ()
 Get the ironJSON Schema, used by the Semantic Components, that represents the OWL ontology. More...
 
 getClass (&$function)
 Get the description of a class, in a target ontology. More...
 
 getClasses (&$function)
 Get all the classes that have been defined in an ontology. More...
 
 getSubClasses (&$function)
 Get all the sub-classes of a target class of the ontology. More...
 
 getSuperClasses (&$function)
 Get all the super-classes of a target class of the ontology. More...
 
 getEquivalentClasses (&$function)
 Get all the equivalent-classes of a target class of the ontology. More...
 
 getDisjointClasses (&$function)
 Get all the disjoint-classes of a target class of the ontology. More...
 
 getProperty (&$function)
 Get the description of a property, in a target ontology. More...
 
 getProperties (&$function)
 Get all the properties that have been defined in an ontology. More...
 
 getSubProperties (&$function)
 Get all the sub-properties that have been defined in an ontology. More...
 
 getSuperProperties (&$function)
 Get all the super-properties that have been defined in an ontology. More...
 
 getDisjointProperties (&$function)
 Get all the disjoint-properties that have been defined in an ontology. More...
 
 getEquivalentProperties (&$function)
 Get all the equivalent-properties that have been defined in an ontology. More...
 
 getNamedIndividual (&$function)
 Get the description of a named individual, in a target ontology. More...
 
 getNamedIndividuals (&$function)
 Get all the named individuals that have been defined in an ontology. More...
 

Detailed Description

Ontology Read Query to a OSF Ontology Read web service endpoint.

The Ontology Read service is used to query OWL ontologies. All kinds of information can be read on different ontology entities such as: classes, object properties, datatype properties, annotation properties and individuals. Reasoners can also be used to include inferred facts in the service's resultset. A full list of actions can be performed that enables you to leverage your ontologies, properly and effectively.

This service is a Web service wrapper over the OWLAPI ontology library. Most of the API has been implemented. So we can say that this Web service (with the other related OSF services) turns the OWLAPI into a Web service API.

Here is a code example of how this class can be used by developers:

use \StructuredDynamics\osf\php\api\ws\ontology\read\OntologyReadQuery;
use \StructuredDynamics\osf\php\api\ws\ontology\read\GetClassesFunction;
// Create the Ontology Read query
$ontologyRead = new OntologyReadQuery("http://demo.citizen-dan.org/ws/");
// Enable the reasoner for this query
$ontologyRead->enableReasoner();
// Specify the MUNI ontology from the citizen demo website
$ontologyRead->ontology("file://localhost/data/ontologies/files/demo.citizen-dan.org/muni.owl");
// Specify that we want RDF+XML data as output
$ontologyRead->mime("application/rdf+xml");
// Prepare the function call to send to the endpoint.
$getClassesFunction = new GetClassesFunction();
// Sepcify that we want all the classes URIs from this ontology
$getClassesFunction->getClassesUris();
// Specify that we only want to first 20 results
$getClassesFunction->limit(20);
$getClassesFunction->offset(0);
// Prepare the getClasses call
$ontologyRead->getClasses($getClassesFunction);
// Send the query
$ontologyRead->send();
if($ontologyRead->isSuccessful())
{
echo $ontologyRead->getResultset();
}
else
{
echo "Ontology importation failed: ".$ontologyRead->getStatus()." (".$ontologyRead->getStatusMessage().")\n";
echo $ontologyRead->getStatusMessageDescription();
}
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 77 of file OntologyReadQuery.php.

Constructor & Destructor Documentation

__construct (   $network,
  $appID,
  $apiKey,
  $userID 
)

Constructor.

Parameters
mixed$networkOSF network where to send this query. Ex: http://localhost/ws/
mixed$appIDThe Application ID of the instance instance to key. The APP-ID is related to the API-KEY
mixed$apiKeyThe API Key of the OSF web service endpoints
mixed$userIDThe ID of the user that is doing the query

Definition at line 87 of file OntologyReadQuery.php.

Member Function Documentation

disableReasoner ( )

Disable the reasoner for querying this ontology.

See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 158 of file OntologyReadQuery.php.

enableReasoner ( )

Enable the reasoner for querying this ontology.

This is the default behavior of this service.

See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 144 of file OntologyReadQuery.php.

getClass ( $function)

Get the description of a class, in a target ontology.

Parameters
mixed$functionA reference to a GetClassFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getClass
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 305 of file OntologyReadQuery.php.

getClasses ( $function)

Get all the classes that have been defined in an ontology.

The requester can get a list of URIs or the full description of the classes.

Parameters
mixed$functionA reference to a GetClassesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getClasses
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 327 of file OntologyReadQuery.php.

getDisjointClasses ( $function)

Get all the disjoint-classes of a target class of the ontology.

The requester can get a list of URIs or the full description of the disjoint-classes.

Parameters
mixed$functionA reference to a GetDisjointClassesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getDisjointClasses
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 415 of file OntologyReadQuery.php.

getDisjointProperties ( $function)

Get all the disjoint-properties that have been defined in an ontology.

The requester can get a list of URIs or the full description of the disjoint-properties.

Parameters
mixed$functionA reference to a GetDisjointPropertiesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getDisjointProperties
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 524 of file OntologyReadQuery.php.

getEquivalentClasses ( $function)

Get all the equivalent-classes of a target class of the ontology.

The requester can get a list of URIs or the full description of the equivalent-classes.

Parameters
mixed$functionA reference to a GetEquivalentClassesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getEquivalentClasses
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 393 of file OntologyReadQuery.php.

getEquivalentProperties ( $function)

Get all the equivalent-properties that have been defined in an ontology.

The requester can get a list of URIs or the full description of the equivalent-properties.

Parameters
mixed$functionA reference to a GetEquivalentPropertiesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getEquivalentProperties
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 546 of file OntologyReadQuery.php.

getIronJsonSchema ( )

Get the ironJSON Schema, used by the Semantic Components, that represents the OWL ontology.

There are no function parameters for this function call. The ontology to serialize is determined by the ontology query parameter.

See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getIronJsonSchema
http://wiki.opensemanticframework.org/index.php/Instance_Record_and_Object_Notation_(irON)_Specification#Structure_Schema_Object_3
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 289 of file OntologyReadQuery.php.

getIronXMLSchema ( )

Get the serialized PHP array structure, used by conStruct and OSF, that represents the properties structure of the OWL ontology.

There are no function parameters for this function call. The ontology to serialize is determined by the ontology query parameter.

See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getIronXMLSchema
http://wiki.opensemanticframework.org/index.php/Instance_Record_and_Object_Notation_(irON)_Specification#Structure_Schema_Object_2
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 270 of file OntologyReadQuery.php.

getLoadedOntologies ( $function)

Get the list of all loaded ontologies on the OSF network instance.

Parameters
mixed$functionA reference to a GetLoadedOntologiesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getLoadedOntologies
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 174 of file OntologyReadQuery.php.

getNamedIndividual ( $function)

Get the description of a named individual, in a target ontology.

Parameters
mixed$functionA reference to a GetNamedIndividualFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getNamedIndividual
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 567 of file OntologyReadQuery.php.

getNamedIndividuals ( $function)

Get all the named individuals that have been defined in an ontology.

The requester can get a list of URIs or the full description of the named individuals.

Parameters
mixed$functionA reference to a GetNamedIndividualsFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getNamedIndividuals
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 589 of file OntologyReadQuery.php.

getOntologies ( )

Get the list of all the ontologies of the import closure of the ontology being queried.

If you want to get the list of all individually loaded ontologies file of this instance, use the getLoadedOntologies API call instead.

Parameters
mixed$functionA reference to a GetOntologiesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getOntologies
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 197 of file OntologyReadQuery.php.

getProperties ( $function)

Get all the properties that have been defined in an ontology.

The requester can get a list of URIs or the full description of the properties.

Parameters
mixed$functionA reference to a GetPropertiesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getProperties
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 458 of file OntologyReadQuery.php.

getProperty ( $function)

Get the description of a property, in a target ontology.

Parameters
mixed$functionA reference to a GetPropertyFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getProperty
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 436 of file OntologyReadQuery.php.

getSerialized ( )

Get the serialized document that represents the OWL ontology.

The serialization format (usually RDF+XML or RDF+N3) depends on the format used when the ontology got created. The same format will be used as an output of this function call.

See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getLoadedOntologies
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 215 of file OntologyReadQuery.php.

getSerializedClassHierarchy ( )

Get the serialized PHP array structure, used by conStruct and OSF, that represents the classes structure of the OWL ontology.

There are no function parameters for this function call. The ontology to serialize is determined by the ontology query parameter.

See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getSerializedClassHierarchy
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 233 of file OntologyReadQuery.php.

getSerializedPropertyHierarchy ( )

Get the serialized PHP array structure, used by conStruct and OSF, that represents the properties structure of the OWL ontology.

There are no function parameters for this function call. The ontology to serialize is determined by the ontology query parameter.

See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getSerializedPropertyHierarchy
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 251 of file OntologyReadQuery.php.

getSubClasses ( $function)

Get all the sub-classes of a target class of the ontology.

The requester can get a list of URIs or the full description of the sub-classes.

Parameters
mixed$functionA reference to a GetSubClassesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getSubClasses
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 349 of file OntologyReadQuery.php.

getSubProperties ( $function)

Get all the sub-properties that have been defined in an ontology.

The requester can get a list of URIs or the full description of the sub-properties.

Parameters
mixed$functionA reference to a GetSubPropertiesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getSubProperties
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 480 of file OntologyReadQuery.php.

getSuperClasses ( $function)

Get all the super-classes of a target class of the ontology.

The requester can get a list of URIs or the full description of the super-classes.

Parameters
mixed$functionA reference to a GetSuperClassesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getSuperClasses
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 371 of file OntologyReadQuery.php.

getSuperProperties ( $function)

Get all the super-properties that have been defined in an ontology.

The requester can get a list of URIs or the full description of the super-properties.

Parameters
mixed$functionA reference to a GetSuperPropertiesFunction object instance.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#getSuperProperties
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 502 of file OntologyReadQuery.php.

ontology (   $ontologyUri)

URI of the ontology to query.

Note: you can get the list of all loaded ontologies by using the getLoadedOntologies() function

Required: This function must be called before sending the query

Parameters
mixed$ontologyUriURI of the ontology to query
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 128 of file OntologyReadQuery.php.