org.semanticweb.HermiT.owlapi.structural
Class OwlNormalization

java.lang.Object
  extended by org.semanticweb.HermiT.owlapi.structural.OwlNormalization

public class OwlNormalization
extends java.lang.Object

This class implements the structural transformation from our new tableau paper. This transformation departs in the following way from the paper: it keeps the concepts of the form \exists R.{ a_1, ..., a_n }, \forall R.{ a_1, ..., a_n }, and \forall R.\neg { a } intact. These concepts are then clausified in a more efficient way.


Nested Class Summary
protected  class OwlNormalization.NormalizationVisitor
           
protected static class OwlNormalization.PLVisitor
          checks the polarity
static class OwlNormalization.RoleManager
           
protected static class OwlNormalization.SimplificationVisitor
           
 
Field Summary
protected  java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> m_asymmetricObjectProperties
           
protected  java.util.Collection<org.semanticweb.owl.model.OWLDescription[]> m_conceptInclusions
           
protected  java.util.Collection<org.semanticweb.owl.model.OWLDataPropertyExpression[]> m_dataPropertyInclusions
           
protected  java.util.Map<org.semanticweb.owl.model.OWLDescription,org.semanticweb.owl.model.OWLDescription> m_definitions
           
protected  java.util.Map<org.semanticweb.owl.model.OWLObjectOneOf,org.semanticweb.owl.model.OWLClass> m_definitionsForNegativeNominals
           
protected  java.util.Set<org.semanticweb.owl.model.OWLDataPropertyExpression[]> m_disjointDataProperties
           
protected  java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression[]> m_disjointObjectProperties
           
protected  org.semanticweb.owl.model.OWLDataFactory m_factory
           
protected  java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> m_facts
           
protected  java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> m_irreflexiveObjectProperties
           
protected  java.util.Collection<org.semanticweb.owl.model.OWLObjectPropertyExpression[]> m_objectPropertyInclusions
           
protected  java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> m_reflexiveObjectProperties
           
protected  java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> m_transitiveObjectProperties
           
protected  OwlNormalization.RoleManager roleManager
           
 
Constructor Summary
OwlNormalization(org.semanticweb.owl.model.OWLDataFactory factory)
           
 
Method Summary
 org.semanticweb.owl.model.OWLClass define(org.semanticweb.owl.model.OWLDescription desc, java.util.List<org.semanticweb.owl.model.OWLDescription[]> outInclusions, java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> outFacts)
           
protected static boolean distributeUnionOverAnd(org.semanticweb.owl.model.OWLDescription[] descriptions, java.util.List<org.semanticweb.owl.model.OWLDescription[]> inclusions)
          If exactly one of the classes in descriptions is an intersection, new inclusions are added that each contain one intersection operand and all the other descriptions.
 java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> getAsymmetricObjectProperties()
           
protected  org.semanticweb.owl.model.OWLClass getClassFor(org.semanticweb.owl.model.OWLDescription desc, boolean[] alreadyExists)
           
 java.util.Collection<org.semanticweb.owl.model.OWLDescription[]> getConceptInclusions()
           
 java.util.Collection<org.semanticweb.owl.model.OWLDataPropertyExpression[]> getDataPropertyInclusions()
           
protected  org.semanticweb.owl.model.OWLDescription getDefinitionFor(org.semanticweb.owl.model.OWLDescription desc, boolean[] alreadyExists)
           
protected  org.semanticweb.owl.model.OWLDescription getDefinitionFor(org.semanticweb.owl.model.OWLDescription desc, boolean[] alreadyExists, boolean forcePositive)
           
protected  org.semanticweb.owl.model.OWLClass getDefinitionForNegativeNominal(org.semanticweb.owl.model.OWLObjectOneOf nominal, boolean[] alreadyExists)
           
 java.util.Set<org.semanticweb.owl.model.OWLDataPropertyExpression[]> getDisjointDataProperties()
           
 java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression[]> getDisjointObjectProperties()
           
 java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> getFacts()
           
 java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> getIrreflexiveObjectProperties()
           
 java.util.Collection<org.semanticweb.owl.model.OWLObjectPropertyExpression[]> getObjectPropertyInclusions()
           
 java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> getReflexiveObjectProperties()
           
 java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> getTransitiveObjectProperties()
           
protected static boolean isSimple(org.semanticweb.owl.model.OWLDescription description)
           
protected  void normalize(java.util.List<org.semanticweb.owl.model.OWLDescription[]> ioInclusions, java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> ioFacts)
           
protected static void normalizeInclusions(java.util.List<org.semanticweb.owl.model.OWLDescription[]> inclusions, java.util.Collection<org.semanticweb.owl.model.OWLDescription[]> outInclusions, java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> ioFacts, org.semanticweb.owl.model.OWLDataFactory factory, org.semanticweb.owl.model.OWLDescriptionVisitorEx<org.semanticweb.owl.model.OWLDescription> normalizer)
           
protected static boolean optimizedNegativeOneOfTranslation(org.semanticweb.owl.model.OWLDescription[] descriptions, org.semanticweb.owl.model.OWLDataFactory factory, java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> ioFacts)
           
 void processOntology(Reasoner.Configuration config, org.semanticweb.owl.model.OWLOntology inOntology)
          Normalises the ontology and performs the structural transformation.
protected static org.semanticweb.owl.model.OWLDescription simplify(org.semanticweb.owl.model.OWLDescription d, org.semanticweb.owl.model.OWLDataFactory f)
          Takes an OWL description and visits it with a new SimplificationVisitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_definitions

protected final java.util.Map<org.semanticweb.owl.model.OWLDescription,org.semanticweb.owl.model.OWLDescription> m_definitions

m_definitionsForNegativeNominals

protected final java.util.Map<org.semanticweb.owl.model.OWLObjectOneOf,org.semanticweb.owl.model.OWLClass> m_definitionsForNegativeNominals

m_conceptInclusions

protected final java.util.Collection<org.semanticweb.owl.model.OWLDescription[]> m_conceptInclusions

m_objectPropertyInclusions

protected java.util.Collection<org.semanticweb.owl.model.OWLObjectPropertyExpression[]> m_objectPropertyInclusions

m_dataPropertyInclusions

protected final java.util.Collection<org.semanticweb.owl.model.OWLDataPropertyExpression[]> m_dataPropertyInclusions

m_asymmetricObjectProperties

protected final java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> m_asymmetricObjectProperties

m_reflexiveObjectProperties

protected final java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> m_reflexiveObjectProperties

m_irreflexiveObjectProperties

protected final java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> m_irreflexiveObjectProperties

m_transitiveObjectProperties

protected final java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> m_transitiveObjectProperties

m_disjointObjectProperties

protected final java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression[]> m_disjointObjectProperties

m_disjointDataProperties

protected final java.util.Set<org.semanticweb.owl.model.OWLDataPropertyExpression[]> m_disjointDataProperties

m_facts

protected final java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> m_facts

m_factory

protected final org.semanticweb.owl.model.OWLDataFactory m_factory

roleManager

protected final OwlNormalization.RoleManager roleManager
Constructor Detail

OwlNormalization

public OwlNormalization(org.semanticweb.owl.model.OWLDataFactory factory)
Method Detail

processOntology

public void processOntology(Reasoner.Configuration config,
                            org.semanticweb.owl.model.OWLOntology inOntology)
                     throws org.semanticweb.owl.model.OWLException
Normalises the ontology and performs the structural transformation. After executing this method, the getter methods of this class (e.g., getConceptInclusions, getAsymmetricObjectProperties, etc) can be used to retrieve the normalised axioms and assertions from the ontology.

Parameters:
inOntology - the ontology to be normalized
Throws:
org.semanticweb.owl.model.OWLException

normalize

protected void normalize(java.util.List<org.semanticweb.owl.model.OWLDescription[]> ioInclusions,
                         java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> ioFacts)

define

public org.semanticweb.owl.model.OWLClass define(org.semanticweb.owl.model.OWLDescription desc,
                                                 java.util.List<org.semanticweb.owl.model.OWLDescription[]> outInclusions,
                                                 java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> outFacts)

simplify

protected static org.semanticweb.owl.model.OWLDescription simplify(org.semanticweb.owl.model.OWLDescription d,
                                                                   org.semanticweb.owl.model.OWLDataFactory f)
Takes an OWL description and visits it with a new SimplificationVisitor. During the visit, trivial contradictions are replaced by bottom and trivial tautologies are replaced with top.

Parameters:
d - an OWL class description
Returns:
a simplified OWL description

isSimple

protected static boolean isSimple(org.semanticweb.owl.model.OWLDescription description)
Parameters:
description - an OWL class description
Returns:
true if description is a literal or a data range, false otherwise

normalizeInclusions

protected static void normalizeInclusions(java.util.List<org.semanticweb.owl.model.OWLDescription[]> inclusions,
                                          java.util.Collection<org.semanticweb.owl.model.OWLDescription[]> outInclusions,
                                          java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> ioFacts,
                                          org.semanticweb.owl.model.OWLDataFactory factory,
                                          org.semanticweb.owl.model.OWLDescriptionVisitorEx<org.semanticweb.owl.model.OWLDescription> normalizer)

optimizedNegativeOneOfTranslation

protected static boolean optimizedNegativeOneOfTranslation(org.semanticweb.owl.model.OWLDescription[] descriptions,
                                                           org.semanticweb.owl.model.OWLDataFactory factory,
                                                           java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> ioFacts)

distributeUnionOverAnd

protected static boolean distributeUnionOverAnd(org.semanticweb.owl.model.OWLDescription[] descriptions,
                                                java.util.List<org.semanticweb.owl.model.OWLDescription[]> inclusions)
If exactly one of the classes in descriptions is an intersection, new inclusions are added that each contain one intersection operand and all the other descriptions.

Parameters:
descriptions - an array of OWL class descriptions that represent a disjunction of classes that originate from a GCI
inclusions - The set of GCIs from this ontology written a disjunctions
Returns:
true if exactly one of the descriptions is an intersection and false otherwise

getDefinitionFor

protected org.semanticweb.owl.model.OWLDescription getDefinitionFor(org.semanticweb.owl.model.OWLDescription desc,
                                                                    boolean[] alreadyExists,
                                                                    boolean forcePositive)

getDefinitionFor

protected org.semanticweb.owl.model.OWLDescription getDefinitionFor(org.semanticweb.owl.model.OWLDescription desc,
                                                                    boolean[] alreadyExists)

getClassFor

protected org.semanticweb.owl.model.OWLClass getClassFor(org.semanticweb.owl.model.OWLDescription desc,
                                                         boolean[] alreadyExists)

getDefinitionForNegativeNominal

protected org.semanticweb.owl.model.OWLClass getDefinitionForNegativeNominal(org.semanticweb.owl.model.OWLObjectOneOf nominal,
                                                                             boolean[] alreadyExists)

getConceptInclusions

public java.util.Collection<org.semanticweb.owl.model.OWLDescription[]> getConceptInclusions()

getObjectPropertyInclusions

public java.util.Collection<org.semanticweb.owl.model.OWLObjectPropertyExpression[]> getObjectPropertyInclusions()

getDataPropertyInclusions

public java.util.Collection<org.semanticweb.owl.model.OWLDataPropertyExpression[]> getDataPropertyInclusions()

getAsymmetricObjectProperties

public java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> getAsymmetricObjectProperties()

getReflexiveObjectProperties

public java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> getReflexiveObjectProperties()

getIrreflexiveObjectProperties

public java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> getIrreflexiveObjectProperties()

getTransitiveObjectProperties

public java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression> getTransitiveObjectProperties()

getDisjointObjectProperties

public java.util.Set<org.semanticweb.owl.model.OWLObjectPropertyExpression[]> getDisjointObjectProperties()

getDisjointDataProperties

public java.util.Set<org.semanticweb.owl.model.OWLDataPropertyExpression[]> getDisjointDataProperties()

getFacts

public java.util.Collection<org.semanticweb.owl.model.OWLIndividualAxiom> getFacts()