edu.stanford.smi.protegex.owl.model.impl
Class DefaultOWLNamedClass

java.lang.Object
  extended byedu.stanford.smi.protege.model.DefaultFrame
      extended byedu.stanford.smi.protege.model.DefaultInstance
          extended byedu.stanford.smi.protege.model.DefaultCls
              extended byedu.stanford.smi.protegex.owl.model.impl.AbstractRDFSClass
                  extended byedu.stanford.smi.protegex.owl.model.impl.DefaultRDFSNamedClass
                      extended byedu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass
All Implemented Interfaces:
edu.stanford.smi.protege.model.Cls, Comparable, Deprecatable, Externalizable, edu.stanford.smi.protege.model.Frame, edu.stanford.smi.protege.model.Instance, edu.stanford.smi.protege.model.Localizable, OWLClass, OWLNamedClass, ProtegeCls, ProtegeInstance, RDFObject, RDFResource, RDFSClass, RDFSNamedClass, Serializable, Visitable

public class DefaultOWLNamedClass
extends DefaultRDFSNamedClass
implements OWLNamedClass

The default implementation of the OWLNamedClass interface.

Author:
Holger Knublauch
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.stanford.smi.protege.model.DefaultFrame
 
Constructor Summary
DefaultOWLNamedClass()
           
DefaultOWLNamedClass(edu.stanford.smi.protege.model.KnowledgeBase kb, edu.stanford.smi.protege.model.FrameID id)
           
 
Method Summary
 void accept(OWLModelVisitor visitor)
          This method is provided to be used with the OWLModelVisitor, which is part of the visitor design pattern.
 void addDisjointClass(RDFSClass aClass)
          Adds a class to the list of disjoint classes of this.
 void addEquivalentClass(RDFSClass aClass)
          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).
 boolean equalsStructurally(RDFSClass cls)
           
 RDFResource getAllValuesFrom(RDFProperty property)
          Gets the allowed class for a given property.
 Set getAssociatedProperties()
          Gets all properties that have been associated with this class.
 int getClassificationStatus()
          Gets the classification status (whether this class is marked as inconsistent or not).
 Collection getDirectRestrictions()
           
private  void getDirectRestrictions(Collection results, Iterator clses)
           
 Object getHasValue(RDFProperty property)
          Gets the value of any owl:hasValue restriction defined on this class.
 Icon getIcon()
           
 String getIconName()
          Gets the local name of an icon for this type of resource.
 ImageIcon getImageIcon()
          Gets an ImageIcon displaying this.
private  ImageIcon getImageIconForNonMetaclass()
           
private  String getImageIconNameForNonMetaclass()
           
 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.
private static void getRestrictions(OWLNamedClass cls, Set reached, Collection results)
           
 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 hasNamedSuperClass()
           
 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 isFunctionalProperty(RDFProperty property)
          Checks whether a given property is "functional" at this class.
private static boolean isOverloadedAllValuesFrom(OWLAllValuesFrom restriction, Collection restrictions)
           
private static boolean isOverloadedCardinality(OWLCardinality restriction, Collection restrictions)
           
private static boolean isOverloadedMaxCardinality(OWLMaxCardinality restriction, Collection restrictions)
           
private static boolean isOverloadedMinCardinality(OWLMinCardinality restriction, Collection restrictions)
           
 boolean isProbeClass()
          Checks if this has been marked as a probe class, using the protege:probeClass annotation property.
 void removeDisjointClass(RDFSClass aClass)
          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 class edu.stanford.smi.protegex.owl.model.impl.DefaultRDFSNamedClass
createAnonymousInstance, createClone, createRDFIndividual, equalsStructurally, getDependingClasses, getFirstSuperclass, getNestedBrowserText, getNestedNamedClasses, getUnionRangeClasses, isAnonymous, isDeprecated, isVisibleFromOWLThing, setDeprecated
 
Methods inherited from class edu.stanford.smi.protegex.owl.model.impl.AbstractRDFSClass
addAnonymousClses, addClassListener, addComment, addDifferentFrom, addIsDefinedBy, addLabel, addPropertyValue, addPropertyValueListener, addProtegeType, addRDFType, addResourceListener, addSameAs, addSuperclass, addToUnionDomainOf, addVersionInfo, as, canAs, createInstance, getAbstractOWLModel, getAllValuesFromOnTypes, getComments, getDefinition, getDifferentFrom, getDirectTemplateFacetValue, getDisjointClasses, getDocumentation, getEquivalentClasses, getHasValuesOnTypes, getIconLocation, getInferredInstanceCount, getInferredInstances, getInferredTypes, getInstanceCount, getInstances, getIsDefinedBy, getLabels, getLocalName, getNamedSubclasses, getNamedSubclasses, getNamedSuperclasses, getNamedSuperclasses, getNamespace, getNamespacePrefix, getOWLModel, getParsableExpression, getPossibleRDFProperties, getPropertyValue, getPropertyValue, getPropertyValueAs, getPropertyValueCount, getPropertyValueLiteral, getPropertyValueLiterals, getPropertyValues, getPropertyValues, getPropertyValuesAs, getProtegeType, getProtegeTypes, getPureSuperclasses, getRDFProperties, getRDFType, getRDFTypes, getReferringAnonymousClasses, getSameAs, getSubclassCount, getSubclasses, getSuperclassCount, getSuperclasses, getUnionDomainProperties, getUnionDomainProperties, getURI, getVersionInfo, hasEquivalentClass, hasPropertyValue, hasPropertyValue, hasPropertyValue, hasPropertyValue, hasPropertyValueWithBrowserText, hasPropertyValueWithBrowserText, hasProtegeType, hasProtegeType, hasRDFType, hasRDFType, isMetaclass, isSubclassOf, isValidPropertyValue, listPropertyValues, listPropertyValues, listPropertyValuesAs, listRDFTypes, removeClassListener, removeComment, removeDifferentFrom, removeIsDefinedBy, removeLabel, removePropertyValue, removePropertyValueListener, removeProtegeType, removeRDFType, removeResourceListener, removeSameAs, removeSuperclass, removeVersionInfo, setComment, setComments, setDocumentation, setInferredTypes, setPropertyValue, setPropertyValues, setProtegeType, setProtegeTypes, setRDFType, setRDFTypes
 
Methods inherited from class edu.stanford.smi.protege.model.DefaultCls
addClsListener, addDirectSuperclass, addDirectTemplateSlot, addTemplateFacetValue, addTemplateSlotValue, createDirectInstance, getBrowserSlot, getBrowserSlotPattern, getConcreteSubclasses, getDirectBrowserSlot, getDirectBrowserSlotPattern, getDirectInstanceCount, getDirectInstances, getDirectlyOverriddenTemplateFacets, getDirectSubclassCount, getDirectSubclasses, getDirectSuperclassCount, getDirectSuperclasses, getDirectTemplateFacetValues, getDirectTemplateSlots, getDirectTemplateSlotValues, getInheritedBrowserSlot, 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, toString
 
Methods inherited from class edu.stanford.smi.protege.model.DefaultInstance
addDirectType, addInstanceListener, copy, deepCopy, getBrowserText, getDirectType, getDirectTypes, getOwnFacetValue, getOwnFacetValues, getReachableSimpleInstances, hasDirectType, hasType, moveDirectType, removeDirectType, removeInstanceListener, setDirectType, setDirectTypes, shallowCopy
 
Methods inherited from class edu.stanford.smi.protege.model.DefaultFrame
addFrameListener, addOwnFacetValue, addOwnSlotValue, areValidOwnSlotValues, compareTo, delete, equals, equals, getDefaultKnowledgeBase, getDefiningProjectURI, getDirectOwnSlotValue, getDirectOwnSlotValues, getFrameID, getInvalidOwnSlotValuesText, getInvalidOwnSlotValueText, getKnowledgeBase, getName, getOwnSlotAllowsMultipleValues, getOwnSlotAndSubslotValues, getOwnSlotDefaultValues, getOwnSlotFacets, getOwnSlotFacetValues, getOwnSlots, getOwnSlotValue, getOwnSlotValueCount, getOwnSlotValues, getOwnSlotValueType, getProject, getReferences, getReferences, hashCode, hasOwnSlot, isBeingDeleted, isDeleted, isEditable, isIncluded, isSystem, isValid, isValidOwnSlotValue, isVisible, localize, markDeleted, markDeleting, moveDirectOwnSlotValue, readExternal, removeFrameListener, removeOwnSlotValue, setDirectOwnSlotValue, setDirectOwnSlotValues, setDocumentation, setEditable, setIncluded, setName, setOwnFacetValue, setOwnFacetValues, setOwnSlotValue, setOwnSlotValues, setSystem, setVisible, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.OWLNamedClass
getDefinition, getDisjointClasses
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.RDFSNamedClass
createAnonymousInstance, createRDFIndividual, getFirstSuperclass, getUnionRangeClasses, isVisibleFromOWLThing
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.RDFSClass
addClassListener, addSuperclass, createClone, createInstance, getDependingClasses, getEquivalentClasses, 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, 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, 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.Deprecatable
isDeprecated, setDeprecated
 

Constructor Detail

DefaultOWLNamedClass

public DefaultOWLNamedClass(edu.stanford.smi.protege.model.KnowledgeBase kb,
                            edu.stanford.smi.protege.model.FrameID id)

DefaultOWLNamedClass

public DefaultOWLNamedClass()
Method Detail

addDisjointClass

public void addDisjointClass(RDFSClass aClass)
Description copied from interface: OWLNamedClass
Adds a class to the list of disjoint classes of this.

Specified by:
addDisjointClass in interface OWLNamedClass
Parameters:
aClass - the disjoint class to add

addEquivalentClass

public void addEquivalentClass(RDFSClass aClass)
Description copied from interface: OWLNamedClass
Adds a given class to the list of equivalent classes of this. This will establish a bidirectional superclass relationship between the two classes.

Specified by:
addEquivalentClass in interface OWLNamedClass
Parameters:
aClass - the RDFSClass to add as equivalent class

addInferredSuperclass

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

Specified by:
addInferredSuperclass in interface OWLNamedClass
Parameters:
superclass - the computed superclass to add

createOWLIndividual

public OWLIndividual createOWLIndividual(String name)
Description copied from interface: OWLNamedClass
Creates a new individual of this (assuming this is not a metaclass).

Specified by:
createOWLIndividual in interface OWLNamedClass
Parameters:
name - the name of the new instance or null for a default value
Returns:
the new instance

equalsStructurally

public boolean equalsStructurally(RDFSClass cls)

getAllValuesFrom

public RDFResource getAllValuesFrom(RDFProperty property)
Description copied from interface: OWLNamedClass
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).

Specified by:
getAllValuesFrom in interface OWLNamedClass

getAssociatedProperties

public Set getAssociatedProperties()
Description copied from interface: RDFSNamedClass
Gets all properties that have been associated with this class. This includes all properties that have this in their union domain. If this is an OWL class, then it also includes all domainless properties that have been mentioned in any restriction on this class, except those that have been restricted to a maximum cardinality of 0. It also includes all subproperties of the aforementioned properties.

This method is for example used to determine which properties shall appear by default on a class form.

Specified by:
getAssociatedProperties in interface RDFSNamedClass
Overrides:
getAssociatedProperties in class DefaultRDFSNamedClass

getClassificationStatus

public int getClassificationStatus()
Description copied from interface: OWLNamedClass
Gets the classification status (whether this class is marked as inconsistent or not).

Specified by:
getClassificationStatus in interface OWLNamedClass
Returns:
one of the OWLNames.CLASSIFICATION_STATUS constants

getDirectRestrictions

public Collection getDirectRestrictions()
Specified by:
getDirectRestrictions in interface OWLNamedClass
See Also:
OWLNamedClass.getRestrictions()

getHasValue

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

Specified by:
getHasValue in interface OWLNamedClass
Parameters:
property - the property to look for hasValue restrictions on
Returns:
the restriction value or null if none is defined.

getInferredEquivalentClasses

public Collection getInferredEquivalentClasses()
Specified by:
getInferredEquivalentClasses in interface OWLNamedClass

getDirectRestrictions

private void getDirectRestrictions(Collection results,
                                   Iterator clses)

getInferredSubclasses

public Collection getInferredSubclasses()
Description copied from interface: OWLNamedClass
Gets the subclasses that were computed by the most recent call of a classifier.

Specified by:
getInferredSubclasses in interface OWLNamedClass
Returns:
a Collection of RDFSClass objects

getInferredSuperclasses

public Collection getInferredSuperclasses()
Description copied from interface: OWLNamedClass
Gets the superclasses that were computed by the most recent call of a classifier.

Specified by:
getInferredSuperclasses in interface OWLNamedClass
Returns:
a Collection of RDFSClass objects

getMaxCardinality

public int getMaxCardinality(RDFProperty property)
Description copied from interface: OWLNamedClass
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.

Specified by:
getMaxCardinality in interface OWLNamedClass
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)
Description copied from interface: OWLNamedClass
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.

Specified by:
getMinCardinality in interface OWLNamedClass
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()
Description copied from interface: OWLNamedClass
Same as getRestrictions(false).

Specified by:
getRestrictions in interface OWLNamedClass
Returns:
a Collection of (direct) OWLRestrictions objects

getIcon

public Icon getIcon()
Specified by:
getIcon in interface ProtegeInstance
Overrides:
getIcon in class DefaultRDFSNamedClass

getIconName

public String getIconName()
Description copied from interface: RDFResource
Gets the local name of an icon for this type of resource. This method is used in conjunction with getIconLocation().

Specified by:
getIconName in interface RDFResource
Overrides:
getIconName in class DefaultRDFSNamedClass

getImageIcon

public ImageIcon getImageIcon()
Description copied from interface: RDFSClass
Gets an ImageIcon displaying this. This is a harder version of getIcon() for use when an ImageIcon is required.

Specified by:
getImageIcon in interface RDFSClass
Overrides:
getImageIcon in class DefaultRDFSNamedClass

getImageIconForNonMetaclass

private ImageIcon getImageIconForNonMetaclass()

getImageIconNameForNonMetaclass

private String getImageIconNameForNonMetaclass()

getRestrictions

public Collection getRestrictions(boolean includingSuperclassRestrictions)
Description copied from interface: OWLNamedClass
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.

Specified by:
getRestrictions in interface OWLNamedClass
Parameters:
includingSuperclassRestrictions - true to also include restrictions from named superclasses
Returns:
a Collection of OWLRestriction objects
See Also:
OWLNamedClass.getDirectRestrictions()

getRestrictions

public Collection getRestrictions(RDFProperty property,
                                  boolean includingSuperclassRestrictions)
Description copied from interface: OWLNamedClass
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.

Specified by:
getRestrictions in interface OWLNamedClass
Parameters:
property - the property to get the restrictions about
includingSuperclassRestrictions - true to also include restrictions from named superclasses
Returns:
the restrictions on property

getRestrictions

private static void getRestrictions(OWLNamedClass cls,
                                    Set reached,
                                    Collection results)

getSomeValuesFrom

public RDFResource getSomeValuesFrom(RDFProperty property)
Description copied from interface: OWLNamedClass
Gets the filler of any defined someValuesFrom restriction for a given property.

Specified by:
getSomeValuesFrom in interface OWLNamedClass

isConsistent

public boolean isConsistent()
Description copied from interface: OWLNamedClass
Determines whether this class has been flagged as being inconsistent or not.

Specified by:
isConsistent in interface OWLNamedClass
Returns:
true if the class is consistent, false if the class is inconsistent.

isOverloadedAllValuesFrom

private static boolean isOverloadedAllValuesFrom(OWLAllValuesFrom restriction,
                                                 Collection restrictions)

isOverloadedCardinality

private static boolean isOverloadedCardinality(OWLCardinality restriction,
                                               Collection restrictions)

isOverloadedMaxCardinality

private static boolean isOverloadedMaxCardinality(OWLMaxCardinality restriction,
                                                  Collection restrictions)

isOverloadedMinCardinality

private static boolean isOverloadedMinCardinality(OWLMinCardinality restriction,
                                                  Collection restrictions)

getSubclassesDisjoint

public boolean getSubclassesDisjoint()
Description copied from interface: OWLNamedClass
Checks whether all subclasses of this are declared to be disjoint.

Specified by:
getSubclassesDisjoint in interface OWLNamedClass
Returns:
true if the all children disjoint flag is set

hasNamedSuperclass

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

Specified by:
hasNamedSuperclass in interface OWLNamedClass
Returns:
true iff there is at least one named direct superclass

isDefinedClass

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

Specified by:
isDefinedClass in interface OWLNamedClass
Returns:
true if this has a definition

isFunctionalProperty

public boolean isFunctionalProperty(RDFProperty property)
Description copied from interface: RDFSNamedClass
Checks whether a given property is "functional" at this class. A property is "functional" if it is declared to be owl:FunctionalProperty or if this is an OWLNamedClass with a max cardinality restriction or 0 or 1.

Specified by:
isFunctionalProperty in interface RDFSNamedClass
Overrides:
isFunctionalProperty in class DefaultRDFSNamedClass

hasNamedSuperClass

public boolean hasNamedSuperClass()

isProbeClass

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

Specified by:
isProbeClass in interface OWLNamedClass
Returns:
true if this is a probe class

removeDisjointClass

public void removeDisjointClass(RDFSClass aClass)
Description copied from interface: OWLNamedClass
Removes a disjoint class of this. If the disjoint class is anonymous, it is completely deleted from the knowledge base.

Specified by:
removeDisjointClass in interface OWLNamedClass
Parameters:
aClass - the disjoint class to remove

removeEquivalentClass

public void removeEquivalentClass(RDFSClass equivalentClass)
Description copied from interface: OWLNamedClass
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).

Specified by:
removeEquivalentClass in interface OWLNamedClass
Parameters:
equivalentClass -

removeInferredSuperclass

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

Specified by:
removeInferredSuperclass in interface OWLNamedClass
Parameters:
superclass - the computed superclass to remove

setClassificationStatus

public void setClassificationStatus(int value)
Description copied from interface: OWLNamedClass
Sets the classification status of this.

Specified by:
setClassificationStatus in interface OWLNamedClass
Parameters:
value - one of OWLNames.CLASSIFICATION_STATUS_xxx

setDefinition

public void setDefinition(RDFSClass definingClass)
Description copied from interface: OWLNamedClass
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.

Specified by:
setDefinition in interface OWLNamedClass
Parameters:
definingClass - the new equivalent class

setSubclassesDisjoint

public void setSubclassesDisjoint(boolean value)
Description copied from interface: OWLNamedClass
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.

Specified by:
setSubclassesDisjoint in interface OWLNamedClass
Parameters:
value - the new value

accept

public void accept(OWLModelVisitor visitor)
Description copied from interface: Visitable
This method is provided to be used with the OWLModelVisitor, which is part of the visitor design pattern. By implementing this method, instances of the implementing class are stating that they can accept an OWLModelVisitor

Specified by:
accept in interface Visitable
Overrides:
accept in class DefaultRDFSNamedClass