This is an old revision of the document!
====== Query Specialization ====== This class is used for calculate the specializations of a given query. ===== Class Attributes ===== <code java> public static long executionTime; public static boolean PROLOG_SELECTION; public static String prolog_encoding; public static String queryForProlog; public static String metaProlog; public static String commandQuery; public static String encodingGUI; </code> ===== Class Constructor ===== No constructor for this class ===== Class Methods ===== ==== getQuerySpecializations ==== <code java> public static Query getQueryGeneralizations (Query query, java.util.ArrayList<TCStatement> currentTCs, Schema currentSchema, int maximal) throws Exception </code> Main method of this class, that given an incomplete query computes complete query specializations of that query given that currentTCs are true and schema constraints from currentSchema holds. Based on the constant PROLOG_SELECTION, Magik runs two different prolog engines. //Called by:// * it.unibz.inf.magik.core.TCQCReasoner * it.unibz.inf.magik.test.TestQuerySpecialization **Parameters:** * Query - query that we want to find their specialization versions * currentTCs - which data are complete, expressed in TC-statements * currentSchema - database schema (that contains finite domain constraints and foreign keys) * maximal - maximal number of atoms that Magik can add for calculating specialization queries **Returns:** * Returned specialization are maximal (in query containment sense) **Throws:** * Exception ---- ==== getQuerySpecializationsSWI ==== <code java> public static Query getQueryGeneralizationsSWI (Query query, java.util.ArrayList<TCStatement> currentTCs, Schema currentSchema, int maximal) throws Exception </code> Method that manage the query specializations algorithm for SWI Prolog **Parameters:** * Query - query that we want to find their specialization versions * currentTCs - which data are complete, expressed in TC-statements * currentSchema - database schema (that contains finite domain constraints and foreign keys) * maximal - maximal number of atoms that Magik can add for calculating specialization queries **Returns:** * Returned specialization are maximal (in query containment sense) **Throws:** * Exception ---- ==== getQuerySpecializationsTuProlog ==== <code java> public static Query getQueryGeneralizationsTuProlog (Query query, java.util.ArrayList<TCStatement> currentTCs, Schema currentSchema, int maximal) throws Exception </code> Method that manage the query specializations algorithm for Tu Prolog **Parameters:** * Query - query that we want to find their specialization versions * currentTCs - which data are complete, expressed in TC-statements * currentSchema - database schema (that contains finite domain constraints and foreign keys) * maximal - maximal number of atoms that Magik can add for calculating specialization queries **Returns:** * Returned specialization are maximal (in query containment sense) **Throws:** * Exception ----