You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For each **unaggregated variable** V in X
Replace V with Sample(V)
A possible fix could be as follows (in algebra.py):
in translateAggregates:
# collect/replace aggs in :
# select expr as ?var
if q.projection:
aggregated_vars = set(v.evar for v in q.projection if isinstance(v.expr, CompValue) and v.expr.name.startswith("Aggregate_"))
for v in q.projection:
if v.evar:
v.expr = traverse(v.expr, functools.partial(_sample, v=v.evar, s=aggregated_vars))
in _sample
# type error: Missing return statement
def _sample(e: typing.Union[CompValue, List[Expr], Expr, List[str], Variable], v: Optional[Variable] = None, s: Optional[set] = None) -> Optional[CompValue]: # type: ignore[return]
"""
For each unaggregated variable V in expr
Replace V with Sample(V)
"""
if isinstance(e, CompValue) and e.name.startswith("Aggregate_"):
return e # do not replace vars in aggregates
if isinstance(e, Variable) and v != e:
if s is None or e not in s:
return CompValue("Aggregate_Sample", vars=e)
The text was updated successfully, but these errors were encountered:
In the following code:
?c1 and ?c2 are wrapped in "Aggregate_Sample" operators, whereas they should not be : algorithm 18.2.4.1 (https://www.w3.org/TR/sparql11-query/#convertGroupAggSelectExpressions) states that
A possible fix could be as follows (in algebra.py):
The text was updated successfully, but these errors were encountered: