JTP API Documentation

jtp.time
Class TimePointKnowledgeStore

java.lang.Object
  |
  +--java.beans.beancontext.BeanContextChildSupport
        |
        +--jtp.util.PropertyImporter
              |
              +--jtp.time.TimePointKnowledgeStore
All Implemented Interfaces:
BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, EventListener, KnowledgeStore, Serializable

public class TimePointKnowledgeStore
extends PropertyImporter
implements KnowledgeStore

A KnowledgeStore for time points.

This KnowledgeStore interfaces with an instance of TLGraph, which is where the time points are actually stored and most of the reasoning is actually performed. The methods getAskingReasoner() and getTellingReasoner() return reasoners that can be installed in dispatchers to provide time time point reasoning functionality.

See Also:
TimePoint, Serialized Form

Nested Class Summary
 class TimePointKnowledgeStore.AskingReasoner
           
 class TimePointKnowledgeStore.TellingReasoner
           
 class TimePointKnowledgeStore.TimePointReasoningStep
           
 
Field Summary
 
Fields inherited from class java.beans.beancontext.BeanContextChildSupport
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
 
Constructor Summary
TimePointKnowledgeStore(CanonicalMapping mapping, TimeVocabulary vocab)
           
 
Method Summary
 void createInverseRule()
          Creates inverse relation reasoning step rule.
 void createSubRelationRule()
          Creates sub-relation reasoning step rule.
 void createTransitivityRule()
          Creates transitivity reasoning step rule.
 Reasoner getAskingReasoner()
          The relations that this reasoner can answer queries about include before, after, equal-point, before-or-equal, and after-or-equal.
 byte getByteRelation(Symbol r)
           
 int getMaxDepth()
           
 ReasoningStep getPointEqualityReasoningStep(Object tp1, Object tp2, List substeps)
           
 ReasoningStep getPointRelationInverseReasoningStep(ReasoningStep sub)
           
 ReasoningStep getPointSubRelationReasoningStep(Symbol sub, Symbol prop, ReasoningStep rs)
           
 Symbol getRelationSymbol(byte r)
           
 Reasoner getTellingReasoner()
          A reasoner that handles assertions about the relations between time points.
 ReasoningStep getTimePointReasoningStep(Literal goal, List substeps)
           
 UndoManager getUndoManager()
           
 void setMaxDepth(int m)
           
 void setUndoManager(UndoManager undo)
           
 
Methods inherited from class jtp.util.PropertyImporter
getImportedProperties, initializeBeanContextResources, setImportedProperties
 
Methods inherited from class java.beans.beancontext.BeanContextChildSupport
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimePointKnowledgeStore

public TimePointKnowledgeStore(CanonicalMapping mapping,
                               TimeVocabulary vocab)
Method Detail

getMaxDepth

public int getMaxDepth()

setMaxDepth

public void setMaxDepth(int m)

getUndoManager

public UndoManager getUndoManager()

setUndoManager

public void setUndoManager(UndoManager undo)

createSubRelationRule

public void createSubRelationRule()
Creates sub-relation reasoning step rule.
 (=> (and (subRelation ?psub ?prop)
          (holds ?psub ?x ?y))
     (holds ?prop ?x ?y))
 
This rule will be a substep in some of the reasoning steps returned by this reasoner.


createTransitivityRule

public void createTransitivityRule()
Creates transitivity reasoning step rule.
 (=> (and (type ?prop transitiveRelation)
          (holds ?prop ?x ?y)
          (holds ?prop ?y ?z))
     (holds ?prop ?x ?z))
 This rule will be a substep in some of the reasoning steps
 returned by this reasoner.
 

Also creates reasoning step for the assertion (type equal transitiveRelation).


createInverseRule

public void createInverseRule()
Creates inverse relation reasoning step rule.
 (=> (and (inverse ?p1 ?p2)
          (holds ?p1 ?x ?y))
     (holds ?p2 ?y ?x))
 
This rule will be a substep in some of the reasoning steps returned by this reasoner.

Also creates reasoning steps for the assertions (inverse before after) and (inverse before-or-equal after-or-equal)


getAskingReasoner

public Reasoner getAskingReasoner()
The relations that this reasoner can answer queries about include before, after, equal-point, before-or-equal, and after-or-equal.

Whenever this reasoner is queried with one of the acceptable time point relations, at least one of the time points must not be a variable. That is, this reasoner cannot process queries such as (before ?x ?y).

The asking reasoner can also process queries which use the relation location-of. A query of the form (location-of tp ?before ?after) is asking the absolute time points which are immediately before and after tp on the timeline.

This reasoner can also process queries of the form (holds ?rel tp1 tp2). It will return all known relationships between tp1 and tp2 as bindings for ?rel.

Specified by:
getAskingReasoner in interface KnowledgeStore

getTellingReasoner

public Reasoner getTellingReasoner()
A reasoner that handles assertions about the relations between time points.

The relations that this reasoner can process include before, after, equal-point, before-or-equal, and after-or-equal.

Time points can be specified as absolute time points or symbolic time points. An example of an absolute time point specification is (date (year 1998) (month 7) (day 8) (hour 0) (minute 0) (second 0)), which represents August 8, 1998 at 12:00:00 a.m.

The time point that represents the starting point of an interval named foo can be referred to as (starting-point foo). Similarly, the time point that represents the ending point of foo can be referred to as (ending-point foo)

Specified by:
getTellingReasoner in interface KnowledgeStore

getByteRelation

public byte getByteRelation(Symbol r)

getRelationSymbol

public Symbol getRelationSymbol(byte r)

getTimePointReasoningStep

public ReasoningStep getTimePointReasoningStep(Literal goal,
                                               List substeps)

getPointEqualityReasoningStep

public ReasoningStep getPointEqualityReasoningStep(Object tp1,
                                                   Object tp2,
                                                   List substeps)

getPointRelationInverseReasoningStep

public ReasoningStep getPointRelationInverseReasoningStep(ReasoningStep sub)

getPointSubRelationReasoningStep

public ReasoningStep getPointSubRelationReasoningStep(Symbol sub,
                                                      Symbol prop,
                                                      ReasoningStep rs)

JTP API Documentation