|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.tm.InferencerImpl
public class InferencerImpl
Implements the inferencing API for topic map constructs. The TopicMap used for each method is obtained from its first parameter. In instances where the the parameters of the method must come from the same TopicMap object, an exception is thrown.
Copyright 2001-2007 Murray Altheim. All Rights Reserved.
Inferencer| Field Summary | |
|---|---|
protected TopicMap |
map
The TopicMap used temporarily by this Inferencer (on a method-by-method basis). |
protected MessageHandler |
mh
|
protected Services |
srvs
|
protected TopicMapProcessor |
tmproc
The TopicMapProcessor used by this Inferencer. |
| Fields inherited from interface org.ceryle.tm.Inferencer |
|---|
LOGIC_PSI, PSI_false, PSI_true |
| Constructor Summary | |
|---|---|
InferencerImpl()
Default constructor. |
|
| Method Summary | |
|---|---|
Set |
getClasses(Topic topic)
Returns a Set containing the classes to which the Topic topic is a direct instance. |
Set |
getInstances(Topic topic)
Returns a Set containing the instances of the class Topic topic. |
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 a 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. |
protected void |
setTopicMap(TopicMapObject o)
Sets the TopicMap used for internal operations. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TopicMap map
protected TopicMapProcessor tmproc
protected MessageHandler mh
protected Services srvs
| Constructor Detail |
|---|
public InferencerImpl()
| Method Detail |
|---|
protected void setTopicMap(TopicMapObject o)
throws TopicMapException
TopicMapException
public boolean truthValue(String uri)
throws InferenceException
truthValue in interface InferencerInferenceException - if the URI is not recognizedpublic String truthValue(boolean value)
truthValue in interface Inferencer
public boolean isClass(Topic topic)
throws InferenceException
isClass in interface InferencerInferenceException
public boolean isInstance(Topic topic)
throws InferenceException
isInstance in interface InferencerInferenceException
public boolean isSuperclass(Topic topic)
throws InferenceException
isSuperclass in interface InferencerInferenceException
public boolean isSubclass(Topic topic)
throws InferenceException
isSubclass in interface InferencerInferenceException
public boolean isClassInstance(Association assoc)
throws InferenceException
This uses XTM's PSI class-instance to identify the association type.
isClassInstance in interface InferencerInferenceException
public boolean isSuperclassSubclass(Association assoc)
throws InferenceException
This uses XTM's PSI superclass-subclass to identify the association type.
isSuperclassSubclass in interface InferencerInferenceException
public boolean isMemberOf(Topic topic,
Association assoc)
isMemberOf in interface Inferencer
public boolean playsRoleOfClassIn(Topic topic,
Association assoc)
throws InferenceException
playsRoleOfClassIn in interface InferencerInferenceException - if the Association is of the wrong type
public boolean playsRoleOfInstanceIn(Topic topic,
Association assoc)
throws InferenceException
playsRoleOfInstanceIn in interface InferencerInferenceException - if the Association is of the wrong type
public boolean playsRoleOfSuperclassIn(Topic topic,
Association assoc)
throws InferenceException
playsRoleOfSuperclassIn in interface InferencerInferenceException - if the Association is of the wrong type
public boolean playsRoleOfSubclassIn(Topic topic,
Association assoc)
throws InferenceException
playsRoleOfSubclassIn in interface InferencerInferenceException - if the Association is of the wrong type
public boolean playsRoleInAssociation(Topic topic,
Topic rolespec,
Topic type)
throws InferenceException
playsRoleInAssociation in interface InferencerInferenceException - if an error occurs while processing.
public boolean isSuperclassOf(Topic superclass,
Topic subclass,
boolean proper)
throws InferenceException
isSuperclassOf in interface InferencerInferenceException
public boolean isSubclassOf(Topic subclass,
Topic superclass,
boolean proper)
throws InferenceException
isSubclassOf in interface InferencerInferenceException
public boolean isClassOf(Topic classTopic,
Topic instance,
boolean proper)
throws InferenceException
isClassOf in interface InferencerInferenceException
public boolean isInstanceOf(Topic instance,
Topic classTopic,
boolean proper)
throws InferenceException
isInstanceOf in interface InferencerInferenceException
public Set getSuperclasses(Topic topic)
throws InferenceException
getSuperclasses in interface InferencerInferenceException
public Set getSubclasses(Topic topic)
throws InferenceException
getSubclasses in interface InferencerInferenceException
public Set getClasses(Topic topic)
throws InferenceException
getClasses in interface InferencerInferenceException
public Set getInstances(Topic topic)
throws InferenceException
getInstances in interface InferencerInferenceException
public Association subclassOf(Topic subclass,
Topic superclass)
throws InferenceException
(This is the equivalent of Cyc's #$genls predicate)
subclassOf in interface InferencerInferenceException
public Association instanceOf(Topic instance,
Topic classTopic)
throws InferenceException
(This is the equivalent of Cyc's #$isa predicate)
instanceOf in interface InferencerInferenceException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||