uk.ac.manchester.cs.owl.owlapi
Class SWRLRuleImpl

java.lang.Object
  extended by uk.ac.manchester.cs.owl.owlapi.OWLObjectImpl
      extended by uk.ac.manchester.cs.owl.owlapi.OWLAxiomImpl
          extended by uk.ac.manchester.cs.owl.owlapi.SWRLRuleImpl
All Implemented Interfaces:
java.lang.Comparable<OWLObject>, OWLAxiom, OWLLogicalAxiom, OWLObject, SWRLObject, SWRLRule

public class SWRLRuleImpl
extends OWLAxiomImpl
implements SWRLRule

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 15-Jan-2007


Nested Class Summary
protected  class SWRLRuleImpl.AtomSimplifier
           
 
Field Summary
protected  SWRLRuleImpl.AtomSimplifier ATOM_SIMPLIFIER
           
 
Constructor Summary
SWRLRuleImpl(OWLDataFactory dataFactory, java.util.Set<? extends SWRLAtom> body, java.util.Set<? extends SWRLAtom> head)
           
SWRLRuleImpl(OWLDataFactory dataFactory, java.util.Set<? extends SWRLAtom> body, java.util.Set<? extends SWRLAtom> head, java.util.Collection<? extends OWLAnnotation> annotations)
           
 
Method Summary
 void accept(OWLAxiomVisitor visitor)
           
<O> O
accept(OWLAxiomVisitorEx<O> visitor)
           
 void accept(OWLObjectVisitor visitor)
           
<O> O
accept(OWLObjectVisitorEx<O> visitor)
           
 void accept(SWRLObjectVisitor visitor)
           
<O> O
accept(SWRLObjectVisitorEx<O> visitor)
           
protected  int compareObjectOfSameType(OWLObject object)
           
 boolean containsAnonymousClassExpressions()
          Determines if this rule uses anonymous class expressions in class atoms.
 boolean equals(java.lang.Object obj)
           
 OWLAxiom getAnnotatedAxiom(java.util.Set<OWLAnnotation> annotations)
          Gets a copy of this axiom that is annotated with the specified annotations.
 AxiomType getAxiomType()
          Gets the axiom type for this axiom.
 SWRLRule getAxiomWithoutAnnotations()
          Gets an axiom that is structurally equivalent to this axiom without annotations.
 java.util.Set<SWRLAtom> getBody()
          Gets the atoms in the antecedent
 java.util.Set<OWLClassExpression> getClassAtomPredicates()
          Gets the predicates of class atoms.
 java.util.Set<SWRLAtom> getHead()
          Gets the atoms in the consequent.
 SWRLRule getSimplified()
          If this rule contains atoms that have predicates that are inverse object properties, then this method creates and returns a rule where the arguments of these atoms are fliped over and the predicate is the inverse (simplified) property
 java.util.Set<SWRLVariable> getVariables()
          Gets the variables that appear in this rule.
 boolean isLogicalAxiom()
          Determines if this axiom is a logical axiom.
 
Methods inherited from class uk.ac.manchester.cs.owl.owlapi.OWLAxiomImpl
equalsIgnoreAnnotations, getAnnotations, getAnnotations, getNNF, getReferencedEntities, isAnnotated, isOfType, isOfType, mergeAnnos
 
Methods inherited from class uk.ac.manchester.cs.owl.owlapi.OWLObjectImpl
compareSets, compareTo, getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getIndividualsInSignature, getNestedClassExpressions, getObjectPropertiesInSignature, getOWLDataFactory, getSignature, hashCode, isBottomEntity, isTopEntity, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.semanticweb.owlapi.model.OWLAxiom
equalsIgnoreAnnotations, getAnnotations, getAnnotations, getNNF, isAnnotated, isOfType, isOfType
 
Methods inherited from interface org.semanticweb.owlapi.model.OWLObject
getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getIndividualsInSignature, getNestedClassExpressions, getObjectPropertiesInSignature, getSignature, isBottomEntity, isTopEntity
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

ATOM_SIMPLIFIER

protected SWRLRuleImpl.AtomSimplifier ATOM_SIMPLIFIER
Constructor Detail

SWRLRuleImpl

public SWRLRuleImpl(OWLDataFactory dataFactory,
                    java.util.Set<? extends SWRLAtom> body,
                    java.util.Set<? extends SWRLAtom> head,
                    java.util.Collection<? extends OWLAnnotation> annotations)

SWRLRuleImpl

public SWRLRuleImpl(OWLDataFactory dataFactory,
                    java.util.Set<? extends SWRLAtom> body,
                    java.util.Set<? extends SWRLAtom> head)
Method Detail

getAxiomWithoutAnnotations

public SWRLRule getAxiomWithoutAnnotations()
Description copied from interface: OWLAxiom
Gets an axiom that is structurally equivalent to this axiom without annotations. This essentially returns a version of this axiom stripped of any annotations

Specified by:
getAxiomWithoutAnnotations in interface OWLAxiom
Specified by:
getAxiomWithoutAnnotations in interface SWRLRule
Returns:
The annotationless version of this axiom

getAnnotatedAxiom

public OWLAxiom getAnnotatedAxiom(java.util.Set<OWLAnnotation> annotations)
Description copied from interface: OWLAxiom
Gets a copy of this axiom that is annotated with the specified annotations. If this axiom has any annotations on it they will be merged with the specified set of annotations. Note that this axiom will not be modified (or remove from any ontologies).

Specified by:
getAnnotatedAxiom in interface OWLAxiom
Parameters:
annotations - The annotations that will be added to existing annotations to annotate the copy of this axiom
Returns:
A copy of this axiom that has the specified annotations plus any existing annotations returned by the OWLAxiom#getAnnotations() method.

getVariables

public java.util.Set<SWRLVariable> getVariables()
Description copied from interface: SWRLRule
Gets the variables that appear in this rule.

Specified by:
getVariables in interface SWRLRule
Returns:
A set of variables.

containsAnonymousClassExpressions

public boolean containsAnonymousClassExpressions()
Description copied from interface: SWRLRule
Determines if this rule uses anonymous class expressions in class atoms.

Specified by:
containsAnonymousClassExpressions in interface SWRLRule
Returns:
true if this rule contains anonymous class expression in class atoms, otherwise false.

getClassAtomPredicates

public java.util.Set<OWLClassExpression> getClassAtomPredicates()
Description copied from interface: SWRLRule
Gets the predicates of class atoms.

Specified by:
getClassAtomPredicates in interface SWRLRule
Returns:
A set of class expressions that represent the class class expressions that are predicates of class atoms.

accept

public void accept(OWLObjectVisitor visitor)
Specified by:
accept in interface OWLObject

accept

public <O> O accept(OWLObjectVisitorEx<O> visitor)
Specified by:
accept in interface OWLObject

accept

public void accept(SWRLObjectVisitor visitor)
Specified by:
accept in interface SWRLObject

accept

public <O> O accept(SWRLObjectVisitorEx<O> visitor)
Specified by:
accept in interface SWRLObject

getBody

public java.util.Set<SWRLAtom> getBody()
Gets the atoms in the antecedent

Specified by:
getBody in interface SWRLRule
Returns:
A set of SWRLAtoms, which represent the atoms in the antecedent of the rule.

getHead

public java.util.Set<SWRLAtom> getHead()
Gets the atoms in the consequent.

Specified by:
getHead in interface SWRLRule
Returns:
A set of SWRLAtoms, which represent the atoms in the consequent of the rule

accept

public void accept(OWLAxiomVisitor visitor)
Specified by:
accept in interface OWLAxiom

accept

public <O> O accept(OWLAxiomVisitorEx<O> visitor)
Specified by:
accept in interface OWLAxiom

getSimplified

public SWRLRule getSimplified()
If this rule contains atoms that have predicates that are inverse object properties, then this method creates and returns a rule where the arguments of these atoms are fliped over and the predicate is the inverse (simplified) property

Specified by:
getSimplified in interface SWRLRule
Returns:
The rule such that any atoms of the form inverseOf(p)(x, y) are transformed to p(x, y).

isLogicalAxiom

public boolean isLogicalAxiom()
Determines if this axiom is a logical axiom. Logical axioms are defined to be axioms other than declaration axioms (including imports declarations) and annotation axioms.

Specified by:
isLogicalAxiom in interface OWLAxiom
Returns:
true if the axiom is a logical axiom, false if the axiom is not a logical axiom.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class OWLAxiomImpl

getAxiomType

public AxiomType getAxiomType()
Description copied from interface: OWLAxiom
Gets the axiom type for this axiom.

Specified by:
getAxiomType in interface OWLAxiom
Returns:
The axiom type that corresponds to the type of this axiom.

compareObjectOfSameType

protected int compareObjectOfSameType(OWLObject object)
Specified by:
compareObjectOfSameType in class OWLObjectImpl