|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public Object getImplementation()
public void close()
public void reset() throws AlgernonStorageException
AlgernonStorageException
public String getName()
getName
in interface AlgernonObject
public String getUserName()
public Collection getRootClasses()
public AlgernonClass getRootClass()
public LispValue getAllFrames()
public LispValue query(Clause clkause) throws AlgernonException
AlgernonException
Clause
public LispValue query(Clause clause, AlgernonFacet facet) throws AlgernonStorageException, AlgernonDataException
AlgernonStorageException
AlgernonDataException
public LispValue verify(Clause clause) throws AlgernonStorageException, AlgernonDataException
AlgernonStorageException
AlgernonDataException
public Collection frameSearch(String searchString, String nameSlot, int limit) throws AlgernonStorageException
searchString
- a string that must be contained in the valuenameSlot
- 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.
AlgernonStorageException
valueSearch(java.lang.String, java.util.Collection, java.util.Collection, int)
public Collection valueSearch(String searchString, Collection frames, Collection slots, int limit) throws AlgernonStorageException
searchString
- a string that must be contained in the valueframes
- an optional Collection of frames or frame names to be searchedslots
- an optional Collection of slots or slot names to be searchedlimit
- an optional limit on the number of frames to return. Use -1 for unlimited.
AlgernonStorageException
frameSearch(java.lang.String, java.lang.String, int)
public LispValue store(Clause clause) throws AlgernonStorageException, AlgernonDataException
AlgernonStorageException
AlgernonDataException
public LispValue store(Clause clause, AlgernonFacet facet) throws AlgernonStorageException, AlgernonDataException
AlgernonStorageException
AlgernonDataException
public boolean isDisjointRelation(String relationName)
public boolean isNameRelation(String relationName)
public boolean isInstanceToClassRelation(String relationName)
public boolean isClassToInstanceRelation(String relationName)
public boolean isSubclassToSuperclassRelation(String relationName)
public boolean isSuperclassToSubclassRelation(String relationName)
public String getDisplayNameRelationName()
public AlgernonRelation getDisplayNameRelation() throws AlgernonDataException
AlgernonDataException
public AlgernonClass createClass(String frameName, AlgernonClass superclass) throws AlgernonRuntimeException
AlgernonRuntimeException
public AlgernonFacet createFacet(String facetName)
public AlgernonInstance createInstance(String frameName, AlgernonClass theClass)
public AlgernonRelation createRelation(String relationName, Set domains, Set ranges, Integer minCardinality, Integer maxCardinality, Object defaultValue, AlgernonRelation inverseRelation) throws AlgernonDataException
AlgernonDataException
public void deleteClass(AlgernonClass frame) throws AlgernonDataException, AlgernonException
AlgernonDataException
AlgernonException
public void deleteFacet(AlgernonFacet frame) throws AlgernonDataException, AlgernonException
AlgernonDataException
AlgernonException
public void deleteFrame(AlgernonFrame frame) throws AlgernonDataException, AlgernonException
AlgernonDataException
AlgernonException
public void deleteInstance(AlgernonInstance frame) throws AlgernonDataException, AlgernonException
AlgernonDataException
AlgernonException
public void deleteRelation(AlgernonRelation frame) throws AlgernonDataException, AlgernonException
AlgernonDataException
AlgernonException
public void deleteClauses(Clause clause)
public void deleteClauses(Clause clause, AlgernonFacet facet)
public boolean isClass(String frameName) throws AlgernonDataException
AlgernonDataException
public boolean isFacet(String frameName) throws AlgernonDataException
AlgernonDataException
public boolean isFrame(String frameName) throws AlgernonDataException
AlgernonDataException
public boolean isInstance(String frameName) throws AlgernonDataException
AlgernonDataException
public boolean isRelation(String frameName) throws AlgernonDataException
AlgernonDataException
public AlgernonClass lookupClass(String name) throws AlgernonDataException
AlgernonDataException
public AlgernonFacet lookupFacet(String name) throws AlgernonDataException
AlgernonDataException
public AlgernonFrame lookupFrame(String name) throws AlgernonDataException
AlgernonDataException
public AlgernonInstance lookupInstance(String name) throws AlgernonDataException
AlgernonDataException
public AlgernonRelation lookupRelation(String name) throws AlgernonDataException
AlgernonDataException
public AlgernonRelation lookupRelation(String name, Set classes) throws AlgernonDataException
AlgernonDataException
public boolean generalIsa(String child, String parent) throws AlgernonDataException
AlgernonDataException
public boolean generalNotIsa(String child, String parent)
public Collection convertToAlgernon(Collection coll)
public Object convertToAlgernon(Object obj)
public Collection convertFromAlgernon(Collection coll)
public Object convertFromAlgernon(Object obj)
public AlgernonFrame leastCommonSuperclass(AlgernonFrame frame1, AlgernonFrame frame2)
public boolean containsClause(Clause queryClause, int state) throws AlgernonDataException
queryClause
- state
- is Algernon.NEGATED or something else.
AlgernonDataException
public void setName(String newName)
public AlgernonClass createClass(String frameName, AlgernonClass superclass, AlgernonClass metaClass) throws AlgernonRuntimeException
AlgernonRuntimeException
public AlgernonRelation createRelation(String relationName, LispValue domain, LispValue range, Integer minCardinality, Integer maxCardinality, Object defaultValue, AlgernonRelation inverseRelation) throws AlgernonDataException
AlgernonDataException
public ValueType valueOf(LispValue typeName)
public LispValue getValueType(Object o)
public boolean canAssignToValueType(Object o, LispValue vt)
public boolean isSimpleType(AlgernonRelation relation)
public boolean isSimpleType(AlgernonFrame frame, AlgernonRelation slot)
public AlgernonFrame getFrame(String name) throws AlgernonDataException
AlgernonDataException
public void setDisplayNameRelationName(String relationName)
public void save() throws AlgernonStorageException
AlgernonStorageException
public boolean supportsNegatedClauses()
public AlgernonInstance lookupInstance(String javaClassName, String name) throws AlgernonDataException
AlgernonDataException
public AlgernonInstance lookupInstance(String javaClassName, String name, String field) throws AlgernonDataException
AlgernonDataException
public Collection frameSearch(String searchString) throws AlgernonStorageException
searchString
- a string that must be contained in the value
AlgernonStorageException
valueSearch(java.lang.String, java.util.Collection, java.util.Collection, int)
public Collection frameSearch(String searchString, String nameSlot) throws AlgernonStorageException
searchString
- a string that must be contained in the valuenameSlot
- an optional slot to be used as the search value. Enter null to use the default slot.
AlgernonStorageException
valueSearch(java.lang.String, java.util.Collection, java.util.Collection, int)
public Collection valueSearch(String searchString, Collection frames, Collection slots) throws AlgernonStorageException
searchString
- a string that must be contained in the valueframes
- an optional Collection of frames or frame names to be searchedslots
- an optional Collection of slots or slot names to be searched
AlgernonStorageException
frameSearch(java.lang.String, java.lang.String, int)
public Collection valueSearch(String searchString) throws AlgernonStorageException
searchString
- a string that must be contained in the value
AlgernonStorageException
frameSearch(java.lang.String, java.lang.String, int)
|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |