|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Inferencer
Defines an inferencing API based upon topic map constructs. Absent a base ontology for first order logic, only native topic map relationships such as class-instance and superclass-subclass can be inferred. This problem is solved via a "logic.xtm" topic map defining a set of PSIs for various fundamental atoms, functions, and predicates.
Both the logic Topic Map and this API are planned to be extended via a number of additional features, such as support for sets, collections, first order logical relations, etc. So while this is an API, it should not be considered stable in that it will be added to successively. Existing methods will (hopefully) remain stable.
Copyright 2001-2007 Murray Altheim. All Rights Reserved.
| Field Summary | |
|---|---|
static String |
LOGIC_PSI
A String containing the base URL for Published Subject Indicator (PSI) for the logic PSIs defined in the topic map "logic.xtm" (located in that directory). |
static String |
PSI_false
A String containing the Published Subject Indicator (PSI) for the truth value 'false'. |
static String |
PSI_true
A String containing the Published Subject Indicator (PSI) for the truth value 'true'. |
| Method Summary | |
|---|---|
Set |
getClasses(Topic topic)
Returns a Set containing the classes to which the Topic topic is an instance. |
Set |
getInstances(Topic topic)
Returns a Set containing the instances of the Topic topic as a class. |
Set |
getSubclasses(Topic topic)
Returns a Set containing the subclasses of the Topic topic. |
Set |
getSuperclasses(Topic topic)
Returns a Set containing the superclasses of the Topic topic. |
Association |
instanceOf(Topic instance,
Topic classTopic)
Creates Topic instance as an instance of the class Topic classTopic, adding it to the topic map as a new Association. |
boolean |
isClass(Topic topic)
Returns true if Topic topic plays the role of class in any class-instance associations. |
boolean |
isClassInstance(Association assoc)
Returns true if Association assoc is an instance of a class-instance association. |
boolean |
isClassOf(Topic classTopic,
Topic instance,
boolean proper)
Returns true if Topic classTopic is an class for which Topic instance is an instance. |
boolean |
isInstance(Topic topic)
Returns true if Topic topic plays the role of instance in any class-instance associations. |
boolean |
isInstanceOf(Topic instance,
Topic classTopic,
boolean proper)
Returns true if Topic instance is an instance of Topic classTopic. |
boolean |
isMemberOf(Topic topic,
Association assoc)
Returns true if the Topic topic is a Member of Association assoc, regardless of role or type. |
boolean |
isSubclass(Topic topic)
Returns true if Topic topic plays the role of subclass in any superclass-subclass associations. |
boolean |
isSubclassOf(Topic subclass,
Topic superclass,
boolean proper)
Returns true if Topic subclass is a subclass of Topic superclass. |
boolean |
isSuperclass(Topic topic)
Returns true if Topic topic plays the role of superclass in any superclass-subclass associations. |
boolean |
isSuperclassOf(Topic superclass,
Topic subclass,
boolean proper)
Returns true if Topic superclass is a superclass of Topic subclass. |
boolean |
isSuperclassSubclass(Association assoc)
Returns true if Association assoc is an instance of a superclass-subclass association. |
boolean |
playsRoleInAssociation(Topic topic,
Topic rolespec,
Topic type)
Returns true if the Topic topic plays the role of rolespec in any Associations of Topic type. |
boolean |
playsRoleOfClassIn(Topic topic,
Association assoc)
Returns true if Topic topic plays the role of 'class' in Association assoc, which must be a class-instance association. |
boolean |
playsRoleOfInstanceIn(Topic topic,
Association assoc)
Returns true if Topic topic plays the role of 'instance' in Association assoc, which must be a class-instance association. |
boolean |
playsRoleOfSubclassIn(Topic topic,
Association assoc)
Returns true if Topic topic plays the role of 'subclass' in Association assoc, which must be a superclass-subclass association. |
boolean |
playsRoleOfSuperclassIn(Topic topic,
Association assoc)
Returns true if Topic topic plays the role of 'superclass' in Association assoc, which must be a superclass-subclass association. |
Association |
subclassOf(Topic subclass,
Topic superclass)
Creates Topic subclass as a subclass of Topic superclass, adding it to the topic map as a new Association. |
String |
truthValue(boolean value)
Converts from a Java boolean value to the Ceryle PSIs for true and false. |
boolean |
truthValue(String uri)
Converts from the Ceryle PSIs for true and false to a Java boolean. |
| Field Detail |
|---|
static final String LOGIC_PSI
static final String PSI_true
static final String PSI_false
| Method Detail |
|---|
boolean truthValue(String uri)
throws InferenceException
InferenceException - if the URI is not recognizedString truthValue(boolean value)
boolean isClass(Topic topic)
throws InferenceException
InferenceException
boolean isInstance(Topic topic)
throws InferenceException
InferenceException
boolean isSuperclass(Topic topic)
throws InferenceException
InferenceException
boolean isSubclass(Topic topic)
throws InferenceException
InferenceException
boolean isClassInstance(Association assoc)
throws InferenceException
This uses XTM's PSI class-instance to identify the association type.
InferenceException
boolean isSuperclassSubclass(Association assoc)
throws InferenceException
This uses XTM's PSI superclass-subclass to identify the association type.
InferenceException
boolean isMemberOf(Topic topic,
Association assoc)
boolean playsRoleOfClassIn(Topic topic,
Association assoc)
throws InferenceException
InferenceException - if the Association is of the wrong type
boolean playsRoleOfInstanceIn(Topic topic,
Association assoc)
throws InferenceException
InferenceException - if the Association is of the wrong type
boolean playsRoleOfSuperclassIn(Topic topic,
Association assoc)
throws InferenceException
InferenceException - if the Association is of the wrong type
boolean playsRoleOfSubclassIn(Topic topic,
Association assoc)
throws InferenceException
InferenceException - if the Association is of the wrong type
boolean playsRoleInAssociation(Topic topic,
Topic rolespec,
Topic type)
throws InferenceException
InferenceException - if an error occurs while processing.
boolean isSuperclassOf(Topic superclass,
Topic subclass,
boolean proper)
throws InferenceException
InferenceException
boolean isSubclassOf(Topic subclass,
Topic superclass,
boolean proper)
throws InferenceException
InferenceException
boolean isClassOf(Topic classTopic,
Topic instance,
boolean proper)
throws InferenceException
InferenceException
boolean isInstanceOf(Topic instance,
Topic classTopic,
boolean proper)
throws InferenceException
InferenceException
Set getSuperclasses(Topic topic)
throws InferenceException
InferenceException
Set getSubclasses(Topic topic)
throws InferenceException
InferenceException
Set getClasses(Topic topic)
throws InferenceException
InferenceException
Set getInstances(Topic topic)
throws InferenceException
InferenceException
Association subclassOf(Topic subclass,
Topic superclass)
throws InferenceException
(This is the equivalent of Cyc's #$genls predicate)
InferenceException
Association instanceOf(Topic instance,
Topic classTopic)
throws InferenceException
(This is the equivalent of Cyc's #$isa predicate)
InferenceException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||