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

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
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, ProtegeCls, ProtegeInstance, RDFObject, RDFResource, RDFSClass, RDFSNamedClass, Serializable, Visitable
Direct Known Subclasses:
DefaultOWLNamedClass

public class DefaultRDFSNamedClass
extends AbstractRDFSClass
implements RDFSNamedClass

Author:
Holger Knublauch
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.stanford.smi.protege.model.DefaultFrame
 
Constructor Summary
DefaultRDFSNamedClass()
           
DefaultRDFSNamedClass(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.
 RDFResource createAnonymousInstance()
          Creates an instance of this class so that Protege will recognize this as an "anonymous" node in the RDF rendering.
 RDFSClass createClone()
          Creates a clone of this, which contains a completely new expression tree.
 RDFIndividual createRDFIndividual(String name)
          Creates a new individual of this (assuming this is not a metaclass).
 boolean equalsStructurally(RDFObject object)
          Determines whether or not the specified class is structurally equal to this class.
 Set getAssociatedProperties()
          Gets all properties that have been associated with this class.
 Collection getDependingClasses()
          Gets all OWLAnonymousClasses the life cycle of which depends on this.
 RDFSClass getFirstSuperclass()
          A convenience method to get the first direct superclass of this.
 Icon getIcon()
           
 String getIconName()
          Gets the local name of an icon for this type of resource.
 ImageIcon getImageIcon()
          Gets an ImageIcon displaying this.
 String getNestedBrowserText()
          Gets the browser text when this is embedded into a complex expression.
 void getNestedNamedClasses(Set set)
          Gets all RDFSClses that are somewhere used in the expression below this.
 Collection getUnionRangeClasses(RDFProperty property)
          Gets the allowed classes for a given property at this class.
private  Collection getUnionRangeClassesHelper(OWLAllValuesFrom allValuesFrom, RDFProperty property)
           
 boolean isAnonymous()
          Checks whether this is an anonymous class.
 boolean isDeprecated()
          Checks whether this has been declared deprecated (using owl:DeprecatedClass or owl:DeprecatedProperty).
 boolean isFunctionalProperty(RDFProperty property)
          Checks whether a given property is "functional" at this class.
 boolean isVisibleFromOWLThing()
          Checks whether this and a path to the root class is visible.
private  boolean isVisibleFromRootCls(Set reached)
           
 void setDeprecated(boolean value)
           
 
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.RDFSClass
addClassListener, addSuperclass, createInstance, getEquivalentClasses, getInferredInstanceCount, getInferredInstances, getInstanceCount, getInstances, getNamedSubclasses, getNamedSubclasses, getNamedSuperclasses, getNamedSuperclasses, getParsableExpression, getPureSuperclasses, getSubclassCount, getSubclasses, getSuperclassCount, getSuperclasses, getUnionDomainProperties, getUnionDomainProperties, hasEquivalentClass, hasPropertyValueWithBrowserText, 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
 

Constructor Detail

DefaultRDFSNamedClass

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

DefaultRDFSNamedClass

public DefaultRDFSNamedClass()
Method Detail

createClone

public RDFSClass createClone()
Description copied from interface: RDFSClass
Creates a clone of this, which contains a completely new expression tree. This is implemented by first converting the expression into a string and then using the parser to recreate everything.

Specified by:
createClone in interface RDFSClass
Returns:
a clone of this or the object itself for named classes

equalsStructurally

public boolean equalsStructurally(RDFObject object)
Description copied from interface: RDFObject
Determines whether or not the specified class is structurally equal to this class. Note that this does not test for structural equivalence using structural subsumption tests.

Specified by:
equalsStructurally in interface RDFObject
Parameters:
object - The class to test against.
Returns:
true if the class is structurally equal to this, false if the class is not structurally equal to this.

getDependingClasses

public Collection getDependingClasses()
Description copied from interface: RDFSClass
Gets all OWLAnonymousClasses the life cycle of which depends on this. These are deleted when this is deleted.

Specified by:
getDependingClasses in interface RDFSClass
Returns:
a Collection of OWLAnonymousClass instances

getIcon

public Icon getIcon()
Specified by:
getIcon in interface ProtegeInstance

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
Returns:
an icon name (without suffix, e.g. "RDFIndividual" for RDFIndividual.gif)
See Also:
RDFResource.getIconLocation()

createAnonymousInstance

public RDFResource createAnonymousInstance()
Description copied from interface: RDFSNamedClass
Creates an instance of this class so that Protege will recognize this as an "anonymous" node in the RDF rendering. Protege uses an internal naming convention to simulate anonymous nodes.

Specified by:
createAnonymousInstance in interface RDFSNamedClass
Returns:
a new, anonymous instance of this
See Also:
OWLModel.getNextAnonymousResourceName(), OWLModel.isAnonymousResource(edu.stanford.smi.protegex.owl.model.RDFResource)

createRDFIndividual

public RDFIndividual createRDFIndividual(String name)
Description copied from interface: RDFSNamedClass
Creates a new individual of this (assuming this is not a metaclass).

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

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
Returns:
the associated properties

getFirstSuperclass

public RDFSClass getFirstSuperclass()
Description copied from interface: RDFSNamedClass
A convenience method to get the first direct superclass of this. This method is typically used if it is known that there is only one parent, e.g. in simple hierarchies.

Specified by:
getFirstSuperclass in interface RDFSNamedClass
Returns:
the first superclass

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
Parameters:
property - the property to test
Returns:
true if property is functional at this class

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
Returns:
the ImageIcon

getNestedBrowserText

public String getNestedBrowserText()
Description copied from interface: RDFSClass
Gets the browser text when this is embedded into a complex expression. This usually returns the browser key enclosed with round brackets.

Specified by:
getNestedBrowserText in interface RDFSClass
Returns:
the nested browser text

getNestedNamedClasses

public void getNestedNamedClasses(Set set)
Description copied from interface: RDFSClass
Gets all RDFSClses that are somewhere used in the expression below this. If this is an anonymous class, this traverses the expression tree to collect them. If this is already an RDFSNamedClass, it will return itself.

Specified by:
getNestedNamedClasses in interface RDFSClass
Parameters:
set - an (initially empty) Set that will contain the nested named classes

getUnionRangeClasses

public Collection getUnionRangeClasses(RDFProperty property)
Description copied from interface: RDFSNamedClass
Gets the allowed classes for a given property at this class. This assumes that the property takes objects as values. The method tests whether an allValuesFrom restriction has been defined on this class, and resolves this into a collection if the restriction has a union class as filler. If no restriction could be found in the inheritance hierarchy, the method looks for a global range restriction for the property.

Specified by:
getUnionRangeClasses in interface RDFSNamedClass
Parameters:
property - the property to get the local range of
Returns:
a Collection of RDFSClasses

getUnionRangeClassesHelper

private Collection getUnionRangeClassesHelper(OWLAllValuesFrom allValuesFrom,
                                              RDFProperty property)

isAnonymous

public boolean isAnonymous()
Description copied from interface: RDFSClass
Checks whether this is an anonymous class. All classes except for instances of OWLNamedClass are anonymous.

Specified by:
isAnonymous in interface RDFSClass
Returns:
true if this is anonymous

isVisibleFromOWLThing

public boolean isVisibleFromOWLThing()
Description copied from interface: RDFSNamedClass
Checks whether this and a path to the root class is visible.

Specified by:
isVisibleFromOWLThing in interface RDFSNamedClass
Returns:
true if visible

isVisibleFromRootCls

private boolean isVisibleFromRootCls(Set reached)

isDeprecated

public boolean isDeprecated()
Description copied from interface: Deprecatable
Checks whether this has been declared deprecated (using owl:DeprecatedClass or owl:DeprecatedProperty).

Specified by:
isDeprecated in interface Deprecatable
Returns:
true if this was deprecated

setDeprecated

public void setDeprecated(boolean value)
Specified by:
setDeprecated in interface Deprecatable

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
Parameters:
visitor - The visitor that will operate on this object.