IQLUtility
Keywords: uk.ac.bbk.dcs.automed.qproc.iql.IQLUtility class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.ac.bbk.dcs.automed.qproc.iql
Class IQLUtility

    java.lang.Object
      uk.ac.bbk.dcs.automed.qproc.iql.IQLUtility

    public class IQLUtility

extends java.lang.Object

Provides a number of static methods that simplify IQL expressions.

Author:
  Lucas Zamboulis

Field Summary
`protected static java.util.logging.Logger` | `logger`

Constructor Summary
`IQLUtility()`

Method Summary
`static float` | `getCompDistributionMetric(Cell root)`
`static Cell` | `getDefaultQuery(int rangeSemantics)`
`static java.util.Collection` | `getSchemes(Cell root, java.util.Collection col)`
`static boolean` | `processFlatmapRange(Cell c)` Performs in a top-down manner the following simplification:
`static boolean` | `processRangeArgs(Cell c)`
`static boolean` | `processRangeInGen(Cell c)` Performs in a top-down manner the following simplification:
`static boolean` | `processRangeRange(Cell c)` Performs in a bottom-up manner the following simplifications:
`static boolean` | `simplifyBasedOnEquijoins(Cell root)` Traverses query and replaces certain comprehensions with [].
`static boolean` | `simplifyBasedOnQualifiers(Cell c)` Performs in a bottom-up manner the following simplifications:
`static void` | `simplifyRange(Cell c)`
`static boolean` | `simplifyUnionIntersect(Cell c)` Simplifies the input query so that union Void Void returns Void and intersect Any Any returns Any

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### logger

    protected static java.util.logging.Logger logger

Constructor Detail

### IQLUtility

    public IQLUtility()

Method Detail

### simplifyRange

    public static void simplifyRange(Cell c)

### processRangeArgs

    public static boolean processRangeArgs(Cell c)

### processRangeRange

    public static boolean processRangeRange(Cell c)

  Performs in a bottom-up manner the following simplifications:

  - Range Void (Range e1 e2) = Range e1 e2
  - Range (Range e1 e2) Any = Range e1 e2

  Parameters:
    `c` - the root of the expression to be simplified
  Returns:
    true if a simplification occurred

### processFlatmapRange

    public static boolean processFlatmapRange(Cell c)

  Performs in a top-down manner the following simplification:

  - flatmap f (Range e1 e2) = Range (flatmap f e1) (flatmap f e2)

  Parameters:
    `c` - the root of the expression to be simplified
  Returns:
    true if a simplification occurred

### processRangeInGen

    public static boolean processRangeInGen(Cell c)

  Performs in a top-down manner the following simplification:

  - [h|Q;p<-(Range e1 e2);Q']=Range [h|Q;p<-e1;Q'] [h|Q;p<-e2;Q']

  Parameters:
    `c` - the root of the expression to be simplified
  Returns:
    true if a simplification occurred

### simplifyBasedOnQualifiers

    public static boolean simplifyBasedOnQualifiers(Cell c)

  Performs in a bottom-up manner the following simplifications:

  - [e|Q;p<-[];Q']=[]
  - [e|Q;p<-Void;Q']=Void
  - [e|Q;p<-Any;Q']=Any
  - [e|Q;False;Q']=[]

  Parameters:
    `c` - the root of the expression to be simplified
  Returns:
    true if a simplification occurred

### simplifyBasedOnEquijoins

    public static boolean simplifyBasedOnEquijoins(Cell root)
                                            throws IQLException

  Traverses query and replaces certain comprehensions with []. These comprehensions contain a join Traverse top-to-bottom - more efficient if top comprehension becomes [] right away.

  Parameters:
    `root` - root of the comprehension
  Returns:
    true if a simplification occurred
  Throws:
    `IQLException`

### getCompDistributionMetric

    public static float getCompDistributionMetric(Cell root)

  Parameters:
    `root` - the root of an IQL query
  Returns:
    the ratio a/b, where b is the number of schemes in the IQL query and a is the number of schemes in the query that the `uk.ac.bbk.dcs.automed.qproc.optimise.ComprehensionDistributor` would create - does NOT consider filters containing comprehensions (returns -1 if IQL query has no generators in the first place)

### getSchemes

    public static java.util.Collection getSchemes(Cell root,
                                                  java.util.Collection col)

### simplifyUnionIntersect

    public static boolean simplifyUnionIntersect(Cell c)

  Simplifies the input query so that union Void Void returns Void and intersect Any Any returns Any

  Parameters:
    `c` - the root of the input query

### getDefaultQuery

    public static Cell getDefaultQuery(int rangeSemantics)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD