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

The Ontology Delete service is used to delete an OWL ontology existing in the OSF instance, or an entity in one of the ontology. More...

Inheritance diagram for OntologyDeleteQuery:

Public Member Functions

 __construct ($network, $appID, $apiKey, $userID)
 Constructor. More...
 
 ontology ($ontologyUri)
 URI of the ontology; the URI of an Ontology dataset is the URL used to import that ontology in the system. More...
 
 deleteOntology ()
 Delete an ontology from the system. More...
 
 deleteClass (&$function)
 Delete a class from an ontology on the system. More...
 
 deleteProperty (&$function)
 Delete a property from an ontology on the system. More...
 
 deleteNamedIndividual (&$function)
 Delete a named individual from an ontology on the system. More...
 

Detailed Description

The Ontology Delete service is used to delete an OWL ontology existing in the OSF instance, or an entity in one of the ontology.

An entity can be anything of: a class, an object property, a datatype property, an annotation property or a named individual.

This service is a web service wrapper over the OWLAPI ontology library. It wraps all the needed functionalities related to delete an ontology or an entity in an ontology. Most of the related API has been implemented. So we can say that web service (with the other related 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\create\OntologyCreateQuery;
use \StructuredDynamics\osf\php\api\ws\ontology\delete\OntologyDeleteQuery;
use \StructuredDynamics\osf\php\api\ws\ontology\delete\DeleteClassFunction;
$ontologyCreate = new OntologyCreateQuery("http://localhost/ws/");
// Create the vcard ontology for which its description is located somewhere on the Web
$ontologyCreate->uri("http://www.w3.org/2006/vcard/ns");
// Enable advanced indexation to have access to it on all OSF endpoints
$ontologyCreate->enableAdvancedIndexation();
// Enable reasoner to persist inferred facts into all endpoints of OSF
$ontologyCreate->enableReasoner();
// Import the new ontology
$ontologyCreate->send();
if(!$ontologyCreate->isSuccessful())
{
// Now delete one of the class of this ontology
$ontologyDelete = new OntologyDeleteQuery("http://localhost/ws/");
$ontologyDelete->ontology("http://www.w3.org/2006/vcard/ns");
$deleteClassFunction = new DeleteClassFunction();
$deleteClassFunction->uri("http://www.w3.org/2006/vcard/ns#Address");
$ontologyDelete->deleteClass($deleteClassFunction);
$ontologyDelete->send();
if($ontologyDelete->isSuccessful())
{
echo "Class successfully delete";
}
else
{
echo "Ontology class deletation failed: ".$ontologyDelete->getStatus()." (".$ontologyDelete->getStatusMessage().")\n";
echo $ontologyDelete->getStatusMessageDescription();
}
}
else
{
echo "Ontology importation failed: ".$ontologyCreate->getStatus()." (".$ontologyCreate->getStatusMessage().")\n";
echo $ontologyCreate->getStatusMessageDescription();
}
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Delete
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 84 of file OntologyDeleteQuery.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 94 of file OntologyDeleteQuery.php.

Member Function Documentation

deleteClass ( $function)

Delete a class from an ontology on the system.

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

Definition at line 166 of file OntologyDeleteQuery.php.

deleteNamedIndividual ( $function)

Delete a named individual from an ontology on the system.

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

Definition at line 208 of file OntologyDeleteQuery.php.

deleteOntology ( )

Delete an ontology from the system.

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

Definition at line 150 of file OntologyDeleteQuery.php.

deleteProperty ( $function)

Delete a property from an ontology on the system.

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

Definition at line 187 of file OntologyDeleteQuery.php.

ontology (   $ontologyUri)

URI of the ontology; the URI of an Ontology dataset is the URL used to import that ontology in the system.

The URL can be the URI of the ontology if it was resolvable on the Web, or the URL where the OWL file, containing the ontology's description, can be resolved by the server (on the web, on the file system, etc) via a URL.

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_Delete#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 136 of file OntologyDeleteQuery.php.