org.deri.iris.querycontainment
Class QueryContainment

java.lang.Object
  extended by org.deri.iris.querycontainment.QueryContainment
All Implemented Interfaces:
IQueryContainment

public class QueryContainment
extends Object
implements IQueryContainment

Checks two queries for query containment, based on a given knowledge base.

Author:
Nathalie Steinmetz, DERI Innsbruck

Constructor Summary
QueryContainment(IKnowledgeBase kb)
           
QueryContainment(List<IRule> rules)
           Creates a new query containment checker with a given knowledge base.
 
Method Summary
 boolean checkQueryContainment(IQuery query1, IQuery query2)
           Checks whether query1 is contained within query2.
 IRelation getContainmentMappings()
           Return the containment mappings that result from the containment check.
 List<IVariable> getVariableBindings()
          Return the variables from the query in 'execution' order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryContainment

public QueryContainment(List<IRule> rules)

Creates a new query containment checker with a given knowledge base.

Parameters:
program - The program
Throws:
IllegalArgumentException - If the program or the evaluator is null, or If the program contains queries

QueryContainment

public QueryContainment(IKnowledgeBase kb)
Method Detail

checkQueryContainment

public boolean checkQueryContainment(IQuery query1,
                                     IQuery query2)
                              throws EvaluationException
Description copied from interface: IQueryContainment

Checks whether query1 is contained within query2.

Specified by:
checkQueryContainment in interface IQueryContainment
Parameters:
query1 - The query for which to check whether it is contained within query2.
query2 - The query for which to check whether it contains query1.
Returns:
True if query1 is contained within query2, otherwise false.
Throws:
EvaluationException

getContainmentMappings

public IRelation getContainmentMappings()
Description copied from interface: IQueryContainment

Return the containment mappings that result from the containment check.

Specified by:
getContainmentMappings in interface IQueryContainment
Returns:
a set of substitutions resulting from the query containment check.

getVariableBindings

public List<IVariable> getVariableBindings()
Description copied from interface: IQueryContainment
Return the variables from the query in 'execution' order.

Specified by:
getVariableBindings in interface IQueryContainment
Returns:
The variables in order.