|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.put.semintec.mining.datastructures.Trie
public class Trie
Represents a trie data structure to store patterns. Nodes represents atoms of a query. Every path from a trie root to a node/leaf represents a query.
Field Summary | |
---|---|
static int |
MAX_VARS
Used to generate new variable names at each depth. |
Constructor Summary | |
---|---|
Trie(Node n)
|
Method Summary | |
---|---|
void |
addNode(Node parent,
Node child)
Adds specified node as child to the specified parent node |
Node |
copy(Node n,
Node copyParent)
Creates copy of the node, new variables are renamed to be also new in a copy. |
void |
copyItself(Node n,
KnowledgeBase kb)
Generates copies of the given node |
boolean |
equivalentToEarlierPattern(Pattern pattern,
KnowledgeBase kb)
Checks if the specified pattern is not equivalent to an earlier pattern in the trie. |
java.util.ArrayList |
generateDependentAtoms(Node n,
Bias bias,
boolean generateDLAtoms)
Generates dependent atoms of the given node that is the nodes that share at least one variable that is new in the node Any semantic properties of the patterns are not tested. |
java.util.ArrayList |
generateDLDependentAtoms(Node n,
Bias bias,
jdsl.core.api.Tree predicateTaxonomy,
KnowledgeBase kb)
Generates dependent atoms, with class/property predicates, of the given node that is the nodes that share at least one variable that is new in the node Atoms are ordered wrt the taxonomy of classes/properties |
java.util.ArrayList |
generateRightBrothers(Node n)
Generates copies of right brothers of the given node that is the nodes that have the same parent node as the given node and are placed on the right of the given node. |
jdsl.core.api.Tree |
getTree()
Getter of the property tree |
static void |
main(java.lang.String[] args)
Testing Trie class methods |
jdsl.core.api.Tree |
recursivelyBuildDLDependentAtoms(Node n,
org.semanticweb.kaon2.api.logic.Literal l,
jdsl.core.api.Tree t,
jdsl.core.api.Position pos,
java.util.ArrayList sharedVars,
jdsl.core.api.Tree dependentAtoms,
jdsl.core.api.Position posDepAtoms)
Constructs a branch of a tree of dependent atoms with class/property predicates (according to the taxonomy of classes/properties) |
void |
removeNode(Node node,
boolean disposeAssociatedResources)
Removes specified node and optionally deletes its associated resources |
void |
setTree(jdsl.core.api.Tree tree)
Setter of the property tree |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_VARS
Constructor Detail |
---|
public Trie(Node n)
n
- Root of the trieMethod Detail |
---|
public jdsl.core.api.Tree getTree()
public void setTree(jdsl.core.api.Tree tree)
tree
- The tree to set.public boolean equivalentToEarlierPattern(Pattern pattern, KnowledgeBase kb) throws org.semanticweb.kaon2.api.KAON2Exception, java.lang.InterruptedException
p
- Pattern whose equivalent is searched in the triekb
- Knowledge base wrt which equivalency of patterns is checked
java.lang.InterruptedException
org.semanticweb.kaon2.api.KAON2Exception
public java.util.ArrayList generateDependentAtoms(Node n, Bias bias, boolean generateDLAtoms) throws org.semanticweb.kaon2.api.KAON2Exception, java.lang.InterruptedException
n
- A node that is to be refined by its dependent atomsbias
- Declarative biasgenerateDLAtoms
- True if DL atoms should be generated, false if only non-DL atoms should be generated
org.semanticweb.kaon2.api.KAON2Exception
java.lang.InterruptedException
public java.util.ArrayList generateDLDependentAtoms(Node n, Bias bias, jdsl.core.api.Tree predicateTaxonomy, KnowledgeBase kb) throws org.semanticweb.kaon2.api.KAON2Exception, java.lang.InterruptedException
n
- A node that is to be refined by its dependent atomsbias
- Declarative biaspredicateTaxonomy
- Taxonomy of classes/propertieskb
- Knowledge base from which information about dependencies between predicates is taken
org.semanticweb.kaon2.api.KAON2Exception
java.lang.InterruptedException
public jdsl.core.api.Tree recursivelyBuildDLDependentAtoms(Node n, org.semanticweb.kaon2.api.logic.Literal l, jdsl.core.api.Tree t, jdsl.core.api.Position pos, java.util.ArrayList sharedVars, jdsl.core.api.Tree dependentAtoms, jdsl.core.api.Position posDepAtoms) throws org.semanticweb.kaon2.api.KAON2Exception
n
- Node in patterns trie, for which dependent atoms are being constructedl
- Literal to put into current node in dependent atoms treet
- Class/property predicates taxonomypos
- Position of class/property from literal l in class/property predicates taxonomysharedVars
- Variables to be shared between atom in node n and newly created dependent atomsdependentAtoms
- Dependent atoms treeposDepAtoms
- Position in dependent atoms tree
org.semanticweb.kaon2.api.KAON2Exception
public Node copy(Node n, Node copyParent) throws org.semanticweb.kaon2.api.KAON2Exception
n
- Node to be copiedcopyParent
- Parent for the copy of the node
org.semanticweb.kaon2.api.KAON2Exception
public java.util.ArrayList generateRightBrothers(Node n) throws org.semanticweb.kaon2.api.KAON2Exception, java.lang.InterruptedException
n
- A node that is to be refined by copies of its right brothers
org.semanticweb.kaon2.api.KAON2Exception
java.lang.InterruptedException
public void copyItself(Node n, KnowledgeBase kb) throws org.semanticweb.kaon2.api.KAON2Exception, java.lang.InterruptedException
n
- A node that is to be refined by its copieskb
- Knowledge base wrt which some properties (satisfibility, sfreenes) of generated refinements are tested
org.semanticweb.kaon2.api.KAON2Exception
java.lang.InterruptedException
public void addNode(Node parent, Node child)
parent
- Parent nodechild
- Child nodepublic void removeNode(Node node, boolean disposeAssociatedResources)
node
- Node to removedisposeAssociatedResources
- True if the resources associted to given node, e.g. query,
should be also disposed while node is being removedpublic static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |