jInfer

cz.cuni.mff.ksi.jinfer.functionalDependencies
Class RXMLTree

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.functionalDependencies.RXMLTree

public class RXMLTree
extends Object

Class representing R-XML tree.


Constructor Summary
RXMLTree(Document document)
          Constructor of RXMLtree.
 
Method Summary
 void addRepairGroup(RepairGroup repairGroup)
          Associate repair group with this tree.
 void applyRepair(Repair repair)
          Apply provided repair to this tree.
 void clearRepairs(RepairCandidate repair, boolean clearRG)
          Invalidate tuples which are no longer tuples, because of application of repairs.
 Document getDocument()
          Get DOM representation of this tree.
 RepairGroup getMinimalRepairGroup()
          Get repair group with the lowest cost.
 int getNewTupleID()
          Get new unique tuple ID.
 Map<Node,NodeAttribute> getNodesMap()
          Get map of nodes of this tree and its attributes.
 PathAnswer getPathAnswer(Path path)
          Get path answer for provided path.
 PathAnswer getPathAnswerForCreatingTuple(Path path, Tuple tuple)
          Get path answer for provided tuple.
 PathAnswer getPathAnswerForTuple(Path path, Tuple tuple, boolean isThesis)
          Get path answer for provided tuple.
 List<Path> getPaths()
          Get list of paths defined for this tree.
 List<RepairGroup> getRepairGroups()
          Get list of all repair groups associated with this tree.
 List<UserNodeSelection> getSavedUserSelections()
          Get list of all saved repair candidates by the user.
 double getThresholdT()
          Get threshold t associated with this tree.
 List<Pair<Tuple,Tuple>> getTuplePairs()
          Get list of all pairs created from all tuples associated with this tree.
 List<Tuple> getTuples()
          Get list of tuples associated with this tree.
 void invalidateSidePathAnswers(Tuple tuple)
          Invalidate side answers for provided tuple.
 boolean isFDDefinedForTree(List<FD> functionalDependencies)
          Check if provided functional dependencies can be used with this tree.
 boolean isInconsistent(List<FD> functionalDependencies)
          Check if this tree is inconsistent agains provided functional dependencies.
 boolean isRGEmpty()
          Check if there is any repair group associated with this tree.
 boolean isSatisfyingFD(FD fd)
          Check if tree satisfies provided functional dependency.
 boolean isSatisfyingFDThesis(FD fd)
          Check if tree satisfies provided functional dependency.
 boolean isTuplePairSatisfyingFD(Pair<Tuple,Tuple> tuplePair, FD fd)
          Check if tuple pair satisfies functional dependency.
 boolean isTuplePairSatisfyingFDThesis(Pair<Tuple,Tuple> tuplePair, FD fd)
          Check if tuple pair satisfies functional dependency.
 String pathsToString()
          Get string representation of paths defined for this tree.
 void removeRG(RepairGroup repairGroup)
          Remove provided repair group from all repair groups associated with this tree.
 void removeTuple(Tuple tuple)
          Invalidate tuple of this tree.
 void saveUserSelection(RepairCandidate pickedRepair)
          Save previous user selected repair candidate.
 void setPaths(List<Path> paths)
          Set paths defined for this tree.
 void setThresholdT(double thresholdT)
          Set threshold t to be associated with this tree.
 void setWeights(List<Tweight> weights)
          Set weights of nodes of this tree.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RXMLTree

public RXMLTree(Document document)
Constructor of RXMLtree. As a parameter gets DOM representation of XML data.

Parameters:
document - DOM representation of XML data.
Method Detail

isSatisfyingFD

public boolean isSatisfyingFD(FD fd)
                       throws InterruptedException
Check if tree satisfies provided functional dependency.

Parameters:
fd - Functional dependency to be check against.
Returns:
true if tree satisfies provided functional dependency.
Throws:
InterruptedException - if user interrupts repairing.

isSatisfyingFDThesis

public boolean isSatisfyingFDThesis(FD fd)
                             throws InterruptedException
Check if tree satisfies provided functional dependency. This method is suitable for thesis algorithm.

Parameters:
fd - Functional dependency to be check against.
Returns:
true if tree satisfies provided functional dependency.
Throws:
InterruptedException - if user interrupts repairing.

isTuplePairSatisfyingFDThesis

public boolean isTuplePairSatisfyingFDThesis(Pair<Tuple,Tuple> tuplePair,
                                             FD fd)
Check if tuple pair satisfies functional dependency. This method is suitable for thesis algorithm.

Parameters:
tuplePair - Tuple pair to be checked.
fd - Functional dependency to be ckeck against.
Returns:
true if tuple pair satisfies functional dependency.

isTuplePairSatisfyingFD

public boolean isTuplePairSatisfyingFD(Pair<Tuple,Tuple> tuplePair,
                                       FD fd)
Check if tuple pair satisfies functional dependency.

Parameters:
tuplePair - Tuple pair to be checked.
fd - Functional dependency to be ckeck against.
Returns:
true if tuple pair satisfies functional dependency.

getDocument

public Document getDocument()
Get DOM representation of this tree.

Returns:
DOM representation of this tree.

toString

public String toString()
Overrides:
toString in class Object

getPaths

public List<Path> getPaths()
Get list of paths defined for this tree.

Returns:
List of paths defined for this tree.

setPaths

public void setPaths(List<Path> paths)
Set paths defined for this tree.

Parameters:
paths - Paths defined for this tree.

pathsToString

public String pathsToString()
Get string representation of paths defined for this tree.

Returns:
String representation of paths defined for this tree.

getPathAnswer

public PathAnswer getPathAnswer(Path path)
Get path answer for provided path.

Parameters:
path - Path to be the answer returned.
Returns:
path answer for provided path.

getPathAnswerForCreatingTuple

public PathAnswer getPathAnswerForCreatingTuple(Path path,
                                                Tuple tuple)
Get path answer for provided tuple. This answer must contain max one node.

Parameters:
path - Path to be answer returned.
tuple - Tuple for which is returned the answer.
Returns:
path answer for provided path.

getPathAnswerForTuple

public PathAnswer getPathAnswerForTuple(Path path,
                                        Tuple tuple,
                                        boolean isThesis)
Get path answer for provided tuple. This answer can contains more then one node.

Parameters:
path - Path to be answer returned.
tuple - Tuple for which is returned the answer.
Returns:
path answer for provided path.

getTuples

public List<Tuple> getTuples()
Get list of tuples associated with this tree.

Returns:
List of tuples.

getNewTupleID

public int getNewTupleID()
Get new unique tuple ID.

Returns:
New unique tuple ID.

getNodesMap

public Map<Node,NodeAttribute> getNodesMap()
Get map of nodes of this tree and its attributes.

Returns:
Map of nodes and attributes.

applyRepair

public void applyRepair(Repair repair)
Apply provided repair to this tree.

Parameters:
repair - Repair to be applied.

isFDDefinedForTree

public boolean isFDDefinedForTree(List<FD> functionalDependencies)
Check if provided functional dependencies can be used with this tree.

Parameters:
functionalDependencies - List of functional dependencies to be checked.
Returns:
true if paths from which are functional dependecies created are defined for this tree.

addRepairGroup

public void addRepairGroup(RepairGroup repairGroup)
Associate repair group with this tree.

Parameters:
repairGroup - Repair group to be associated with this tree.

getRepairGroups

public List<RepairGroup> getRepairGroups()
Get list of all repair groups associated with this tree.

Returns:
List of all associated repair groups.

isInconsistent

public boolean isInconsistent(List<FD> functionalDependencies)
                       throws InterruptedException
Check if this tree is inconsistent agains provided functional dependencies.

Parameters:
functionalDependencies - List of functional dependencies to be check inconsistency.
Returns:
true if this tree is inconsistent against functional dependencies.
Throws:
InterruptedException - if user interrupt repairing.

getMinimalRepairGroup

public RepairGroup getMinimalRepairGroup()
Get repair group with the lowest cost.

Returns:
Repair group with the lowest cost.

clearRepairs

public void clearRepairs(RepairCandidate repair,
                         boolean clearRG)
Invalidate tuples which are no longer tuples, because of application of repairs. Checks only tuples which are repaired by provided repair. If clearRG flag is true, repair groups associated with this tree are cleared.

Parameters:
repair - Repair for which are tuples checked.
clearRG - flag defining if repair groups will be cleared.

removeTuple

public void removeTuple(Tuple tuple)
Invalidate tuple of this tree.


setWeights

public void setWeights(List<Tweight> weights)
Set weights of nodes of this tree.

Parameters:
weights - List of Tweight to be set.

saveUserSelection

public void saveUserSelection(RepairCandidate pickedRepair)
Save previous user selected repair candidate.

Parameters:
pickedRepair - Repair candidate to be saved.

getSavedUserSelections

public List<UserNodeSelection> getSavedUserSelections()
Get list of all saved repair candidates by the user.

Returns:
List of all saved repair candidates by the user.

getThresholdT

public double getThresholdT()
Get threshold t associated with this tree.

Returns:
Threshold t associated with this tree.

setThresholdT

public void setThresholdT(double thresholdT)
Set threshold t to be associated with this tree.

Parameters:
thresholdT - Threshold t to be associated with this tree.

getTuplePairs

public List<Pair<Tuple,Tuple>> getTuplePairs()
                                      throws InterruptedException
Get list of all pairs created from all tuples associated with this tree.

Returns:
List of all pairs created from all tuples associated with this tree.
Throws:
InterruptedException - if user interrupted repairing.

invalidateSidePathAnswers

public void invalidateSidePathAnswers(Tuple tuple)
Invalidate side answers for provided tuple.

Parameters:
tuple - Tuple for which side paths will be invalidated.

removeRG

public void removeRG(RepairGroup repairGroup)
Remove provided repair group from all repair groups associated with this tree.

Parameters:
repairGroup - Repair group to be removed.

isRGEmpty

public boolean isRGEmpty()
Check if there is any repair group associated with this tree.

Returns:
true if there is no repair group associated with this tree.

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011