コード例 #1
0
ファイル: aggregates.py プロジェクト: Dataliberate/rdflib
def agg_Max(a, group, bindings):
    m = None

    for x in group:
        try:
            v = numeric(_eval(a.vars, x))
            if m is None:
                m = v
            else:
                m = num_max(v, m)
        except:
            return  # error in aggregate => no binding

    if m is not None:
        bindings[a.res] = Literal(m)
コード例 #2
0
def agg_Max(a, group, bindings):
    m = None

    for x in group:
        try:
            v = numeric(_eval(a.vars, x))
            if m is None:
                m = v
            else:
                m = num_max(v, m)
        except:
            return  # error in aggregate => no binding

    if m is not None:
        bindings[a.res] = Literal(m)
コード例 #3
0
ファイル: aggregates.py プロジェクト: satra/rdflib
def agg_Max(a, group, bindings):
    m = None

    for v in _eval_rows(a.vars, group, None): # DISTINCT makes no difference for MAX
        try:
            v = numeric(v)
            if m is None:
                m = v
            else:
                m = num_max(v, m)
        except:
            return  # error in aggregate => no binding

    if m is not None:
        bindings[a.res] = Literal(m)