Search in sources :

Example 1 with TableData

use of org.apache.jena.sparql.algebra.table.TableData in project jena by apache.

the class NodeTransformLib method transform.

public static Table transform(Table table, NodeTransform transform) {
    // Non-streaming rewrite 
    List<Var> vars = transformVars(transform, table.getVars());
    Iterator<Binding> iter = table.rows();
    List<Binding> newRows = new ArrayList<>();
    for (; iter.hasNext(); ) {
        Binding b = iter.next();
        Binding b2 = transform(b, transform);
        newRows.add(b2);
    }
    return new TableData(vars, newRows);
}
Also used : Binding(org.apache.jena.sparql.engine.binding.Binding) ArrayList(java.util.ArrayList) TableData(org.apache.jena.sparql.algebra.table.TableData)

Example 2 with TableData

use of org.apache.jena.sparql.algebra.table.TableData in project jena by apache.

the class Query method setValuesDataBlock.

public void setValuesDataBlock(List<Var> variables, List<Binding> values) {
    checkDataBlock(variables, values);
    valuesDataBlock = new TableData(variables, values);
}
Also used : TableData(org.apache.jena.sparql.algebra.table.TableData)

Aggregations

TableData (org.apache.jena.sparql.algebra.table.TableData)2 ArrayList (java.util.ArrayList)1 Binding (org.apache.jena.sparql.engine.binding.Binding)1