All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aksw.jenax.arq.aggregation.AccMap Maven / Gradle / Ivy

The newest version!
package org.aksw.jenax.arq.aggregation;

import java.util.Map;
import java.util.function.BiFunction;

import org.apache.jena.sparql.engine.binding.Binding;
import org.apache.jena.sparql.function.FunctionEnv;

public class AccMap
    extends AccMap2>
    implements Acc>
{
    public AccMap(BiFunction mapper, Agg subAgg) {
        super(mapper, subAgg);
    }
}

//public class AccMap
//    implements Acc>
//{
//    private BindingMapper mapper;
//    private Agg subAgg;
//
//    private Map> state = new HashMap<>();
//
//    public AccMap(BindingMapper mapper, Agg subAgg) {
//        this.mapper = mapper;
//        this.subAgg = subAgg;
//    }
//
//    @Override
//    public void accumulate(Binding binding) {
//        // TODO Keep track of the relative binding index
//        K k = mapper.map(binding,-1);
//        Acc subAcc = state.get(k);
//        if(subAcc == null) {
//            subAcc = subAgg.createAccumulator();
//            state.put(k, subAcc);
//        }
//        subAcc.accumulate(binding);
//    }
//
//    @Override
//    public Map getValue() {
//        Map result = new HashMap();
//
//        for(Entry> entry : state.entrySet()) {
//            K k = entry.getKey();
//            V v = entry.getValue().getValue();
//
//            result.put(k, v);
//        }
//
//        return result;
//    }
//
//}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy