gate.creole.ontology
Class OClassImpl

java.lang.Object
  extended bygate.creole.ontology.TClassImpl
      extended bygate.creole.ontology.OClassImpl
All Implemented Interfaces:
OClass, TClass

public class OClassImpl
extends TClassImpl
implements OClass


Field Summary
private  Set disjointClassesSet
           
private  Set propertiesSet
           
private  Set sameClassesSet
           
 
Fields inherited from class gate.creole.ontology.TClassImpl
comment, directSubClasses, directSuperClasses, id, name, ontology, subClassesTransitiveClosure, superClassesTransitiveClosure, uri
 
Fields inherited from interface gate.creole.ontology.TClass
DIRECT_CLOSURE, TRANSITIVE_CLOSURE
 
Constructor Summary
OClassImpl(String anId, String aName, String aComment, Ontology anOntology)
          Creates a new class given id,name,comment and ontology.
 
Method Summary
 boolean addProperty(Property theProperty)
           
 Set getDisjointClasses()
          Returns a set of all classes that are disjoint with ours.
 Set getInheritedProperties()
          This method supplies all KBProperty inherited from the superclasses of the given class.
 Set getProperties()
          Returns a set of all KBProperty (ako relations) for which this class is the domain (first predicate).
 Set getPropertiesByName(String name)
          Returns the set of properties with the given name.
 Set getSameClasses()
          Returns a set of all classes that are the same as ours.
 void setDisjointWith(OClass theClass)
          Indicates that these are disjoint classes
 void setSameClassAs(OClass theClass)
          Indicates that these classes are the same
 String toString()
          Dumps the class to string.
 
Methods inherited from class gate.creole.ontology.TClassImpl
addSubClass, addSuperClass, equals, getComment, getId, getName, getOntology, getSubClasses, getSubClasses, getSubClassesVSDistance, getSuperClasses, getSuperClasses, getSuperClassesVSDistance, getURI, inferSubClassesTransitiveClosure, inferSuperClassesTransitiveClosure, isTopClass, removeSubClass, removeSuperClass, setComment, setName, setURI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gate.creole.ontology.TClass
addSubClass, addSuperClass, equals, getComment, getId, getName, getOntology, getSubClasses, getSubClassesVSDistance, getSuperClasses, getSuperClassesVSDistance, getURI, inferSubClassesTransitiveClosure, inferSuperClassesTransitiveClosure, isTopClass, removeSubClass, removeSuperClass, setComment, setName, setURI
 

Field Detail

disjointClassesSet

private Set disjointClassesSet

sameClassesSet

private Set sameClassesSet

propertiesSet

private Set propertiesSet
Constructor Detail

OClassImpl

public OClassImpl(String anId,
                  String aName,
                  String aComment,
                  Ontology anOntology)
Creates a new class given id,name,comment and ontology.

Parameters:
anId - the id of the new class
aName - the name of the new class
aComment - the comment of the new class
anOntology - the ontology to which the new class belongs
Method Detail

setDisjointWith

public void setDisjointWith(OClass theClass)
Description copied from interface: OClass
Indicates that these are disjoint classes

Specified by:
setDisjointWith in interface OClass

setSameClassAs

public void setSameClassAs(OClass theClass)
Description copied from interface: OClass
Indicates that these classes are the same

Specified by:
setSameClassAs in interface OClass

getDisjointClasses

public Set getDisjointClasses()
Description copied from interface: OClass
Returns a set of all classes that are disjoint with ours. Null if no such classes.

Specified by:
getDisjointClasses in interface OClass

getSameClasses

public Set getSameClasses()
Description copied from interface: OClass
Returns a set of all classes that are the same as ours. Null if no such classes.

Specified by:
getSameClasses in interface OClass

getProperties

public Set getProperties()
Description copied from interface: OClass
Returns a set of all KBProperty (ako relations) for which this class is the domain (first predicate). The properties are associated with classes, not independent of them and attached via anonymous classes and restrictions as it is in DAML/OWL. Therefore our model is closer to the Protege frame-based model. The advantage of having this kind of model is that it can be generalised API both for Protege and DAML/OWL/RDF ontologies.

Specified by:
getProperties in interface OClass

getPropertiesByName

public Set getPropertiesByName(String name)
Description copied from interface: OClass
Returns the set of properties with the given name. The set elements are instances of KBProperty or sub-classes. The reason why we need a set is because a class can have more than one property with the same name but different ranges.

Specified by:
getPropertiesByName in interface OClass
Parameters:
name -
Returns:
a Set value.

getInheritedProperties

public Set getInheritedProperties()
Description copied from interface: OClass
This method supplies all KBProperty inherited from the superclasses of the given class. Null if no such properties exist. Note that to get all properties (both inherited and associated with the current class) one needs to call both getInheritedProperties and getProperties.

Specified by:
getInheritedProperties in interface OClass

addProperty

public boolean addProperty(Property theProperty)

toString

public String toString()
Description copied from interface: TClass
Dumps the class to string.

Specified by:
toString in interface TClass
Overrides:
toString in class TClassImpl