Algernon Software

org.algernon.kb
Interface AlgernonKB

All Superinterfaces:
AlgernonObject
All Known Implementing Classes:
AlgernonProtegeKB, org.algernon.kb.api.java.JavaAPIKB

public interface AlgernonKB
extends AlgernonObject

This defines an interface for an AlgernonKB. See this package's child packages for implementations of this interface.


Method Summary
 boolean canAssignToValueType(Object o, LispValue vt)
          Check if you can assign an Object o to a slot having a ValueType vt
 void close()
          Closes a KB.
 boolean containsClause(Clause queryClause, int state)
          State is
 Collection convertFromAlgernon(Collection coll)
          Converts a collection of Algernon objects to a collection of KB implementation-level objects, if possible.
 Object convertFromAlgernon(Object obj)
          Converts an Algernon object to an implementation-level object, if possible.
 Collection convertToAlgernon(Collection coll)
          Converts a collection of KB objects to a collection of Algernon objects, if possible.
 Object convertToAlgernon(Object obj)
          Converts a KB object to an Algernon object, if possible.
 AlgernonClass createClass(String frameName, AlgernonClass superclass)
          Creates a new frame in the storage.
 AlgernonClass createClass(String frameName, AlgernonClass superclass, AlgernonClass metaClass)
          Creates a new frame in the storage.
 AlgernonFacet createFacet(String facetName)
          Creates a new facet in the storage.
 AlgernonInstance createInstance(String frameName, AlgernonClass theClass)
          Creates a new instance in the storage.
 AlgernonRelation createRelation(String relationName, LispValue domain, LispValue range, Integer minCardinality, Integer maxCardinality, Object defaultValue, AlgernonRelation inverseRelation)
          Helper method that creates a set around single domain and range to pass into the actual createRelation method.
 AlgernonRelation createRelation(String relationName, Set domains, Set ranges, Integer minCardinality, Integer maxCardinality, Object defaultValue, AlgernonRelation inverseRelation)
          Creates a new relation in the storage.
 void deleteClass(AlgernonClass frame)
          Deletes a class and all of its relations from storage.
 void deleteClauses(Clause clause)
          Deletes one or more clauses from the storage.
 void deleteClauses(Clause clause, AlgernonFacet facet)
          Deletes one or more clauses from the storage.
 void deleteFacet(AlgernonFacet frame)
          Deletes a frame and all of its relations from storage.
 void deleteFrame(AlgernonFrame frame)
          Deletes a frame and all of its relations from storage.
 void deleteInstance(AlgernonInstance frame)
          Deletes a frame and all of its relations from storage.
 void deleteRelation(AlgernonRelation frame)
          Deletes a frame and all of its relations from storage.
 Collection frameSearch(String searchString)
          Performs a string search within the KB for frames whose name contains the given string.
 Collection frameSearch(String searchString, String nameSlot)
          Performs a string search within the KB for frames whose name contains the given string.
 Collection frameSearch(String searchString, String nameSlot, int limit)
          Performs a string search within the KB for frames whose name contains the given string.
 boolean generalIsa(String child, String parent)
          Returns true if the first argument is an instance or subclass of the second argument in this KB.
 boolean generalNotIsa(String child, String parent)
          Returns true if the first argument is not an instance or subclass of the second argument this KB.
 LispValue getAllFrames()
          Returns a collection of all frames in the KB.
 AlgernonRelation getDisplayNameRelation()
          Get the actual DisplayName slot.
 String getDisplayNameRelationName()
          Get the name of the DisplayName relation (slot).
 AlgernonFrame getFrame(String name)
          Returns a frame with the given name, if any exists.
 Object getImplementation()
          Returns the KBMS-specific object implementing this interface.
 String getName()
          Return the name of this KB.
 AlgernonClass getRootClass()
          Returns a the "first" root class in the KB.
 Collection getRootClasses()
          Returns a LISP list of the root classes of the KB.
 String getUserName()
          Returns a String containing the name of the current user of this KB.
 LispValue getValueType(Object o)
          Get the data type of the Java object passed in; we expect this to be Integer, Float, Boolean, Frame, etc., etc
 boolean isClass(String frameName)
          Returns true if the String is the name of a frame that is a class in the KB.
 boolean isClassToInstanceRelation(String relationName)
          Returns true if the given string is the name of the relation/slot linking a class to its instance in this KB.
 boolean isDisjointRelation(String relationName)
          Returns true if the given string is the name of a relation specifying that two classes are disjoint
 boolean isFacet(String frameName)
          Returns true if the String is the name of a frame in the KB.
 boolean isFrame(String frameName)
          Returns true if the String is the name of a frame in the KB.
 boolean isInstance(String frameName)
          Returns true if the String is the name of a frame that is an instance in the KB.
 boolean isInstanceToClassRelation(String relationName)
          Returns true if the given string is the name of the relation/slot linking an instance to its class in this KB.
 boolean isNameRelation(String relationName)
          Returns true if the given relation is the name relation in this KB.
 boolean isRelation(String frameName)
          Returns true if the String is the name of a frame that is a relation in the KB.
 boolean isSimpleType(AlgernonFrame frame, AlgernonRelation slot)
          Determines if this slot at the class takes an atomic data type value
 boolean isSimpleType(AlgernonRelation relation)
          Determines if this slot takes an atomic data type value
 boolean isSubclassToSuperclassRelation(String relationName)
          Returns true if the given string is the name of the relation/slot linking a frame to its name in this KB.
 boolean isSuperclassToSubclassRelation(String relationName)
          Returns true if the given string is the name of the relation/slot linking a frame to its name in this KB.
 AlgernonFrame leastCommonSuperclass(AlgernonFrame frame1, AlgernonFrame frame2)
          Returns the most specialized common superclass of the two classes or instances.
 AlgernonClass lookupClass(String name)
          Returns a class with the given name, if any.
 AlgernonFacet lookupFacet(String name)
          Returns a facet with the given name, if any.
 AlgernonFrame lookupFrame(String name)
          Returns a frame with the given name, if any.
 AlgernonInstance lookupInstance(String name)
          Returns an instance with the given name, if any.
 AlgernonInstance lookupInstance(String javaClassName, String name)
          Returns a frame with the given name if it can find one in this KB.
 AlgernonInstance lookupInstance(String javaClassName, String name, String field)
          Returns a frame with the given name if it can find one in this KB.
 AlgernonRelation lookupRelation(String name)
          Returns a relation with the given name, if any.
 AlgernonRelation lookupRelation(String name, Set classes)
          Returns a relation with the given name, if any.
 LispValue query(Clause clkause)
          Returns all of the values that match the given clause.
 LispValue query(Clause clause, AlgernonFacet facet)
          See the simpler form with one argument.
 void reset()
          Resets a KB.
 void save()
          Saves the KB to a file.
 void setDisplayNameRelationName(String relationName)
          Sets the name of the relation (slot) used for "pretty names", "common names", "display names" or whatever you want to call it.
 void setName(String newName)
          Sets the name of the KB.
 LispValue store(Clause clause)
          stores the given clause into the storage.
 LispValue store(Clause clause, AlgernonFacet facet)
          stores the given clause into the storage.
 boolean supportsNegatedClauses()
          Returns true if this KB supports negated clauses.
 ValueType valueOf(LispValue typeName)
          Returns the Protege value type for the given named type
 Collection valueSearch(String searchString)
          Performs a string search within the KB for slot values that contain the given string.
 Collection valueSearch(String searchString, Collection frames, Collection slots)
          Performs a string search within the KB for slot values that contain the given string.
 Collection valueSearch(String searchString, Collection frames, Collection slots, int limit)
          Performs a string search within the KB for slot values that contain the given string.
 LispValue verify(Clause clause)
          Verifies that the clause is in the KB.
 

Method Detail

getImplementation

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


close

public void close()
Closes a KB. The KB should not be readable or writeable after closing.


reset

public void reset()
           throws AlgernonStorageException
Resets a KB. This normally restores it to its initial configuration at the time it was last opened, but is not required to.

Throws:
AlgernonStorageException

getName

public String getName()
Return the name of this KB.

Specified by:
getName in interface AlgernonObject

getUserName

public String getUserName()
Returns a String containing the name of the current user of this KB. If not meaningful, return "guest" or a similar string.


getRootClasses

public Collection getRootClasses()
Returns a LISP list of the root classes of the KB. This is most useful for a frame-based storage system. If it is not meaningful for the given storage system, it may be useful to return NIL or a list of all concepts.


getRootClass

public AlgernonClass getRootClass()
Returns a the "first" root class in the KB. This may not correspond to the order in which they were added. This is most useful for a frame-based storage system. If it is not meaningful for the given storage system, it may be useful to return NIL or a list of all concepts.


getAllFrames

public LispValue getAllFrames()
Returns a collection of all frames in the KB.


query

public LispValue query(Clause clkause)
                throws AlgernonException
Returns all of the values that match the given clause. The clause is typically non-ground when this method is called, but it may be ground. If non-ground, it will contains variables. Any parameter may be a variable. If the storage system cannot handle a variable in some position, it should throw an AlgernonUnhandledDataForm exception. For example, Algernon requires that the first two parameters be ground. In a frame system, the first parameter of the clause corresponds to the Slot and the second parameter corresponds to the Frame. The second form of this method specifies a facet to use. This may only be valid for some storage systems.

Returns:
a LISP list of Clauses from storage that match the input clause. If none match, return LispValue.NIL.
Throws:
AlgernonException
See Also:
Clause

query

public LispValue query(Clause clause,
                       AlgernonFacet facet)
                throws AlgernonStorageException,
                       AlgernonDataException
See the simpler form with one argument. This extends it to indicate a facet to be used in retrieval.

Returns:
a LISP list of Clauses from storage that match the input clause. If none match, return LispValue.NIL.
Throws:
AlgernonStorageException
AlgernonDataException

verify

public LispValue verify(Clause clause)
                 throws AlgernonStorageException,
                        AlgernonDataException
Verifies that the clause is in the KB. Returns null if the relation is not in this KB. Otherwise returns AlgernonKB.SUCCESS or AlgernonKb.FAIL.

Throws:
AlgernonStorageException
AlgernonDataException

frameSearch

public Collection frameSearch(String searchString,
                              String nameSlot,
                              int limit)
                       throws AlgernonStorageException
Performs a string search within the KB for frames whose name contains the given string. If the backend KB is case sensitive, this search is case sensitive. If nameSlot is null, the KB can choose which slot to search. Otherwise, provide the name of a slot whose value should be compared with the search string. Note that this method can actually be used to search on any slot - it doesn't have to be a name slot. The return value is a Collection of frames whose name contains the given string. Returns null if the KB implementation does not support string search of frame names.

Parameters:
searchString - a string that must be contained in the value
nameSlot - an optional slot to be used as the search value. Enter null to use the default slot.
limit - a limit on the number of frames to return. Use -1 for unlimited.
Returns:
A Collection of AlgernonFrame instances, or null if the KB doesn't support search.
Throws:
AlgernonStorageException
See Also:
valueSearch(java.lang.String, java.util.Collection, java.util.Collection, int)

valueSearch

public Collection valueSearch(String searchString,
                              Collection frames,
                              Collection slots,
                              int limit)
                       throws AlgernonStorageException
Performs a string search within the KB for slot values that contain the given string. If the backend KB is case sensitive, this search is case sensitive. When the value is a frame, its name is compared to the search string. If the slots and frames arguments are null, all slots on all frames are searched. Slots may be a collection of strings (slot names) or instances of AlgernonSlot. If it is not null, only those slots are searched. If it is null, all slots are searched. Frames may be a collection of strings (frame names) or instances of AlgernonFrame. If it is not null, only those frames are searched. If it is null, all frames are searched. The return value is a Collection of frames that have a slot whose value satisfies the given string. Each frame occurs only once in the returned collection. Returns null if the KB implementation does not support string search of slot values.

Parameters:
searchString - a string that must be contained in the value
frames - an optional Collection of frames or frame names to be searched
slots - an optional Collection of slots or slot names to be searched
limit - an optional limit on the number of frames to return. Use -1 for unlimited.
Returns:
a Collection of AlgernonFrame instances, or null if the KB doesn't support the search.
Throws:
AlgernonStorageException
See Also:
frameSearch(java.lang.String, java.lang.String, int)

store

public LispValue store(Clause clause)
                throws AlgernonStorageException,
                       AlgernonDataException
stores the given clause into the storage. The clause is typically ground. Most storage systems will throw an exception if it is not. Returns either AlgernonKB.SUCCESS, AlgernonKB.KNOWN or AlgernonKB.FAIL Return KNOWN if it was already in storage.

Throws:
AlgernonStorageException
AlgernonDataException

store

public LispValue store(Clause clause,
                       AlgernonFacet facet)
                throws AlgernonStorageException,
                       AlgernonDataException
stores the given clause into the storage. The clause is typically ground. Most storage systems will throw an exception if it is not. Returns either AlgernonKB.SUCCESS, AlgernonKB.KNOWN or AlgernonKB.FAIL Return KNOWN if it was already in storage.

Throws:
AlgernonStorageException
AlgernonDataException

isDisjointRelation

public boolean isDisjointRelation(String relationName)
Returns true if the given string is the name of a relation specifying that two classes are disjoint


isNameRelation

public boolean isNameRelation(String relationName)
Returns true if the given relation is the name relation in this KB.


isInstanceToClassRelation

public boolean isInstanceToClassRelation(String relationName)
Returns true if the given string is the name of the relation/slot linking an instance to its class in this KB.


isClassToInstanceRelation

public boolean isClassToInstanceRelation(String relationName)
Returns true if the given string is the name of the relation/slot linking a class to its instance in this KB.


isSubclassToSuperclassRelation

public boolean isSubclassToSuperclassRelation(String relationName)
Returns true if the given string is the name of the relation/slot linking a frame to its name in this KB.


isSuperclassToSubclassRelation

public boolean isSuperclassToSubclassRelation(String relationName)
Returns true if the given string is the name of the relation/slot linking a frame to its name in this KB.


getDisplayNameRelationName

public String getDisplayNameRelationName()
Get the name of the DisplayName relation (slot).


getDisplayNameRelation

public AlgernonRelation getDisplayNameRelation()
                                        throws AlgernonDataException
Get the actual DisplayName slot.

Throws:
AlgernonDataException

createClass

public AlgernonClass createClass(String frameName,
                                 AlgernonClass superclass)
                          throws AlgernonRuntimeException
Creates a new frame 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.
Throws:
AlgernonRuntimeException

createFacet

public AlgernonFacet createFacet(String facetName)
Creates a new facet in the storage. Systems that don't normally contain facets must implement some mechanism for handling them intelligently. For example, a separate storage area could be opened for each facet. If the given name is in use by another facet, do not do anything, just return the existing facet.

Returns:
the facet that was created.

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.

createRelation

public AlgernonRelation createRelation(String relationName,
                                       Set domains,
                                       Set ranges,
                                       Integer minCardinality,
                                       Integer maxCardinality,
                                       Object defaultValue,
                                       AlgernonRelation inverseRelation)
                                throws AlgernonDataException
Creates a new relation in the storage.

Returns:
the relation that was created.
Throws:
AlgernonDataException

deleteClass

public void deleteClass(AlgernonClass frame)
                 throws AlgernonDataException,
                        AlgernonException
Deletes a class and all of its relations from storage.

Throws:
AlgernonDataException
AlgernonException

deleteFacet

public void deleteFacet(AlgernonFacet frame)
                 throws AlgernonDataException,
                        AlgernonException
Deletes a frame and all of its relations from storage.

Throws:
AlgernonDataException
AlgernonException

deleteFrame

public void deleteFrame(AlgernonFrame frame)
                 throws AlgernonDataException,
                        AlgernonException
Deletes a frame and all of its relations from storage.

Throws:
AlgernonDataException
AlgernonException

deleteInstance

public void deleteInstance(AlgernonInstance frame)
                    throws AlgernonDataException,
                           AlgernonException
Deletes a frame and all of its relations from storage.

Throws:
AlgernonDataException
AlgernonException

deleteRelation

public void deleteRelation(AlgernonRelation frame)
                    throws AlgernonDataException,
                           AlgernonException
Deletes a frame and all of its relations from storage.

Throws:
AlgernonDataException
AlgernonException

deleteClauses

public void deleteClauses(Clause clause)
Deletes one or more clauses from the storage. If the clause is unground, the storage system should do a query to ground it, then delete all the clauses that match the query clause. If the clause is ground, just delete that clause. Another form of this method takes a facet argument.


deleteClauses

public void deleteClauses(Clause clause,
                          AlgernonFacet facet)
Deletes one or more clauses from the storage. If the clause is unground, the storage system should do a query to ground it, then delete all the clauses that match the query clause. If the clause is ground, just delete that clause. Another form of this method takes a facet argument.


isClass

public boolean isClass(String frameName)
                throws AlgernonDataException
Returns true if the String is the name of a frame that is a class in the KB.

Throws:
AlgernonDataException

isFacet

public boolean isFacet(String frameName)
                throws AlgernonDataException
Returns true if the String is the name of a frame in the KB.

Throws:
AlgernonDataException

isFrame

public boolean isFrame(String frameName)
                throws AlgernonDataException
Returns true if the String is the name of a frame in the KB.

Throws:
AlgernonDataException

isInstance

public boolean isInstance(String frameName)
                   throws AlgernonDataException
Returns true if the String is the name of a frame that is an instance in the KB.

Throws:
AlgernonDataException

isRelation

public boolean isRelation(String frameName)
                   throws AlgernonDataException
Returns true if the String is the name of a frame that is a relation in the KB.

Throws:
AlgernonDataException

lookupClass

public AlgernonClass lookupClass(String name)
                          throws AlgernonDataException
Returns a class with the given name, if any.

Throws:
AlgernonDataException

lookupFacet

public AlgernonFacet lookupFacet(String name)
                          throws AlgernonDataException
Returns a facet with the given name, if any.

Throws:
AlgernonDataException

lookupFrame

public AlgernonFrame lookupFrame(String name)
                          throws AlgernonDataException
Returns a frame with the given name, if any. The frame will be an instance of AlgernonClass, AlgernonInstance, etc., depending on its type. It will be null if there is no frame with that name.

Throws:
AlgernonDataException

lookupInstance

public AlgernonInstance lookupInstance(String name)
                                throws AlgernonDataException
Returns an instance with the given name, if any.

Throws:
AlgernonDataException

lookupRelation

public AlgernonRelation lookupRelation(String name)
                                throws AlgernonDataException
Returns a relation with the given name, if any.

Throws:
AlgernonDataException

lookupRelation

public AlgernonRelation lookupRelation(String name,
                                       Set classes)
                                throws AlgernonDataException
Returns a relation with the given name, if any. The set is a list of classes to look on for the relation, before looking at the KB in general. This is because some KBMS, such as Protege, allow slots to be redefined at a specific class.

Throws:
AlgernonDataException

generalIsa

public boolean generalIsa(String child,
                          String parent)
                   throws AlgernonDataException
Returns true if the first argument is an instance or subclass of the second argument in this KB. Both arguments must be frames.

Throws:
AlgernonDataException

generalNotIsa

public boolean generalNotIsa(String child,
                             String parent)
Returns true if the first argument is not an instance or subclass of the second argument this KB. Both arguments must be frames.


convertToAlgernon

public Collection convertToAlgernon(Collection coll)
Converts a collection of KB objects to a collection of Algernon objects, if possible.


convertToAlgernon

public Object convertToAlgernon(Object obj)
Converts a KB object to an Algernon object, if possible.


convertFromAlgernon

public Collection convertFromAlgernon(Collection coll)
Converts a collection of Algernon objects to a collection of KB implementation-level objects, if possible.


convertFromAlgernon

public Object convertFromAlgernon(Object obj)
Converts an Algernon object to an implementation-level object, if possible.


leastCommonSuperclass

public AlgernonFrame leastCommonSuperclass(AlgernonFrame frame1,
                                           AlgernonFrame frame2)
Returns the most specialized common superclass of the two classes or instances. Returns null if there is none.


containsClause

public boolean containsClause(Clause queryClause,
                              int state)
                       throws AlgernonDataException
State is

Parameters:
queryClause -
state - is Algernon.NEGATED or something else.
Throws:
AlgernonDataException

setName

public void setName(String newName)
Sets the name of the KB.


createClass

public AlgernonClass createClass(String frameName,
                                 AlgernonClass superclass,
                                 AlgernonClass metaClass)
                          throws AlgernonRuntimeException
Creates a new frame 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. Throws an AlgernonRuntimeException if any exception occurs.

Returns:
the frame that was created.
Throws:
AlgernonRuntimeException

createRelation

public AlgernonRelation createRelation(String relationName,
                                       LispValue domain,
                                       LispValue range,
                                       Integer minCardinality,
                                       Integer maxCardinality,
                                       Object defaultValue,
                                       AlgernonRelation inverseRelation)
                                throws AlgernonDataException
Helper method that creates a set around single domain and range to pass into the actual createRelation method.

Throws:
AlgernonDataException

valueOf

public ValueType valueOf(LispValue typeName)
Returns the Protege value type for the given named type


getValueType

public LispValue getValueType(Object o)
Get the data type of the Java object passed in; we expect this to be Integer, Float, Boolean, Frame, etc., etc


canAssignToValueType

public boolean canAssignToValueType(Object o,
                                    LispValue vt)
Check if you can assign an Object o to a slot having a ValueType vt


isSimpleType

public boolean isSimpleType(AlgernonRelation relation)
Determines if this slot takes an atomic data type value


isSimpleType

public boolean isSimpleType(AlgernonFrame frame,
                            AlgernonRelation slot)
Determines if this slot at the class takes an atomic data type value


getFrame

public AlgernonFrame getFrame(String name)
                       throws AlgernonDataException
Returns a frame with the given name, if any exists. Searches both the standard Protege name and the DisplayName slot, if given. Searches the KB for a frame matching the displayName string passed in. If none found, returns null. There should never be more than one matching frame. If more than one is found, returns null. If one frame found, it returns that frame.

Throws:
AlgernonDataException

setDisplayNameRelationName

public void setDisplayNameRelationName(String relationName)
Sets the name of the relation (slot) used for "pretty names", "common names", "display names" or whatever you want to call it. The :NAME slot in Protege often has an ugly name in it. If you set this, Algernon will be able to look up frames by their pretty name.


save

public void save()
          throws AlgernonStorageException
Saves the KB to a file. Calls the appropriate method on the KB backend, such as Protege's Knowledgebase.save() method.

Throws:
AlgernonStorageException

supportsNegatedClauses

public boolean supportsNegatedClauses()
Returns true if this KB supports negated clauses.


lookupInstance

public AlgernonInstance lookupInstance(String javaClassName,
                                       String name)
                                throws AlgernonDataException
Returns a frame with the given name if it can find one in this KB. Otherwise returns null.

Throws:
AlgernonDataException

lookupInstance

public AlgernonInstance lookupInstance(String javaClassName,
                                       String name,
                                       String field)
                                throws AlgernonDataException
Returns a frame with the given name if it can find one in this KB. Otherwise returns null.

Throws:
AlgernonDataException

frameSearch

public Collection frameSearch(String searchString)
                       throws AlgernonStorageException
Performs a string search within the KB for frames whose name contains the given string. If the backend KB is case sensitive, this search is case sensitive. If nameSlot is null, the KB can choose which slot to search. Otherwise, provide the name of a slot whose value should be compared with the search string. Note that this method can actually be used to search on any slot - it doesn't have to be a name slot. The return value is a Collection of frames whose name contains the given string. Returns null if the KB implementation does not support string search of frame names.

Parameters:
searchString - a string that must be contained in the value
Returns:
A Collection of AlgernonFrame instances, or null if the KB doesn't support search.
Throws:
AlgernonStorageException
See Also:
valueSearch(java.lang.String, java.util.Collection, java.util.Collection, int)

frameSearch

public Collection frameSearch(String searchString,
                              String nameSlot)
                       throws AlgernonStorageException
Performs a string search within the KB for frames whose name contains the given string. If the backend KB is case sensitive, this search is case sensitive. If nameSlot is null, the KB can choose which slot to search. Otherwise, provide the name of a slot whose value should be compared with the search string. Note that this method can actually be used to search on any slot - it doesn't have to be a name slot. The return value is a Collection of frames whose name contains the given string. Returns null if the KB implementation does not support string search of frame names.

Parameters:
searchString - a string that must be contained in the value
nameSlot - an optional slot to be used as the search value. Enter null to use the default slot.
Returns:
A Collection of AlgernonFrame instances, or null if the KB doesn't support search.
Throws:
AlgernonStorageException
See Also:
valueSearch(java.lang.String, java.util.Collection, java.util.Collection, int)

valueSearch

public Collection valueSearch(String searchString,
                              Collection frames,
                              Collection slots)
                       throws AlgernonStorageException
Performs a string search within the KB for slot values that contain the given string. If the backend KB is case sensitive, this search is case sensitive. When the value is a frame, its name is compared to the search string. If the slots and frames arguments are null, all slots on all frames are searched. Slots may be a collection of strings (slot names) or instances of AlgernonSlot. If it is not null, only those slots are searched. If it is null, all slots are searched. Frames may be a collection of strings (frame names) or instances of AlgernonFrame. If it is not null, only those frames are searched. If it is null, all frames are searched. The return value is a Collection of frames that have a slot whose value satisfies the given string. Each frame occurs only once in the returned collection. Returns null if the KB implementation does not support string search of slot values.

Parameters:
searchString - a string that must be contained in the value
frames - an optional Collection of frames or frame names to be searched
slots - an optional Collection of slots or slot names to be searched
Returns:
a Collection of AlgernonFrame instances, or null if the KB doesn't support the search.
Throws:
AlgernonStorageException
See Also:
frameSearch(java.lang.String, java.lang.String, int)

valueSearch

public Collection valueSearch(String searchString)
                       throws AlgernonStorageException
Performs a string search within the KB for slot values that contain the given string. If the backend KB is case sensitive, this search is case sensitive. When the value is a frame, its name is compared to the search string. If the slots and frames arguments are null, all slots on all frames are searched. Slots may be a collection of strings (slot names) or instances of AlgernonSlot. If it is not null, only those slots are searched. If it is null, all slots are searched. Frames may be a collection of strings (frame names) or instances of AlgernonFrame. If it is not null, only those frames are searched. If it is null, all frames are searched. The return value is a Collection of frames that have a slot whose value satisfies the given string. Each frame occurs only once in the returned collection. Returns null if the KB implementation does not support string search of slot values.

Parameters:
searchString - a string that must be contained in the value
Returns:
a Collection of AlgernonFrame instances, or null if the KB doesn't support the search.
Throws:
AlgernonStorageException
See Also:
frameSearch(java.lang.String, java.lang.String, int)

Algernon Software