Skip to content

2.3. Methods of a Descriptor object

yushakareem edited this page Dec 15, 2019 · 9 revisions

Once a descriptor is instantiated with a specific ground (i.e., OWLEntity) and reference to an ontology file (i.e., OWLReference), it offers the following methods:

  • readExpressionAxioms(): modifies the descriptor's internal state (the representation of the ontology within the OOP domain) to be equal to the state of the ontology. It reads the asserted and inferred axioms from the ontology. Furthermore, this method returns the modifications it makes, to its internal state. Note that, by default it does not call the reasoning task (this can be changed by a flag).
  • writeExpressionAxioms(): modifies the state of the ontology to be equal to the the descriptor's internal state. Furthermore, this method returns the modifications it makes, to the state of the ontology. Note that, by default it does not call the reasoning task.
  • get(): gets the axioms (i.e, entitySet) based on the ground and expression. Based on the most recent readExpressionAxioms() or writeExpressionAxioms().
  • query(): gets the axioms (i.e, entitySet) based on the ground and expression. By doing readExpressionAxioms().
  • add(): adds axioms (i.e, entitySet) to the internal state of the descriptor, based on the ground and a particular expression. An example shows how to add axioms.
  • remove(): removes axioms (i.e, entitySet) from the internal state of the descriptor, based on the ground and a particular expression. An example shows how to remove axioms.
  • build(): allows to build one descriptor from another. For example, if the ground of an individual descriptor is corridor1 and this individual descriptor implements the Type expression, which allows to find the ontological type of the individual corridor1. Then, by using the build() method we get a concept descriptor whose ground is the ontological type of the individual corridor1. An example shows how to build one descriptor from another.
  • reason(): it synchronizes the reasoner to obtain the latest inferences in the ontology.
  • saveOntology(pathToOntoFile): it allows to save the current state of the ontology in the path provided in the method's parameter.

Access to OWL-API from OWLOOP API

Apart from the above commonly used Descriptor methods, each Descriptor provides getOntologyReference() method. This Descriptor method returns reference to the ontology file (i.e., an object of the class OWLReference) with which it is associated. Using OWLReference you have access to classes provided by OWL-API via methods in aMOR. Therefore, lower-level aMOR methods allow access to the OWL-API classes OWLOntologyManager, OWLDataFactory, OWLOntology and OWLReasoner.

Clone this wiki locally