Class AbstractOWLMetric<M extends Serializable>

java.lang.Object
org.semanticweb.owlapi.metrics.AbstractOWLMetric<M>
Type Parameters:
M - the metric type
All Implemented Interfaces:
OWLMetric<M>, OWLOntologyChangeListener
Direct Known Subclasses:
DLExpressivity, DoubleValuedMetric, IntegerValuedMetric

public abstract class AbstractOWLMetric<M extends Serializable> extends Object implements OWLMetric<M>, OWLOntologyChangeListener
Since:
2.1.0
Author:
Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
  • Constructor Details

    • AbstractOWLMetric

      public AbstractOWLMetric(OWLOntology o)
      Instantiates a new abstract owl metric.
      Parameters:
      o - the ontology to use
  • Method Details

    • getOntology

      public OWLOntology getOntology()
      Description copied from interface: OWLMetric
      Gets the ontology which the value of the metric should be based on.
      Specified by:
      getOntology in interface OWLMetric<M extends Serializable>
      Returns:
      The ontology.
    • setOntology

      public void setOntology(OWLOntology ontology)
      Description copied from interface: OWLMetric
      Sets the "root" ontology. The metric will be recomputed from this ontology (and potentially its imports closure if selected).
      Specified by:
      setOntology in interface OWLMetric<M extends Serializable>
      Parameters:
      ontology - The ontology for which the metric should be computed.
    • getValue

      public M getValue()
      Description copied from interface: OWLMetric
      Gets the value of this metric. This value is computed w.r.t. the current ontology and possibly the imports closure (if specified).
      Specified by:
      getValue in interface OWLMetric<M extends Serializable>
      Returns:
      An object which represents the value of this metric - calling the toString method of the object returned by this method will result in a human readable string that displays the value of the metric.
    • getOntologies

      public Stream<OWLOntology> getOntologies()
      Gets the ontologies.
      Returns:
      ontologies as a set
    • ontologiesChanged

      public void ontologiesChanged(List<? extends OWLOntologyChange> changes)
      Description copied from interface: OWLOntologyChangeListener
      Called when some changes have been applied to various ontologies. These may be an axiom added or an axiom removed changes.
      Specified by:
      ontologiesChanged in interface OWLOntologyChangeListener
      Parameters:
      changes - A list of changes that have occurred. Each change may be examined to determine which ontology it was applied to.
    • getManager

      public OWLOntologyManager getManager()
      Description copied from interface: OWLMetric
      Gets the ontology manager which, amongst other things can be used to obtain the imports closure of the current ontology.
      Specified by:
      getManager in interface OWLMetric<M extends Serializable>
      Returns:
      An OWLOntologyManager.
    • dispose

      public void dispose()
      Description copied from interface: OWLMetric
      Disposes of the metric. If the metric attaches itself as a listener to an ontology manager then this will cause the metric to detach itself and stop listening for ontology changes.
      Specified by:
      dispose in interface OWLMetric<M extends Serializable>
    • isImportsClosureUsed

      public boolean isImportsClosureUsed()
      Description copied from interface: OWLMetric
      Determines if the computation of the metric should take into account the imports closure of the current ontology.
      Specified by:
      isImportsClosureUsed in interface OWLMetric<M extends Serializable>
      Returns:
      true if the imports closure of the current ontology is taken into account when computing the value of this metric, or false if the imports closure isn't taken into account when computing this metric.
    • setImportsClosureUsed

      public void setImportsClosureUsed(boolean b)
      Description copied from interface: OWLMetric
      Sets whether this metric uses the imports closure of the current ontology.
      Specified by:
      setImportsClosureUsed in interface OWLMetric<M extends Serializable>
      Parameters:
      b - the new imports closure used true if this metric uses the imports closure of the current ontology, otherwise false.
    • toString

      public String toString()
      Overrides:
      toString in class Object