Algernon Software

org.algernon.kb.okbc.protege
Class AlgernonProtegeFrame

java.lang.Object
  extended byorg.jatha.dynatype.StandardLispValue
      extended byorg.algernon.kb.okbc.protege.AlgernonProtegeObject
          extended byorg.algernon.kb.okbc.protege.AlgernonProtegeFrame
All Implemented Interfaces:
AlgernonFrame, AlgernonObject, Comparable, Displayable, LispValue
Direct Known Subclasses:
AlgernonProtegeClass, AlgernonProtegeFacet, AlgernonProtegeInstance, AlgernonProtegeRelation

public class AlgernonProtegeFrame
extends AlgernonProtegeObject
implements AlgernonFrame

This defines an interface for an AlgernonKB.


Field Summary
protected  Instance m_frame
           
protected  AlgernonProtegeKB 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
AlgernonProtegeFrame(AlgernonProtegeKB kb)
           
AlgernonProtegeFrame(AlgernonProtegeKB kb, Instance frame)
           
 
Method Summary
 void addRelationValue(AlgernonRelation relation, Object value)
          Adds the given value to the relation on this Frame.
 void deleteAllRelationValues(AlgernonRelation relation)
          Deletes all values on the given slot for this frame.
 void deleteRelationValue(AlgernonRelation relation, Object value)
          Deletes one value of a relation on this frame.
 void deleteRelationValues(AlgernonRelation relation, Collection values)
          Calls deleteRelationValue for each value in the Collection.
 String display(PrintStream out)
          implements the Displayable interface
 String getDisplayName()
          Returns the name of this Frame.
 Object getImplementation()
          Returns the KBMS-specific object implementing this interface.
 AlgernonKB getKB()
          Returns the KB this Frame belongs to.
 String getName()
          Returns the name of this Frame.
 Collection getOwnRelationValues(AlgernonRelation slot)
          Returns a collection of the values in the given slot.
 List getParents()
          Returns a List of the parents of this frame.
 Collection getPossibleRelationValues(AlgernonRelation relation)
          Returns the list of existing instances that could fill the given relation on this frame.
 Collection getRelationValues(AlgernonRelation relation)
          Returns the relation values.
 Collection getRootClasses()
          Returns a collection of root classes of this class.
 Collection getSuperclasses()
          Returns the direct superclass(es) of a class or the direct class(es) of an instance.
 boolean hasParent(AlgernonFrame parent)
          Returns true if the argument is a parent of this frame.
 boolean hasRootClass(AlgernonClass root)
          Returns true if root is a root class of this class.
 boolean hasSuperclass(AlgernonClass theClass)
          Returns true if this class includes superclass as one of its superclasses, direct or indirect.
 void setDisplayName(String newName)
          Sets this frame's display name (that is, a pretty name) to the given string.
 void setName(String newName)
          Sets the name (:NAME) of this frame.
 String toString()
           
 
Methods inherited from class org.algernon.kb.okbc.protege.AlgernonProtegeObject
getAlgernon
 
Methods inherited from class org.jatha.dynatype.StandardLispValue
abs, acos, add, adjustSpecialCount, append, apply, apropos_print, asin, assoc, atan, atan2, atom, basic_atom, basic_bignump, basic_consp, basic_constantp, basic_floatp, basic_foreignp, basic_functionp, basic_integerp, basic_keywordp, basic_length, basic_listp, basic_macrop, basic_null, basic_numberp, basic_stringp, basic_symbolp, bignump, boundp, butlast, car, cdr, ceiling, characterp, clrhash, compareTo, concatenate, consp, constantp, contains, copy_list, copy, cos, cot, csc, degreesToRadians, divide, eighth, elt, elt, eq, eql, equal, equalNumeric, factorial, fboundp, fifth, first, floatp, floor, fourth, funcall, functionp, get_specialCount, gethash, gethash, getLisp, greaterThan, greaterThanOrEqual, hash_table_count, hash_table_rehash_size, hash_table_rehash_threshold, hash_table_size, hash_table_test, hashtablep, integerp, internal_getName, internal_prin1_as_cdr, internal_prin1, internal_princ_as_cdr, internal_princ, internal_print_as_cdr, internal_print, iterator, keywordp, last, length, lessThan, lessThanOrEqual, lisp_null, list, listp, max, member, min, multiply, nconc, negate, neql, ninth, nreverse, nstringCapitalize, nstringDowncase, nstringUpcase, numberp, pop, position, prin1, princ, print, push, radiansToDegrees, rassoc, reciprocal, remhash, remove, rest, reverse, rplaca, rplacd, sec, second, set_special, setf_gethash, setf_symbol_function, setf_symbol_plist, setf_symbol_value, setLisp, setPackage, setq, seventh, sin, sixth, specialP, sqrt, string, stringCapitalize, stringDowncase, stringEndsWith, stringEq, stringEqual, stringGreaterP, stringGreaterThan, stringGreaterThanOrEqual, stringLeftTrim, stringLeftTrim, stringLessP, stringLessThan, stringLessThanOrEqual, stringNeq, stringNotGreaterP, stringNotLessP, stringp, stringRightTrim, stringRightTrim, stringStartsWith, stringTrim, stringTrim, stringUpcase, subst, substring, substring, subtract, symbol_function, symbol_name, symbol_package, symbol_plist, symbol_value, symbolp, tan, tenth, third, toCollection, toJava, toJava, toString, toStringAsCdr_internal, toStringAsCdr, toStringShort, toStringShort, toStringSimple, type_of, typep, zerop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_frame

protected Instance m_frame

m_kb

protected AlgernonProtegeKB m_kb
Constructor Detail

AlgernonProtegeFrame

public AlgernonProtegeFrame(AlgernonProtegeKB kb,
                            Instance frame)

AlgernonProtegeFrame

public AlgernonProtegeFrame(AlgernonProtegeKB kb)
Method Detail

toString

public String toString()
Specified by:
toString in interface LispValue
Overrides:
toString in class AlgernonProtegeObject

display

public String display(PrintStream out)
implements the Displayable interface

Specified by:
display in interface Displayable

getName

public String getName()
Returns the name of this Frame.

Specified by:
getName in interface AlgernonFrame
Overrides:
getName in class AlgernonProtegeObject

setName

public void setName(String newName)
Sets the name (:NAME) of this frame.

Specified by:
setName in interface AlgernonFrame

getDisplayName

public String getDisplayName()
                      throws AlgernonException
Returns the name of this Frame.

Specified by:
getDisplayName in interface AlgernonFrame
Throws:
AlgernonException

getKB

public AlgernonKB getKB()
Returns the KB this Frame belongs to.

Specified by:
getKB in interface AlgernonFrame

getImplementation

public Object getImplementation()
Returns the KBMS-specific object implementing this interface.

Specified by:
getImplementation in interface AlgernonFrame

getOwnRelationValues

public Collection getOwnRelationValues(AlgernonRelation slot)
                                throws AlgernonException
Returns a collection of the values in the given slot.

Specified by:
getOwnRelationValues in interface AlgernonFrame
Throws:
AlgernonException

addRelationValue

public void addRelationValue(AlgernonRelation relation,
                             Object value)
Adds the given value to the relation on this Frame.

Specified by:
addRelationValue in interface AlgernonFrame

getRelationValues

public Collection getRelationValues(AlgernonRelation relation)
                             throws AlgernonException
Returns the relation values.

Specified by:
getRelationValues in interface AlgernonFrame
Throws:
AlgernonException

getPossibleRelationValues

public Collection getPossibleRelationValues(AlgernonRelation relation)
                                     throws AlgernonDataException
Returns the list of existing instances that could fill the given relation on this frame.

Specified by:
getPossibleRelationValues in interface AlgernonFrame
Throws:
AlgernonDataException

getParents

public List getParents()
Returns a List of the parents of this frame. For classes, this means its superclass(es) all the way up to the root class(es) of the KB. For instances, this means the class(es) of the KB and all of their superclasses up to the root class(es). For slots, this is all parents that are slots.

Specified by:
getParents in interface AlgernonFrame

getSuperclasses

public Collection getSuperclasses()
Returns the direct superclass(es) of a class or the direct class(es) of an instance.

Specified by:
getSuperclasses in interface AlgernonFrame

deleteRelationValue

public void deleteRelationValue(AlgernonRelation relation,
                                Object value)
Deletes one value of a relation on this frame. If the value doesn't exist on the slot, nothing is changed.

Specified by:
deleteRelationValue in interface AlgernonFrame

deleteRelationValues

public void deleteRelationValues(AlgernonRelation relation,
                                 Collection values)
Calls deleteRelationValue for each value in the Collection.

Specified by:
deleteRelationValues in interface AlgernonFrame
See Also:
deleteRelationValue(org.algernon.kb.AlgernonRelation, java.lang.Object)

deleteAllRelationValues

public void deleteAllRelationValues(AlgernonRelation relation)
Deletes all values on the given slot for this frame.

Specified by:
deleteAllRelationValues in interface AlgernonFrame
See Also:
deleteRelationValue(org.algernon.kb.AlgernonRelation, java.lang.Object)

hasSuperclass

public boolean hasSuperclass(AlgernonClass theClass)
Returns true if this class includes superclass as one of its superclasses, direct or indirect.

Specified by:
hasSuperclass in interface AlgernonFrame
Parameters:
theClass - the superclass to check
Returns:
true if the superclass is a superclass of this class, false otherwise.

getRootClasses

public Collection getRootClasses()
Returns a collection of root classes of this class.

Specified by:
getRootClasses in interface AlgernonFrame
Returns:
a collection of AlgernonClass objects.

hasRootClass

public boolean hasRootClass(AlgernonClass root)
Returns true if root is a root class of this class.

Specified by:
hasRootClass in interface AlgernonFrame

hasParent

public boolean hasParent(AlgernonFrame parent)
Returns true if the argument is a parent of this frame. A parent is a member of the return value of (@link getParents).

Specified by:
hasParent in interface AlgernonFrame

setDisplayName

public void setDisplayName(String newName)
                    throws AlgernonException
Sets this frame's display name (that is, a pretty name) to the given string.

Specified by:
setDisplayName in interface AlgernonFrame
Parameters:
newName -
Throws:
AlgernonException

Algernon Software