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

The Ontology Create service is used to create/import a new OWL ontology into the OSF instance. More...

Inheritance diagram for OntologyCreateQuery:

Public Member Functions

 __construct ($network, $appID, $apiKey, $userID)
 Constructor. More...
 
 uri ($ontologyUri)
 Specifies the URI of the ontology. More...
 
 enableAdvancedIndexation ()
 Enable advanced indexation of the ontology. More...
 
 disableAdvancedIndexation ()
 Disable advanced indexation of the ontology. More...
 
 enableReasoner ()
 Enable the reasoner for indexing the ontology into OSF (the triple store and the full text engine) More...
 
 disableReasoner ()
 Disable the reasoner for for indexing the ontology into OSF (the triple store and the full text engine) More...
 

Detailed Description

The Ontology Create service is used to create/import a new OWL ontology into the OSF instance.

This service is a web service wrapper over the OWLAPI ontology library. It wraps all the needed functionalities related to ontology creation/import. Most of the relatd API has been implemented. So we can say that web service (with the other related services) turns the OWLAPI into a web service API.

This Web service is intended to be used by content management systems, developers or administrators to create ontologies that are hosted on a OSF instance, and that are used to describe the named entities in the system.

This endpoint, along with the other related endpoints: Ontology Read, Ontology Update and Ontology Delete; can be seen as the brain of your OSF instance.

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\read\OntologyReadQuery;
use \StructuredDynamics\osf\php\api\ws\ontology\read\GetLoadedOntologiesFunction;
$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, let's use the ontology read service to make sure it got loaded.
$ontologyRead = new OntologyReadQuery("http://localhost/ws/");
$ontologyRead->ontology("http://www.w3.org/2006/vcard/ns");
$getLoadedOntologies = new GetLoadedOntologiesFunction();
$getLoadedOntologies->modeUris();
$ontologyRead->getLoadedOntologies($getLoadedOntologies);
$ontologyRead->send();
echo $ontologyRead->getResultset()->getResultset();
}
else
{
echo "Ontology importation failed: ".$ontologyCreate->getStatus()." (".$ontologyCreate->getStatusMessage().")\n";
echo $ontologyCreate->getStatusMessageDescription();
}
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Create
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 81 of file OntologyCreateQuery.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 91 of file OntologyCreateQuery.php.

Member Function Documentation

disableAdvancedIndexation ( )

Disable advanced indexation of the ontology.

This means that the ontologies will be queriable via the Ontology Read, Ontology Update and Ontology Delete web service endpoints only

This is the default behavior of this service.

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

Definition at line 172 of file OntologyCreateQuery.php.

disableReasoner ( )

Disable the reasoner for for indexing the ontology into OSF (the triple store and the full text engine)

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

Definition at line 206 of file OntologyCreateQuery.php.

enableAdvancedIndexation ( )

Enable advanced indexation of the ontology.

This means that the ontology's description (so all the classes, properties and named individuals) will be indexed in the other data management system in OSF. This means that all the information in these ontologies will be accessible via the other endpoints such as the Search and the SPARQL web service endpoints. Enabling this option may render the creation process slower depending on the size of the created ontology.

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

Definition at line 155 of file OntologyCreateQuery.php.

enableReasoner ( )

Enable the reasoner for indexing the ontology into OSF (the triple store and the full text engine)

This is the default behavior of this service.

Note: This only has an effect if the advanced indexation is enabled

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

Definition at line 191 of file OntologyCreateQuery.php.

uri (   $ontologyUri)

Specifies the URI of the ontology.

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$ontologyUriSpecifies the URI of the ontology; the URI 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, that can be resolved on the Web by this endpoint. This URL can refers to a file accessible on the web, on the file system, etc. The endpoint will get the ontology's description from that URL.
See also
http://wiki.opensemanticframework.org/index.php/Ontology_Create#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 136 of file OntologyCreateQuery.php.