Interface IQueryMetaContext

All Known Implementing Classes:
AbstractQueryMetaContext

public interface IQueryMetaContext
Provides metamodel information (relationship of input keys) to query evaluator backends at runtime and at query planning time.
  • Method Details

    • isEnumerable

      boolean isEnumerable(IInputKey key)
      Returns true iff instance tuples of the given key can be enumerated.

      If false, the runtime can only test tuple membership in the extensional relation identified by the key, but not enumerate member tuples in general.

      Equivalent to IInputKey.isEnumerable().

    • isStateless

      boolean isStateless(IInputKey key)
      Returns true iff the set of instance tuples of the given key is immutable.

      If false, the runtime provides notifications upon change.

    • getWeakenedAlternatives

      Collection<InputKeyImplication> getWeakenedAlternatives(IInputKey implyingKey)
      Returns a set of implications (weakened alternatives), with a suggestion for the query planner that satisfying them first may help in satisfying the implying key.

      Note that for the obvious reasons, enumerable keys can only be implied by enumerable keys.

      Must follow directly or transitively from implications of getImplications(IInputKey).

      Since:
      1.6
    • getImplications

      Collection<InputKeyImplication> getImplications(IInputKey implyingKey)
      Returns known direct implications, e.g. edge supertypes, edge opposites, node type constraints, etc.

      Note that for the obvious reasons, enumerable keys can only be implied by enumerable keys.

    • getConditionalImplications

      Map<InputKeyImplication,Set<InputKeyImplication>> getConditionalImplications(IInputKey implyingKey)
      Returns known "double dispatch" implications, where the given implying key implies other input keys under certain additional conditions (themselves input keys). For example, a "type x, unscoped" input key may imply the "type x, in scope" input key under the condition of the input key "x is in scope"

      Note that for the obvious reasons, enumerable keys can only be implied by enumerable keys (either as the implying key or as the additional condition).

      Note that symmetry is not required, i.e. the additional conditions do not have to list the same conditional implication.

      Returns:
      multi-map, where the keys are additional conditions and the values are input key implications jointly implied by the condition and the given implying key.
      Since:
      2.0
    • getFunctionalDependencies

      Map<Set<Integer>,Set<Integer>> getFunctionalDependencies(IInputKey key)
      Returns functional dependencies of the input key expressed in terms of column indices.

      Each entry of the map is a functional dependency rule, where the entry key specifies source columns and the entry value specifies target columns.

    • getSuggestedEliminationOrdering

      Comparator<IInputKey> getSuggestedEliminationOrdering()
      For query normalizing, this is the order suggested for trying to eliminate input keys.
      Since:
      1.6
    • canLeadOutOfScope

      boolean canLeadOutOfScope(IInputKey key)
      Tells whether the given IInputKey is an edge and may lead out of scope.
      Since:
      1.6
    • isPosetKey

      boolean isPosetKey(IInputKey key)
      Returns true if the given IInputKey represents a poset type.
      Since:
      1.6
    • getPosetComparator

      IPosetComparator getPosetComparator(Iterable<IInputKey> keys)
      Returns an IPosetComparator for the given set of IInputKeys.
      Parameters:
      keys - an iterable collection of input keys
      Returns:
      the poset comparator
      Since:
      1.6