|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jatha.dynatype.StandardLispValue
org.algernon.kb.okbc.protege.AlgernonProtegeObject
org.algernon.kb.okbc.protege.AlgernonProtegeFrame
org.algernon.kb.okbc.protege.AlgernonProtegeClass
This defines an interface for an AlgernonProtegeKB.
Field Summary |
Fields inherited from class org.algernon.kb.okbc.protege.AlgernonProtegeFrame |
m_frame, m_kb |
Fields inherited from class org.algernon.kb.okbc.protege.AlgernonProtegeObject |
f_algy |
Fields inherited from class org.jatha.dynatype.StandardLispValue |
f_lisp |
Constructor Summary | |
AlgernonProtegeClass(AlgernonProtegeKB kb,
Cls theClass)
|
|
AlgernonProtegeClass(AlgernonProtegeKB kb,
String name,
AlgernonClass superclass,
AlgernonClass metaClass)
Creates a new class in Protege, using the metaclass of the given superclass if the metaclass is null. |
Method Summary | |
void |
addRelation(AlgernonRelation relation)
Adds a new relation to this class. |
AlgernonInstance |
createInstance(String name)
Creates an instance with the given name. |
AlgernonInstance |
createInstance(String name,
String displayName)
Creates an instance with the given name and stores the "pretty" name in the display name slot. |
AlgernonInstance |
createInstanceAux(String name,
int counter)
auxiliary function to handle duplicate name problems. |
Collection |
getDirectInstances()
|
Collection |
getDirectSubclasses()
|
Collection |
getDirectSuperclasses()
|
private Facet |
getFacet(Slot slot,
String name)
|
Collection |
getInstances()
|
Collection |
getLeafSubclasses()
Returns a collection of subclasses of this class that are leaves. |
List |
getRelationArgumentTypes(AlgernonRelation relation)
Gets the argument types of a relation as defined for that class. |
Collection |
getSubclasses()
|
Collection |
getTemplateRelations()
Returns the relations that are templates on this class. |
boolean |
hasDirectInstance(AlgernonInstance instance)
Returns true if this class includes instance
as one of its direct instances. |
boolean |
hasDirectSuperclass(AlgernonClass theClass)
Returns true if this class includes superclass
as one of its direct superclasses. |
boolean |
hasInstance(AlgernonInstance instance)
Returns true if this class includes instance
as one of its direct instances, or as a direct instance of
one of its subclasses. |
boolean |
hasLeafSubclass(AlgernonClass leaf)
Returns true if leaf is a leaf subclass of this class. |
boolean |
hasTemplateRelation(AlgernonRelation relation)
Returns true if the given relation is a template relation of this class. |
boolean |
isLeafClass()
Returns true if this is one of the leaf classes of the KB. |
boolean |
isRootClass()
Returns true if this is one of the root classes of the KB. |
AlgernonRelation |
lookupRelation(String name)
Returns the definition of the slot that is visible on this class. |
void |
setRelationDefaultValue(AlgernonRelation relation,
Object defaultValue)
Sets the default value of a relation as defined on this class. |
void |
setRelationInverseRelation(AlgernonRelation relation,
AlgernonRelation inverseRelation)
Sets the inverse relation of a relation as defined on this class. |
void |
setRelationMaxCardinality(AlgernonRelation relation,
Integer maxCardinality)
Sets the maximum cardinality of a relation as defined on this class. |
void |
setRelationMinCardinality(AlgernonRelation relation,
Integer minCardinality)
Sets the minimum cardinality of a relation as defined on this class. |
void |
setRelationRange(AlgernonRelation relation,
AlgernonClass theClass)
Sets the range of a relation as defined on this class. |
void |
setRelationRange(AlgernonRelation relation,
LispValue valueType)
Sets the range of a relation as defined on this class. |
Methods inherited from class org.algernon.kb.okbc.protege.AlgernonProtegeFrame |
addRelationValue, deleteAllRelationValues, deleteRelationValue, deleteRelationValues, display, getDisplayName, getImplementation, getKB, getName, getOwnRelationValues, getParents, getPossibleRelationValues, getRelationValues, getRootClasses, getSuperclasses, hasParent, hasRootClass, hasSuperclass, setDisplayName, setName, toString |
Methods inherited from class org.algernon.kb.okbc.protege.AlgernonProtegeObject |
getAlgernon |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.algernon.kb.AlgernonFrame |
addRelationValue, deleteAllRelationValues, deleteRelationValue, deleteRelationValues, getDisplayName, getImplementation, getKB, getName, getOwnRelationValues, getParents, getPossibleRelationValues, getRelationValues, getRootClasses, getSuperclasses, hasParent, hasRootClass, hasSuperclass, setDisplayName, setName |
Methods inherited from interface org.algernon.io.Displayable |
display |
Constructor Detail |
public AlgernonProtegeClass(AlgernonProtegeKB kb, String name, AlgernonClass superclass, AlgernonClass metaClass) throws AlgernonRuntimeException
public AlgernonProtegeClass(AlgernonProtegeKB kb, Cls theClass)
Method Detail |
public AlgernonInstance createInstance(String name)
createInstance
in interface AlgernonClass
public AlgernonInstance createInstanceAux(String name, int counter)
public AlgernonInstance createInstance(String name, String displayName) throws AlgernonDataException
createInstance
in interface AlgernonClass
AlgernonDataException
public void addRelation(AlgernonRelation relation)
addRelation
in interface AlgernonClass
public Collection getInstances()
getInstances
in interface AlgernonClass
public Collection getDirectInstances()
getDirectInstances
in interface AlgernonClass
public Collection getDirectSuperclasses()
getDirectSuperclasses
in interface AlgernonClass
public Collection getDirectSubclasses()
getDirectSubclasses
in interface AlgernonClass
public Collection getSubclasses()
getSubclasses
in interface AlgernonClass
public Collection getTemplateRelations()
getTemplateRelations
in interface AlgernonClass
public boolean hasDirectInstance(AlgernonInstance instance)
instance
as one of its direct instances.
hasDirectInstance
in interface AlgernonClass
instance
- the instance to check
public boolean hasInstance(AlgernonInstance instance)
instance
as one of its direct instances, or as a direct instance of
one of its subclasses. Since it is cheaper to look
upward rather than downard, this implementation calls
hasType() on the instance rather than the mirror method.
hasInstance
in interface AlgernonClass
instance
- the instance to check
public boolean hasDirectSuperclass(AlgernonClass theClass)
superclass
as one of its direct superclasses.
hasDirectSuperclass
in interface AlgernonClass
theClass
- the superclass to check
public Collection getLeafSubclasses()
getLeafSubclasses
in interface AlgernonClass
public boolean hasLeafSubclass(AlgernonClass leaf)
leaf
is a leaf subclass of this class.
hasLeafSubclass
in interface AlgernonClass
public boolean isLeafClass()
isLeafClass
in interface AlgernonClass
public boolean isRootClass()
isRootClass
in interface AlgernonClass
public AlgernonRelation lookupRelation(String name)
lookupRelation
in interface AlgernonClass
name
-
public List getRelationArgumentTypes(AlgernonRelation relation) throws AlgernonDataException
getRelationArgumentTypes
in interface AlgernonClass
relation
-
AlgernonDataException
private Facet getFacet(Slot slot, String name)
public void setRelationRange(AlgernonRelation relation, AlgernonClass theClass)
AlgernonClass
setRelationRange
in interface AlgernonClass
relation
- theClass
- public void setRelationRange(AlgernonRelation relation, LispValue valueType)
AlgernonClass
setRelationRange
in interface AlgernonClass
relation
- valueType
- public void setRelationMinCardinality(AlgernonRelation relation, Integer minCardinality)
AlgernonClass
setRelationMinCardinality
in interface AlgernonClass
relation
- minCardinality
- public void setRelationMaxCardinality(AlgernonRelation relation, Integer maxCardinality)
AlgernonClass
setRelationMaxCardinality
in interface AlgernonClass
relation
- maxCardinality
- public void setRelationDefaultValue(AlgernonRelation relation, Object defaultValue)
AlgernonClass
setRelationDefaultValue
in interface AlgernonClass
relation
- defaultValue
- public void setRelationInverseRelation(AlgernonRelation relation, AlgernonRelation inverseRelation)
AlgernonClass
setRelationInverseRelation
in interface AlgernonClass
relation
- inverseRelation
- public boolean hasTemplateRelation(AlgernonRelation relation)
hasTemplateRelation
in interface AlgernonClass
relation
-
|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |