User Tools

Site Tools


magik-demo:developer:class:core:querygeneralization

Query Generalization

public class QueryGeneralization

This class is used for calculate the generalized version of a query.

Class Attributes

public static long executionTime

Class Constructor

No constructor for this class

Class Methods

getQueryGeneralization

public static Query getQueryGeneralization (Query query, 
                                            java.util.ArrayList<TCStatement> tcStatements, 
                                            Schema schema) 
                                     throws DLVInvocationException, 
                                            IOException, 
                                            CycleException, 
                                            PrimaryKeyViolationException

Method used for calling the Query Generalization algorithm (that is a private method).

Called by:

  • it.unibz.inf.magik.core.TCQCReasoner
  • it.unibz.inf.magik.test.TestQueryGeneralization

Parameters:

  • Query - query that we want to find its generalized version
  • tcStatements - which data are complete, expressed in TC-statements
  • schema - database schema (that contains finite domain constraints and foreign keys)

Returns:

  • specialized query founded

Throws:

  • DLVInvocationException
  • IOException
  • CycleException
  • PrimaryKeyViolationException

getQueryGeneralizationWithoutUnfolding

private static Query getQueryGeneralizationWithoutUnfolding (Query query, 
                                                             java.util.ArrayList<TCStatement> tcStatements, 
                                                             Schema schema) 
                                                      throws DLVInvocationException, 
                                                             IOException, 
                                                             CycleException, 
                                                             PrimaryKeyViolationException

This method executes the generalization algorithm for queries that has no finite domain constraints selected in the schema related to the query.

Parameters:

  • Query - query that we want to find its generalized version
  • tcStatements - which data are complete, expressed in TC-statements
  • schema - database schema (that contains finite domain constraints and foreign keys)

Returns:

  • specialized query founded

Throws:

  • DLVInvocationException
  • IOException
  • CycleException
  • PrimaryKeyViolationException

getQueryGeneralizationWithUnfolding

public static Query getQueryGeneralizationWithUnfolding (Query query, 
                                            java.util.ArrayList<TCStatement> tcStatements, 
                                            Schema schema) 
                                     throws DLVInvocationException, 
                                            IOException, 
                                            CycleException, 
                                            PrimaryKeyViolationException

This method executes the generalization algorithm for queries that has finite domain selected in the schema related to the query.

Parameters:

  • Query - query that we want to find its generalized version
  • tcStatements - which data are complete, expressed in TC-statements
  • schema - database schema (that contains finite domain constraints and foreign keys)

Returns:

  • specialized query founded

Throws:

  • DLVInvocationException
  • IOException
  • CycleException
  • PrimaryKeyViolationException

getCompleteAtoms

private static java.util.ArrayList<Atom> getCompleteAtoms (java.util.ArrayList<Atom> currentQueryAtoms, 
                                                           java.util.ArrayList<Model> counterModels, 
                                                           Schema schema)

This method is used to investigate if each atom of the query is in all the counter models, because if it is not, it has to be removed from the query atoms.

Parameters:

  • currentQueryAtoms - list of all the atoms that are inside the query
  • counterModels - all the counter models found for the current query
  • schema - database schema

Returns:

  • list of atoms that are in all the counter models

Back to Top | Back to Home Page

magik-demo/developer/class/core/querygeneralization.txt · Last modified: 2017/07/06 15:24 (external edit)