Algernon Software

org.algernon.kb.agent.google
Class GoogleKB

java.lang.Object
  extended byorg.jatha.dynatype.StandardLispValue
      extended byorg.algernon.kb.api.java.JavaAPIObject
          extended byorg.algernon.kb.api.java.JavaAPIKB
              extended byorg.algernon.kb.agent.google.GoogleKB
All Implemented Interfaces:
AlgernonKB, AlgernonObject, Comparable, LispValue

public class GoogleKB
extends org.algernon.kb.api.java.JavaAPIKB

Implements a Google pseudo-KB for Algernon. Algernon expects a frame-based KB as its backend. With a little programming, nearly every data source can be made to look like a read-only frame-based KB. This class extends the JavaAPIKB to do that.

See Also:
JavaAPIKB

Field Summary
static Integer DEFAULT_MAX_RESULTS
           
protected  String f_clientKey
           
 
Fields inherited from class org.algernon.kb.api.java.JavaAPIKB
f_displayNameRelation, f_displayNameRelationName, f_implementationPackages, f_interfacePackages, f_localCache, f_relationCache
 
Fields inherited from class org.algernon.kb.api.java.JavaAPIObject
f_algy, f_name
 
Fields inherited from class org.jatha.dynatype.StandardLispValue
f_lisp
 
Constructor Summary
GoogleKB(Algernon algy, String name, Collection interfacePackages, Collection implementationPackages, String clientKey)
          Opens the Google API for access.
 
Method Summary
 AlgernonInstance createInstance(String frameName, AlgernonClass theClass)
          Creates a new instance in the storage.
 String getClientKey()
           
 void initializeInstance(AlgernonInstance instance)
          Initialize an instance after creating it.
 void setClientKey(String clientKey)
           
 
Methods inherited from class org.algernon.kb.api.java.JavaAPIKB
addToCache, canAssignToValueType, close, containsClause, convertFromAlgernon, convertFromAlgernon, convertToAlgernon, convertToAlgernon, convertToAlgernon, createClass, createClass, createFacet, createRelation, createRelation, deleteClass, deleteClauses, deleteClauses, deleteFacet, deleteFrame, deleteInstance, deleteRelation, frameSearch, frameSearch, frameSearch, generalIsa, generalNotIsa, getAllFrames, getDirectInstancesOfClass, getDisplayNameRelation, getDisplayNameRelationName, getFrame, getFromCache, getImplementation, getJavaRootClasses, getName, getRootClass, getRootClasses, getUserName, getValueType, getValueTypes, isClass, isClassToInstanceRelation, isDisjointRelation, isFacet, isFrame, isInstance, isInstanceToClassRelation, isNameRelation, isRelation, isSimpleType, isSimpleType, isSimpleType, isSimpleType, isSubclassToSuperclassRelation, isSuperclassToSubclassRelation, leastCommonSuperclass, lookupClass, lookupFacet, lookupFrame, lookupInstance, lookupInstance, lookupInstance, lookupRelation, lookupRelation, lookupRelation, query, query, removeFromCache, reset, save, setDisplayNameRelationName, setName, store, store, supportsNegatedClauses, toValueType, valueOf, valueSearch, valueSearch, valueSearch, verify
 
Methods inherited from class org.algernon.kb.api.java.JavaAPIObject
getAlgernon, setAlgernon, toString
 
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

DEFAULT_MAX_RESULTS

public static Integer DEFAULT_MAX_RESULTS

f_clientKey

protected String f_clientKey
Constructor Detail

GoogleKB

public GoogleKB(Algernon algy,
                String name,
                Collection interfacePackages,
                Collection implementationPackages,
                String clientKey)
         throws AlgernonStorageException
Opens the Google API for access.

Method Detail

createInstance

public AlgernonInstance createInstance(String frameName,
                                       AlgernonClass theClass)
Creates a new instance in the storage. Non frame-based systems must implement some mechanism for handling this method intelligently. For example, a concept in the KB could be created.

Returns:
the frame that was created.

getClientKey

public String getClientKey()

setClientKey

public void setClientKey(String clientKey)

initializeInstance

public void initializeInstance(AlgernonInstance instance)
Initialize an instance after creating it. Override this if necessary.

Parameters:
instance -

Algernon Software