org.put.semintec.mining.datastructures
Class Node

java.lang.Object
  extended by org.put.semintec.mining.datastructures.Node

public class Node
extends java.lang.Object

Represents a node in a trie data structure.

Author:
Agnieszka Lawrynowicz

Field Summary
 java.lang.String how
           
 
Constructor Summary
Node()
           
 
Method Summary
 void dispose()
          Disposes resources associated to given node
 Atom getAtom()
          Getter of the property atom
 int getDepth()
          Getter of the property depth
 java.util.HashMap getLastMaterializationDepth()
          Getter of the property lastMaterializationDepth
 boolean getMaterialized()
          Getter of the property marked
 boolean[] getNewVarPos()
          Getter of the property newVars
 Pattern getPattern()
          Getter of the property pattern
 jdsl.core.api.Position getPos()
          Getter of the property pos
 Pattern getRewrittenPattern()
          Getter of the property rewrittenPattern
 java.util.List materializeResults(KnowledgeBase kb)
          Materializes answers of rewritten query associated with the node - for each relevant variable creates special predicates to store answers.
 java.util.List materializeResultsInit(KnowledgeBase kb)
          Materializes answers of the reference query
 Pattern rewriteLiteralsToSupOnes(Node parent, KnowledgeBase kb)
          Rewrites query Q1 associated with the given node into new query Q2 where literals of Q1 are rewritten to special predicates in Q2 (one per each variable appearing in both: query Q1 and atom a).
 void setAtom(Atom atom)
          Setter of the property atom
 void setDepth(int depth)
          Setter of the property depth
 void setLastMaterializationDepth(java.util.HashMap lastMaterializationDepth)
          Setter of the property lastMaterializationDepth
 void setMaterialized(boolean materialized)
          Setter of the property marked
 void setNewVarPos(boolean[] newVarPos)
          Setter of the property newVars
 void setPattern(Pattern pattern)
          Setter of the property pattern
 void setPos(jdsl.core.api.Position pos)
          Setter of the property pos
 void setRewrittenPattern(Pattern rewrittenPattern)
          Setter of the property rewrittenPattern
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

how

public java.lang.String how
Constructor Detail

Node

public Node()
Method Detail

getLastMaterializationDepth

public java.util.HashMap getLastMaterializationDepth()
Getter of the property lastMaterializationDepth

Returns:
Returns the lastMaterializationDepth.

setLastMaterializationDepth

public void setLastMaterializationDepth(java.util.HashMap lastMaterializationDepth)
Setter of the property lastMaterializationDepth

Parameters:
lastMaterializationDepth - The lastMaterializationDepth to set.

getRewrittenPattern

public Pattern getRewrittenPattern()
Getter of the property rewrittenPattern

Returns:
Returns the rewrittenPattern.

setRewrittenPattern

public void setRewrittenPattern(Pattern rewrittenPattern)
Setter of the property rewrittenPattern

Parameters:
rewrittenPattern - The rewrittenPattern to set.

getDepth

public int getDepth()
Getter of the property depth

Returns:
Returns the depth.

setDepth

public void setDepth(int depth)
Setter of the property depth

Parameters:
depth - The depth to set.

getPattern

public Pattern getPattern()
Getter of the property pattern

Returns:
Returns the pattern.

setPattern

public void setPattern(Pattern pattern)
Setter of the property pattern

Parameters:
pattern - The pattern to set.

getPos

public jdsl.core.api.Position getPos()
Getter of the property pos

Returns:
Returns the pos.

setPos

public void setPos(jdsl.core.api.Position pos)
Setter of the property pos

Parameters:
pos - The pos to set.

getMaterialized

public boolean getMaterialized()
Getter of the property marked

Returns:
Returns the marked.

setMaterialized

public void setMaterialized(boolean materialized)
Setter of the property marked

Parameters:
marked - The marked to set.

getNewVarPos

public boolean[] getNewVarPos()
Getter of the property newVars

Returns:
Returns the newVars.

setNewVarPos

public void setNewVarPos(boolean[] newVarPos)
Setter of the property newVars

Parameters:
newVars - The newVars to set.

getAtom

public Atom getAtom()
Getter of the property atom

Returns:
Returns the atom.

setAtom

public void setAtom(Atom atom)
Setter of the property atom

Parameters:
atom - The atom to set.

rewriteLiteralsToSupOnes

public Pattern rewriteLiteralsToSupOnes(Node parent,
                                        KnowledgeBase kb)
                                 throws org.semanticweb.kaon2.api.KAON2Exception
Rewrites query Q1 associated with the given node into new query Q2 where literals of Q1 are rewritten to special predicates in Q2 (one per each variable appearing in both: query Q1 and atom a). The special predicates are to store cached answers.

Parameters:
parent - node of the given pattern
kb - Knowledge base where special predicates are stored
Returns:
New pattern, based on query Q2 and with last atom from current node
Throws:
org.semanticweb.kaon2.api.KAON2Exception

materializeResults

public java.util.List materializeResults(KnowledgeBase kb)
                                  throws org.semanticweb.kaon2.api.KAON2Exception,
                                         java.lang.InterruptedException
Materializes answers of rewritten query associated with the node - for each relevant variable creates special predicates to store answers.

Parameters:
kb - Knowledge base to which answers are to be materialized
Returns:
List of changes (of type) to knowledge base, made by adding materialized answers, to rollback
Throws:
java.lang.InterruptedException
org.semanticweb.kaon2.api.KAON2Exception

materializeResultsInit

public java.util.List materializeResultsInit(KnowledgeBase kb)
                                      throws org.semanticweb.kaon2.api.KAON2Exception,
                                             java.lang.InterruptedException
Materializes answers of the reference query

Parameters:
kb - Knowledge base to which answers are to be materialized
Returns:
List of changes (of type) to knowledge base, made by adding materialized answers, to rollback
Throws:
java.lang.InterruptedException
org.semanticweb.kaon2.api.KAON2Exception

dispose

public void dispose()
Disposes resources associated to given node