edu.stanford.smi.protegex.owl.model
Interface OWLNamedClass

All Superinterfaces:
edu.stanford.smi.protege.model.Cls, Comparable, Deprecatable, edu.stanford.smi.protege.model.Frame, edu.stanford.smi.protege.model.Instance, OWLClass, ProtegeCls, ProtegeInstance, RDFObject, RDFResource, RDFSClass, RDFSNamedClass, Visitable
All Known Implementing Classes:
DefaultOWLNamedClass

public interface OWLNamedClass
extends RDFSNamedClass, OWLClass

A named OWL class.

Author:
Holger Knublauch

Method Summary
 void addDisjointClass(RDFSClass disjointClass)
          Adds a class to the list of disjoint classes of this.
 void addEquivalentClass(RDFSClass equivalentClass)
          Adds a given class to the list of equivalent classes of this.
 void addInferredSuperclass(RDFSClass superclass)
          Adds a computed superclass, as the result of a classification.
 OWLIndividual createOWLIndividual(String name)
          Creates a new individual of this (assuming this is not a metaclass).
 RDFResource getAllValuesFrom(RDFProperty property)
          Gets the allowed class for a given property.
 int getClassificationStatus()
          Gets the classification status (whether this class is marked as inconsistent or not).
 RDFSClass getDefinition()
          Gets the first equivalent class of this, or null if none is equivalent.
 Collection getDirectRestrictions()
          Deprecated. will be deleted shortly, replaced with getRestrictions(false)
 Collection getDisjointClasses()
          Gets the disjoint classes of this.
 Object getHasValue(RDFProperty property)
          Gets the value of any owl:hasValue restriction defined on this class.
 Collection getInferredEquivalentClasses()
           
 Collection getInferredSubclasses()
          Gets the subclasses that were computed by the most recent call of a classifier.
 Collection getInferredSuperclasses()
          Gets the superclasses that were computed by the most recent call of a classifier.
 int getMaxCardinality(RDFProperty property)
          Gets the maximum number of values that are allowed for a given property at this class.
 int getMinCardinality(RDFProperty property)
          Gets the minimum number of values that are allowed for a given property at this class.
 Collection getRestrictions()
          Same as getRestrictions(false).
 Collection getRestrictions(boolean includingSuperclassRestrictions)
          Gets all Restrictions that are defined on this class or (optionally) its superclasses.
 Collection getRestrictions(RDFProperty property, boolean includingSuperclassRestrictions)
          Gets all restrictions that are defined on a given property.
 RDFResource getSomeValuesFrom(RDFProperty property)
          Gets the filler of any defined someValuesFrom restriction for a given property.
 boolean getSubclassesDisjoint()
          Checks whether all subclasses of this are declared to be disjoint.
 boolean hasNamedSuperclass()
          Checks whether this has at least one named direct superclass.
 boolean isConsistent()
          Determines whether this class has been flagged as being inconsistent or not.
 boolean isDefinedClass()
          Checks if this is a "defined" class, with necessary and sufficient conditions.
 boolean isProbeClass()
          Checks if this has been marked as a probe class, using the protege:probeClass annotation property.
 void removeDisjointClass(RDFSClass disjointClass)
          Removes a disjoint class of this.
 void removeEquivalentClass(RDFSClass equivalentClass)
          Removes an equivalent class.
 void removeInferredSuperclass(RDFSClass superclass)
          Removes a computed superclass, as the result of a classification.
 void setClassificationStatus(int value)
          Sets the classification status of this.
 void setDefinition(RDFSClass definingClass)
          Removes all equivalent classes and then adds the given class (as definition).
 void setSubclassesDisjoint(boolean value)
          Sets the value of the protege:subclassesDisjoint flag at this class.
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.RDFSNamedClass
createAnonymousInstance, createRDFIndividual, getAssociatedProperties, getFirstSuperclass, getUnionRangeClasses, isFunctionalProperty, isVisibleFromOWLThing
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.RDFSClass
addClassListener, addSuperclass, createClone, createInstance, getDependingClasses, getEquivalentClasses, getImageIcon, getInferredInstanceCount, getInferredInstances, getInstanceCount, getInstances, getNamedSubclasses, getNamedSubclasses, getNamedSuperclasses, getNamedSuperclasses, getNestedBrowserText, getNestedNamedClasses, getParsableExpression, getPureSuperclasses, getSubclassCount, getSubclasses, getSuperclassCount, getSuperclasses, getUnionDomainProperties, getUnionDomainProperties, hasEquivalentClass, hasPropertyValueWithBrowserText, isAnonymous, isMetaclass, isSubclassOf, removeClassListener, removeSuperclass
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.ProtegeCls
addClsListener, addDirectSuperclass, addDirectTemplateSlot, addTemplateFacetValue, addTemplateSlotValue, createDirectInstance, getBrowserSlotPattern, getConcreteSubclasses, getDirectBrowserSlotPattern, getDirectInstanceCount, getDirectInstances, getDirectlyOverriddenTemplateFacets, getDirectSubclassCount, getDirectSubclasses, getDirectSuperclassCount, getDirectSuperclasses, getDirectTemplateFacetValues, getDirectTemplateSlots, getDirectTemplateSlotValues, getInheritedBrowserSlotPattern, getInstanceCount, getInstances, getOverriddenTemplateFacets, getSubclasses, getSuperclasses, getTemplateFacets, getTemplateFacetValue, getTemplateFacetValues, getTemplateSlotAllowedClses, getTemplateSlotAllowedParents, getTemplateSlotAllowedValues, getTemplateSlotAllowsMultipleValues, getTemplateSlotDefaultValues, getTemplateSlotDocumentation, getTemplateSlotMaximumCardinality, getTemplateSlotMaximumValue, getTemplateSlotMinimumCardinality, getTemplateSlotMinimumValue, getTemplateSlots, getTemplateSlotValue, getTemplateSlotValues, getTemplateSlotValueType, getVisibleDirectSubclassCount, getVisibleDirectSubclasses, getVisibleTemplateSlots, hasDirectlyOverriddenTemplateFacet, hasDirectlyOverriddenTemplateSlot, hasDirectSuperclass, hasDirectTemplateSlot, hasInheritedTemplateSlot, hasOverriddenTemplateFacet, hasOverriddenTemplateSlot, hasSuperclass, hasTemplateFacet, hasTemplateSlot, isAbstract, isClsMetaCls, isConcrete, isDefaultClsMetaCls, isDefaultFacetMetaCls, isDefaultSlotMetaCls, isFacetMetaCls, isMetaCls, isRoot, isSlotMetaCls, moveDirectSubclass, moveDirectTemplateSlot, removeClsListener, removeDirectSuperclass, removeDirectTemplateSlot, removeTemplateFacetOverrides, setAbstract, setDirectBrowserSlot, setDirectBrowserSlotPattern, setDirectTypeOfSubclasses, setTemplateFacetValue, setTemplateFacetValues, setTemplateSlotAllowedClses, setTemplateSlotAllowedParents, setTemplateSlotAllowedValues, setTemplateSlotAllowsMultipleValues, setTemplateSlotDefaultValues, setTemplateSlotDocumentation, setTemplateSlotDocumentation, setTemplateSlotMaximumCardinality, setTemplateSlotMaximumValue, setTemplateSlotMinimumCardinality, setTemplateSlotMinimumValue, setTemplateSlotValue, setTemplateSlotValues, setTemplateSlotValueType
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.ProtegeInstance
addDirectType, addFrameListener, addInstanceListener, addOwnFacetValue, addOwnSlotValue, areValidOwnSlotValues, copy, deepCopy, getBrowserText, getDirectOwnSlotValue, getDirectOwnSlotValues, getDirectType, getDirectTypes, getDocumentation, getFrameID, getIcon, getInvalidOwnSlotValuesText, getInvalidOwnSlotValueText, getKnowledgeBase, getOwnFacetValue, getOwnFacetValues, getOwnSlotAllowsMultipleValues, getOwnSlotAndSubslotValues, getOwnSlotDefaultValues, getOwnSlotFacets, getOwnSlotFacetValues, getOwnSlots, getOwnSlotValue, getOwnSlotValueCount, getOwnSlotValues, getOwnSlotValueType, getProject, getReachableSimpleInstances, getReferences, getReferences, hasDirectType, hasOwnSlot, hasType, isBeingDeleted, isDeleted, isEditable, isIncluded, isSystem, isValidOwnSlotValue, markDeleted, markDeleting, removeDirectType, removeFrameListener, removeInstanceListener, removeOwnSlotValue, setDirectOwnSlotValue, setDirectOwnSlotValues, setDirectType, setDirectTypes, setDocumentation, setDocumentation, setEditable, setIncluded, setOwnFacetValue, setOwnFacetValues, setOwnSlotValue, setOwnSlotValues, shallowCopy
 
Methods inherited from interface edu.stanford.smi.protege.model.Instance
moveDirectType
 
Methods inherited from interface edu.stanford.smi.protege.model.Frame
delete, getName, isValid, isVisible, moveDirectOwnSlotValue, setName, setVisible
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface edu.stanford.smi.protege.model.Cls
getBrowserSlot, getDirectBrowserSlot, getInheritedBrowserSlot
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.RDFResource
addComment, addDifferentFrom, addIsDefinedBy, addLabel, addPropertyValue, addPropertyValueListener, addProtegeType, addRDFType, addResourceListener, addSameAs, addVersionInfo, as, canAs, delete, getAllValuesFromOnTypes, getBrowserText, getComments, getDifferentFrom, getHasValuesOnTypes, getIconLocation, getIconName, getInferredTypes, getIsDefinedBy, getLabels, getLocalName, getName, getNamespace, getNamespacePrefix, getOWLModel, getPossibleRDFProperties, getPropertyValue, getPropertyValue, getPropertyValueAs, getPropertyValueCount, getPropertyValueLiteral, getPropertyValueLiterals, getPropertyValues, getPropertyValues, getPropertyValuesAs, getProtegeType, getProtegeTypes, getRDFProperties, getRDFType, getRDFTypes, getReferringAnonymousClasses, getSameAs, getURI, getVersionInfo, hasPropertyValue, hasPropertyValue, hasPropertyValue, hasPropertyValue, hasProtegeType, hasProtegeType, hasRDFType, hasRDFType, isValidPropertyValue, isVisible, listPropertyValues, listPropertyValues, listPropertyValuesAs, listRDFTypes, removeComment, removeDifferentFrom, removeIsDefinedBy, removeLabel, removePropertyValue, removePropertyValueListener, removeProtegeType, removeRDFType, removeResourceListener, removeSameAs, removeVersionInfo, setComment, setComments, setInferredTypes, setName, setPropertyValue, setPropertyValues, setProtegeType, setProtegeTypes, setRDFType, setRDFTypes, setVisible
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.RDFObject
equalsStructurally
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.visitor.Visitable
accept
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.Deprecatable
isDeprecated, setDeprecated
 

Method Detail

addDisjointClass

public void addDisjointClass(RDFSClass disjointClass)
Adds a class to the list of disjoint classes of this.

Parameters:
disjointClass - the disjoint class to add

addEquivalentClass

public void addEquivalentClass(RDFSClass equivalentClass)
Adds a given class to the list of equivalent classes of this. This will establish a bidirectional superclass relationship between the two classes.

Parameters:
equivalentClass - the RDFSClass to add as equivalent class

addInferredSuperclass

public void addInferredSuperclass(RDFSClass superclass)
Adds a computed superclass, as the result of a classification. This will automatically add the inverse direction, too.

Parameters:
superclass - the computed superclass to add

createOWLIndividual

public OWLIndividual createOWLIndividual(String name)
Creates a new individual of this (assuming this is not a metaclass).

Parameters:
name - the name of the new instance or null for a default value
Returns:
the new instance

getAllValuesFrom

public RDFResource getAllValuesFrom(RDFProperty property)
Gets the allowed class for a given property. This is the filler of an allValuesFrom restriction, or the range of the property (if no restriction has been defined).


getClassificationStatus

public int getClassificationStatus()
Gets the classification status (whether this class is marked as inconsistent or not).

Returns:
one of the OWLNames.CLASSIFICATION_STATUS constants

getDefinition

public RDFSClass getDefinition()
Gets the first equivalent class of this, or null if none is equivalent.

Returns:
the first equivalent class

getDirectRestrictions

public Collection getDirectRestrictions()
Deprecated. will be deleted shortly, replaced with getRestrictions(false)

See Also:
getRestrictions()

getDisjointClasses

public Collection getDisjointClasses()
Gets the disjoint classes of this.

Returns:
a Collection of RDFSClass instances

getHasValue

public Object getHasValue(RDFProperty property)
Gets the value of any owl:hasValue restriction defined on this class. Note that this will also check for restrictions defined on superclasses.

Parameters:
property - the property to look for hasValue restrictions on
Returns:
the restriction value or null if none is defined.

getInferredEquivalentClasses

public Collection getInferredEquivalentClasses()

getInferredSubclasses

public Collection getInferredSubclasses()
Gets the subclasses that were computed by the most recent call of a classifier.

Returns:
a Collection of RDFSClass objects

getInferredSuperclasses

public Collection getInferredSuperclasses()
Gets the superclasses that were computed by the most recent call of a classifier.

Returns:
a Collection of RDFSClass objects

getMaxCardinality

public int getMaxCardinality(RDFProperty property)
Gets the maximum number of values that are allowed for a given property at this class. This method essentially returns the filler of any owl:maxCardinality or owl:cardinality restrictions that are defined on it, either directly, or in its superclasses. If the property is functional, then this method always returns 1. If neither functionality nor restrictions are found, the method delivers -1.

Parameters:
property - the property to get the maximum cardinality of
Returns:
the maximum cardinality or -1 if there is no limit

getMinCardinality

public int getMinCardinality(RDFProperty property)
Gets the minimum number of values that are allowed for a given property at this class. This method essentially returns the filler of any owl:minCardinality or owl:cardinality restrictions that are defined on it, either directly, or in its superclasses.

Parameters:
property - the property to get the minimum cardinality of
Returns:
the minimum cardinality or 0 if there is no limit

getRestrictions

public Collection getRestrictions()
Same as getRestrictions(false).

Returns:
a Collection of (direct) OWLRestrictions objects

getRestrictions

public Collection getRestrictions(boolean includingSuperclassRestrictions)
Gets all Restrictions that are defined on this class or (optionally) its superclasses. In case superclasses are also considered, the method filters out those restrictions that have been "overloaded" further down. For example, if a subclass defines an owl:minCardinality restriction that narrows another owl:minCardinality on the same property at a higher class, then only the first restriction is being returned.

Parameters:
includingSuperclassRestrictions - true to also include restrictions from named superclasses
Returns:
a Collection of OWLRestriction objects
See Also:
getDirectRestrictions()

getRestrictions

public Collection getRestrictions(RDFProperty property,
                                  boolean includingSuperclassRestrictions)
Gets all restrictions that are defined on a given property. This is similar to getRestrictions(includingSuperclassRestrictions) but with only those restrictions that restrict the selected property.

Parameters:
property - the property to get the restrictions about
includingSuperclassRestrictions - true to also include restrictions from named superclasses
Returns:
the restrictions on property

getSomeValuesFrom

public RDFResource getSomeValuesFrom(RDFProperty property)
Gets the filler of any defined someValuesFrom restriction for a given property.


getSubclassesDisjoint

public boolean getSubclassesDisjoint()
Checks whether all subclasses of this are declared to be disjoint.

Returns:
true if the all children disjoint flag is set

hasNamedSuperclass

public boolean hasNamedSuperclass()
Checks whether this has at least one named direct superclass. This invariant should always be true in a consistent model.

Returns:
true iff there is at least one named direct superclass

isConsistent

public boolean isConsistent()
Determines whether this class has been flagged as being inconsistent or not.

Returns:
true if the class is consistent, false if the class is inconsistent.

isDefinedClass

public boolean isDefinedClass()
Checks if this is a "defined" class, with necessary and sufficient conditions. This is equivalent to getDefinition() != null.

Returns:
true if this has a definition

isProbeClass

public boolean isProbeClass()
Checks if this has been marked as a probe class, using the protege:probeClass annotation property.

Returns:
true if this is a probe class

removeDisjointClass

public void removeDisjointClass(RDFSClass disjointClass)
Removes a disjoint class of this. If the disjoint class is anonymous, it is completely deleted from the knowledge base.

Parameters:
disjointClass - the disjoint class to remove

removeEquivalentClass

public void removeEquivalentClass(RDFSClass equivalentClass)
Removes an equivalent class. If the equivalent class is anonymous, it is completely removed from the knowledge base. Otherwise, this method removes the bidirectional superclass relationship between the two classes.

Note that an alternative to using this method is to remove either class from the superclasses of the other (in Protege, two OWL classes are treated as equivalent iff they are direct superclasses of each other).

Parameters:
equivalentClass -

removeInferredSuperclass

public void removeInferredSuperclass(RDFSClass superclass)
Removes a computed superclass, as the result of a classification. This will automatically remove the inverse direction, too.

Parameters:
superclass - the computed superclass to remove

setClassificationStatus

public void setClassificationStatus(int value)
Sets the classification status of this.

Parameters:
value - one of OWLNames.CLASSIFICATION_STATUS_xxx

setDefinition

public void setDefinition(RDFSClass definingClass)
Removes all equivalent classes and then adds the given class (as definition). If after the call no other named direct superclasses would remain, the method adds owl:Thing to the superclasses.

Parameters:
definingClass - the new equivalent class

setSubclassesDisjoint

public void setSubclassesDisjoint(boolean value)
Sets the value of the protege:subclassesDisjoint flag at this class. Note that this operation is only permitted if the protege metadata ontology has been imported, i.e. the protege:subclassesDisjoint property must exist.

Parameters:
value - the new value