org.semanticweb.owlapi.model
Interface OWLClassExpression

All Superinterfaces:
java.lang.Comparable<OWLObject>, OWLObject, OWLPropertyRange, SWRLPredicate
All Known Subinterfaces:
OWLAnonymousClassExpression, OWLBooleanClassExpression, OWLCardinalityRestriction<R,P,F>, OWLClass, OWLDataAllValuesFrom, OWLDataCardinalityRestriction, OWLDataExactCardinality, OWLDataHasValue, OWLDataMaxCardinality, OWLDataMinCardinality, OWLDataSomeValuesFrom, OWLHasValueRestriction<R,P,V>, OWLNaryBooleanClassExpression, OWLObjectAllValuesFrom, OWLObjectCardinalityRestriction, OWLObjectComplementOf, OWLObjectExactCardinality, OWLObjectHasSelf, OWLObjectHasValue, OWLObjectIntersectionOf, OWLObjectMaxCardinality, OWLObjectMinCardinality, OWLObjectOneOf, OWLObjectSomeValuesFrom, OWLObjectUnionOf, OWLQuantifiedDataRestriction, OWLQuantifiedObjectRestriction, OWLQuantifiedRestriction<R,P,F>, OWLRestriction<R,P,F>
All Known Implementing Classes:
OWLAnonymousClassExpressionImpl, OWLCardinalityRestrictionImpl, OWLClassExpressionImpl, OWLClassImpl, OWLDataAllValuesFromImpl, OWLDataCardinalityRestrictionImpl, OWLDataExactCardinalityImpl, OWLDataHasValueImpl, OWLDataMaxCardinalityImpl, OWLDataMinCardinalityImpl, OWLDataSomeValuesFromImpl, OWLNaryBooleanClassExpressionImpl, OWLObjectAllValuesFromImpl, OWLObjectCardinalityRestrictionImpl, OWLObjectComplementOfImpl, OWLObjectExactCardinalityImpl, OWLObjectHasSelfImpl, OWLObjectHasValueImpl, OWLObjectIntersectionOfImpl, OWLObjectMaxCardinalityImpl, OWLObjectMinCardinalityImpl, OWLObjectOneOfImpl, OWLObjectSomeValuesFromImpl, OWLObjectUnionOfImpl, OWLQuantifiedDataRestrictionImpl, OWLQuantifiedObjectRestrictionImpl, OWLQuantifiedRestrictionImpl, OWLRestrictionImpl, OWLValueRestrictionImpl

public interface OWLClassExpression
extends OWLObject, OWLPropertyRange, SWRLPredicate

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group Date: 24-Oct-2006 Represents Class Expressions in the OWL 2 specification. This interface covers named and anonymous classes.


Method Summary
 void accept(OWLClassExpressionVisitor visitor)
          Accepts a visit from an OWLExpressionVisitor
<O> O
accept(OWLClassExpressionVisitorEx<O> visitor)
           
 java.util.Set<OWLClassExpression> asConjunctSet()
          Interprets this expression as a conjunction and returns the conjuncts.
 java.util.Set<OWLClassExpression> asDisjunctSet()
          Interprets this expression as a disjunction and returns the disjuncts.
 OWLClass asOWLClass()
          If this class expression is in fact a named class then this method may be used to obtain the expression as an OWLClass without the need for casting.
 boolean containsConjunct(OWLClassExpression ce)
          Determines if this class expression contains a particular conjunct.
 ClassExpressionType getClassExpressionType()
          Gets the class expression type for this class expression
 OWLClassExpression getComplementNNF()
          Gets the negation normal form of the complement of this expression.
 OWLClassExpression getNNF()
          Gets this expression in negation normal form.
 OWLClassExpression getObjectComplementOf()
          Gets the object complement of this class expression.
 boolean isAnonymous()
          Determines whether or not this expression represents an anonymous class expression.
 boolean isClassExpressionLiteral()
          Determines if this class is a literal.
 boolean isOWLNothing()
          Determines if this expression is the built in class owl:Nothing.
 boolean isOWLThing()
          Determines if this expression is the built in class owl:Thing.
 

Method Detail

getClassExpressionType

ClassExpressionType getClassExpressionType()
Gets the class expression type for this class expression

Returns:
The class expression type

isAnonymous

boolean isAnonymous()
Determines whether or not this expression represents an anonymous class expression.

Returns:
true if this is an anonymous class expression, or false if this is a named class (OWLClass)

isClassExpressionLiteral

boolean isClassExpressionLiteral()
Determines if this class is a literal. A literal being either a named class or the negation of a named class (i.e. A or not(A)).

Returns:
true if this is a literal, or false if this is not a literal.

asOWLClass

OWLClass asOWLClass()
If this class expression is in fact a named class then this method may be used to obtain the expression as an OWLClass without the need for casting. The general pattern of use is to use the isAnonymous to first check

Returns:
This class expression as an OWLClass.
Throws:
OWLRuntimeException - if this class expression is not an OWLClass.

isOWLThing

boolean isOWLThing()
Determines if this expression is the built in class owl:Thing. This method does not determine if the class is equivalent to owl:Thing.

Returns:
true if this expression is owl:Thing, or false if this expression is not owl:Thing

isOWLNothing

boolean isOWLNothing()
Determines if this expression is the built in class owl:Nothing. This method does not determine if the class is equivalent to owl:Nothing.

Returns:
true if this expression is owl:Nothing, or false if this expression is not owl:Nothing.

getNNF

OWLClassExpression getNNF()
Gets this expression in negation normal form.

Returns:
The expression in negation normal form.

getComplementNNF

OWLClassExpression getComplementNNF()
Gets the negation normal form of the complement of this expression.

Returns:
A expression that represents the NNF of the complement of this expression.

getObjectComplementOf

OWLClassExpression getObjectComplementOf()
Gets the object complement of this class expression.

Returns:
A class expression that is the complement of this class expression.

asConjunctSet

java.util.Set<OWLClassExpression> asConjunctSet()
Interprets this expression as a conjunction and returns the conjuncts. This method does not normalise the expression (full CNF is not computed).

Returns:
The conjucts of this expression if it is a conjunction (object intersection of), or otherwise a singleton set containing this expression. Note that nested conjunctions will be flattened, for example, calling this method on (A and B) and C will return the set {A, B, C}

containsConjunct

boolean containsConjunct(OWLClassExpression ce)
Determines if this class expression contains a particular conjunct. This method does not do any normalisation such as applying DeMorgans rules.

Parameters:
ce - The conjunct to test for
Returns:
true if this class expression is equal to ce or if this class expression is an ObjectIntersectionOf (possibly nested withing another ObjectIntersectionOf) that contains ce, otherwise false.

asDisjunctSet

java.util.Set<OWLClassExpression> asDisjunctSet()
Interprets this expression as a disjunction and returns the disjuncts. This method does not normalise the expression (full DNF is not computed).

Returns:
The disjuncts of this expression if it is a disjunction (object union of), or otherwise a singleton set containing this expression. Note that nested disjunctions will be flattened, for example, calling this method on (A or B) or C will return the set {A, B, C}

accept

void accept(OWLClassExpressionVisitor visitor)
Accepts a visit from an OWLExpressionVisitor

Parameters:
visitor - The visitor that wants to visit

accept

<O> O accept(OWLClassExpressionVisitorEx<O> visitor)