Open Semantic Framework PHP API 3.0
The Ontology Update service is used to update an OWL ontology existing in the OSF instance. More...
|__construct ($network, $appID, $apiKey, $userID)|
|Specifies the URI of the ontology. More...|
|Enable the reasoner for indexing the ontology into OSF (the triple store and the full text engine) More...|
|Disable the reasoner for for indexing the ontology into OSF (the triple store and the full text engine) More...|
|Create or update an entity in the ontology. More...|
|Update (refactor) the URI of an existing entity. More...|
|When the createOrUpdateEntity, or the updateEntityUri, functions are called via this web service endpoint, the ontology is tagged with a wsf:ontologyModified "true" triple that specifies that the ontology got modified in some ways. More...|
The Ontology Update service is used to update an OWL ontology existing in the OSF instance.
This service is a web service wrapper over the OWLAPI ontology library. It wraps all the needed functionalities related to updating 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.
There is an important semantic distinction to do: this endpoint is about UPDATING an ontology. This means that we may be updating ontologies resources, or creating new ones. The logic is that by creating new resources (such as classes, properties and named individuals) we are updating the ontology.
This is what this web service endpoint is about. To update or create an existing resource, the requester only has to send the RDF description of that resource to update or create. If the resource is existing, it will get updated, if it is not, it will get added.
Here is a code example of how this class can be used by developers:
|mixed||$network||OSF network where to send this query. Ex: http://localhost/ws/|
|mixed||$appID||The Application ID of the instance instance to key. The APP-ID is related to the API-KEY|
|mixed||$apiKey||The API Key of the OSF web service endpoints|
|mixed||$userID||The ID of the user that is doing the query|
Create or update an entity in the ontology.
An entity can be anything of a class, an object property, a datatype property, an annotation property or a named individual.
Right now, the creation and the modification of an entity is simplified to writing the RDF triples describing the entity to create or update. The advantage of this method is that a system that interacts with the endpoints doesn't have to send multiple different queries to change multiple aspects of an entity. It only has to generate the code offline, and send it once to the Ontology Update web service endpoint, with the complete RDF description of the entity to update, or create, in the instance.
If an entity is being modified by some system, usually the workflow process is:
|mixed||$function||A reference to a CreateOrUpdateEntityFunction object instance.|
Disable the reasoner for for indexing the ontology into OSF (the triple store and the full text engine)
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
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
|mixed||$ontologyUri||Specifies 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.|
When the createOrUpdateEntity, or the updateEntityUri, functions are called via this web service endpoint, the ontology is tagged with a wsf:ontologyModified "true" triple that specifies that the ontology got modified in some ways.
What this saveOntology call does, is only to remove that tag (so, to remove the tag that says that the ontology got modified).
The ontology is after saved, and persisted, in the OWLAPI instance. However, if you want your system to save a hard-copy of an ontology that got modified (to reload it elsewhere), the you system will have to perform these steps:
Check if the ontology got modified by checking if the wsf:OntologyModified "true" triple appears in the ontology's description after a call to the Ontology Read web service endpoint for the function getOntology: mode=description.
If is has been modified, then it calls the Ontology Read endpoints again, but using the getSerialized function. Once it gets the serialization form of the ontology, the system can now save it on its local file system, or elsewhere.
Finally it calls the saveOntology function of the Ontology Update web service endpoint to mark the ontology as saved.
Update (refactor) the URI of an existing entity.
The entity can be a class, an object property, a datatype property, an annotation property or a named individual.
|mixed||$function||A reference to a UpdateEntityUriFunction object instance.|