@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setReduced(true); } },
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setDistinct(true); } },
@Override public Set<IVariable<?>> getProjectedVars(final Set<IVariable<?>> vars) { final ProjectionNode tmp = getProjection(); if(tmp != null) { tmp.getProjectionVars(vars); } return vars; }
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setReduced(true); } },
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setDistinct(false); } },
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setReduced(false); } },
@Override public Set<IVariable<?>> getProjectedVars(final Set<IVariable<?>> vars) { final ProjectionNode tmp = getProjection(); if(tmp != null) { tmp.getProjectionVars(vars); } return vars; }
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setReduced(false); } },
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setDistinct(true); } },
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setDistinct(false); } },
/** * Report the "MUST" and "MAYBE" bound bindings projected by the query. This * reduces to reporting the projected variables. We do not need to analyze * the whereClause or projection any further in order to know what "might" * be projected. */ // MAYBE : QueryBase public Set<IVariable<?>> getMaybeProducedBindings(final QueryBase node) { final Set<IVariable<?>> vars = new LinkedHashSet<IVariable<?>>(); final ProjectionNode projection = node.getProjection(); if(projection == null) { // If there is no projection then there is nothing to report. return vars; } return projection.getProjectionVars(vars); }
/** * Report the "MUST" and "MAYBE" bound bindings projected by the query. This * reduces to reporting the projected variables. We do not need to analyze * the whereClause or projection any further in order to know what "might" * be projected. */ // MAYBE : QueryBase public Set<IVariable<?>> getMaybeProducedBindings(final QueryBase node) { final Set<IVariable<?>> vars = new LinkedHashSet<IVariable<?>>(); final ProjectionNode projection = node.getProjection(); if(projection == null) { // If there is no projection then there is nothing to report. return vars; } return projection.getProjectionVars(vars); }
/** * Return the set of variables on which the {@link ProjectionNode} for this * query depends (this is a NOP if there is no {@link ProjectionNode} for * the query, which can happen for an ASK query). This DOES NOT report the * variables which are projected OUT of the query, just those used by the * SELECT expressions. * * @param vars * The variables used by the select expressions are added to this * set. * * @return The caller's set. */ public Set<IVariable<?>> getSelectExprVars(final Set<IVariable<?>> vars) { final ProjectionNode tmp = getProjection(); if(tmp != null) { tmp.getSelectExprVars(vars); } return vars; }
/** * Return the set of variables on which the {@link ProjectionNode} for this * query depends (this is a NOP if there is no {@link ProjectionNode} for * the query, which can happen for an ASK query). This DOES NOT report the * variables which are projected OUT of the query, just those used by the * SELECT expressions. * * @param vars * The variables used by the select expressions are added to this * set. * * @return The caller's set. */ public Set<IVariable<?>> getSelectExprVars(final Set<IVariable<?>> vars) { final ProjectionNode tmp = getProjection(); if(tmp != null) { tmp.getSelectExprVars(vars); } return vars; }
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setReduced(true); } },
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setDistinct(true); } },
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setDistinct(false); } },
@Override public void apply(ASTBase rslt) { ((QueryBase) rslt).getProjection().setReduced(false); } },
/** * Return <code>true</code> if any of the {@link ProjectionNode}, * {@link GroupByNode}, or {@link HavingNode} indicate that this is an * aggregation query. * * @param query * The query. * * @return <code>true</code>if it is an aggregation query. */ public static boolean isAggregate(final QueryBase query) { return isAggregate(query.getProjection(), query.getGroupBy(), query.getHaving()); }
/** * Return <code>true</code> if any of the {@link ProjectionNode}, * {@link GroupByNode}, or {@link HavingNode} indicate that this is an * aggregation query. * * @param query * The query. * * @return <code>true</code>if it is an aggregation query. */ public static boolean isAggregate(final QueryBase query) { return isAggregate(query.getProjection(), query.getGroupBy(), query.getHaving()); }