cgp.runtime
Class KBase

java.lang.Object
  |
  +--cgp.runtime.Type
        |
        +--cgp.runtime.KBase

public class KBase
extends Type


Field Summary
private  java.util.TreeSet conceptTypeNames
           
private  notio.ConceptTypeHierarchy conceptTypes
           
private  Namespace corefVars
           
private  java.util.LinkedList graphs
           
private  notio.KnowledgeBase kb
           
private static java.lang.String KBASE_NAME
           
private  java.util.TreeSet relationTypeNames
           
private  notio.RelationTypeHierarchy relationTypes
           
 
Fields inherited from class cgp.runtime.Type
kbStack, scopeStack, type
 
Constructor Summary
KBase()
           
KBase(KBase otherKBase)
           
 
Method Summary
 void addConceptType(java.lang.String typeName)
          Add a single concept type to the hierarchy if it has not already been added.
 void addCorefVarMapping(java.lang.String name, Type value)
          Add a coreferent variable mapping.
 void addRelationType(java.lang.String typeName)
          Add a single relation type to the hierarchy if it has not already been added.
 void assert(GraphType g)
          Assert a graph, first binding coreference variables.
 void assert(GraphType g, boolean bindVars)
          Assert a graph in this knowledge base unless a structurally equivalent graph has already been asserted.
 void bindCorefVars(GraphType g)
          Bind coreference variables in the specified graph, if possible, by reference to the current knowledge base.
private  java.lang.String describeConceptTypes()
           
private  java.lang.String describeRelationTypes()
           
 boolean exactMatch(GraphType g)
          Does the specified graph exactly match a graph in the set?
 java.util.LinkedList getAssertedGraphs()
           
 java.util.TreeSet getConceptTypeNames()
           
 StringType getConcepttypes()
           
 ListType getCorefvars()
           
 Namespace getCorefVars()
           
 Type getCorefVarValue(java.lang.String name)
          Get a coreferent variable's value.
 ListType getGraphs()
          Getter and setter methods for attributes.
 notio.KnowledgeBase getKB()
           
 java.util.TreeSet getRelationTypeNames()
           
 StringType getRelationtypes()
           
private  int graphLocation(GraphType g)
          Return the specified graph's index in the list or -1 if it is not present.
 void linkConceptTypes(java.lang.String superTypeName, java.lang.String typeName)
          Add a concept type to the hierarchy if it has not already been added, and add an immediate supertype.
 void linkRelationTypes(java.lang.String superTypeName, java.lang.String typeName)
          Add a relation type to the hierarchy if it has not already been added, and add an immediate supertype.
 GraphType projectionMatch(GraphType g)
          Does the specified graph project onto a graph in the set?
 void retract(GraphType g)
          Retract a graph, first binding coreference variables.
 void retract(GraphType g, boolean bindVars)
          Retract a graph from this knowledge base based upon structural equivalence.
 java.lang.String toString()
           
 
Methods inherited from class cgp.runtime.Type
addOp, andOp, divideOp, eqOp, geOp, getAttr, getKBStack, getNthOp, getScopeStack, getType, gtOp, invokeMemberFunc, isOp, leOp, ltOp, modulusOp, multiplyOp, negateOp, neOp, notOp, operationError, orOp, setAttr, setKBStack, setNthOp, setScopeStack, setType, subtractOp
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

KBASE_NAME

private static java.lang.String KBASE_NAME

kb

private notio.KnowledgeBase kb

conceptTypes

private notio.ConceptTypeHierarchy conceptTypes

relationTypes

private notio.RelationTypeHierarchy relationTypes

conceptTypeNames

private java.util.TreeSet conceptTypeNames

relationTypeNames

private java.util.TreeSet relationTypeNames

graphs

private java.util.LinkedList graphs

corefVars

private Namespace corefVars
Constructor Detail

KBase

public KBase()

KBase

public KBase(KBase otherKBase)
Method Detail

describeConceptTypes

private java.lang.String describeConceptTypes()

describeRelationTypes

private java.lang.String describeRelationTypes()

graphLocation

private int graphLocation(GraphType g)
Return the specified graph's index in the list or -1 if it is not present. The search is based upon structural graph equivalence.

getKB

public notio.KnowledgeBase getKB()

getAssertedGraphs

public java.util.LinkedList getAssertedGraphs()

getCorefVars

public Namespace getCorefVars()

getConceptTypeNames

public java.util.TreeSet getConceptTypeNames()

getRelationTypeNames

public java.util.TreeSet getRelationTypeNames()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addConceptType

public void addConceptType(java.lang.String typeName)
Add a single concept type to the hierarchy if it has not already been added.

linkConceptTypes

public void linkConceptTypes(java.lang.String superTypeName,
                             java.lang.String typeName)
Add a concept type to the hierarchy if it has not already been added, and add an immediate supertype. It is a precondition that the supertype has already been added via addConceptType(String).

addRelationType

public void addRelationType(java.lang.String typeName)
Add a single relation type to the hierarchy if it has not already been added.

linkRelationTypes

public void linkRelationTypes(java.lang.String superTypeName,
                              java.lang.String typeName)
Add a relation type to the hierarchy if it has not already been added, and add an immediate supertype. It is a precondition that the supertype has already been added via addRelationType(String).

bindCorefVars

public void bindCorefVars(GraphType g)
Bind coreference variables in the specified graph, if possible, by reference to the current knowledge base.

assert

public void assert(GraphType g,
                   boolean bindVars)
Assert a graph in this knowledge base unless a structurally equivalent graph has already been asserted. Coreferent variables in the graph are optionally first bound, a copy being taken to prevent side effects on the original graph. Markers in the graph's concepts are added to the knowledge base's marker set (TBD). May not be necessary if all marker comparison is done by direct comparison.

retract

public void retract(GraphType g,
                    boolean bindVars)
Retract a graph from this knowledge base based upon structural equivalence. Coreferent variables in the graph are optionally first bound, a copy being taken to prevent side effects on the original graph. Markers in the graph's concepts are removed from the knowledge base (TBD). May not be necessary if all marker comparison is done by direct comparison.

assert

public void assert(GraphType g)
Assert a graph, first binding coreference variables.

retract

public void retract(GraphType g)
Retract a graph, first binding coreference variables.

exactMatch

public boolean exactMatch(GraphType g)
Does the specified graph exactly match a graph in the set?

projectionMatch

public GraphType projectionMatch(GraphType g)
Does the specified graph project onto a graph in the set?

addCorefVarMapping

public void addCorefVarMapping(java.lang.String name,
                               Type value)
Add a coreferent variable mapping.

getCorefVarValue

public Type getCorefVarValue(java.lang.String name)
Get a coreferent variable's value. May return undefined.

getGraphs

public ListType getGraphs()
Getter and setter methods for attributes.

getConcepttypes

public StringType getConcepttypes()

getRelationtypes

public StringType getRelationtypes()

getCorefvars

public ListType getCorefvars()