protected Op compileElementData(ElementData elt) { return OpTable.create(elt.getTable()) ; }
@Override public Op make(ItemList list) { Item t = Item.createList(list) ; Table table = BuilderTable.build(t) ; return OpTable.create(table) ; } } ;
private static Op processFilterWorker(Op op, List<Pair<Var, NodeValue>> inequalities) { // Firstly find all the possible values for each variable Map<Var, Set<NodeValue>> possibleValues = new HashMap<>(); for (Pair<Var, NodeValue> inequalityTest : inequalities) { if (!possibleValues.containsKey(inequalityTest.getLeft())) { possibleValues.put(inequalityTest.getLeft(), new HashSet<NodeValue>()); } possibleValues.get(inequalityTest.getLeft()).add(inequalityTest.getRight()); } // Then combine them into all possible rows to be eliminated Table table = buildTable(possibleValues); // Then apply the MINUS return OpMinus.create(op, OpTable.create(table)); }
@Override public Op transform(OpTable opTable) { // Always a new object return OpTable.create(opTable.getTable()) ; } };
@Override public void visit(OpTable opTable) { Table tbl = opTable.getTable(); boolean process = false; for (Var v : tbl.getVars()) { process = process | values.keySet().contains(v); } if (!process) { push(opTable); } else { TableN retTbl = new TableN(tbl.getVars()); Iterator<Binding> iter = tbl.rows(); while (iter.hasNext()) { retTbl.addBinding(rewrite(iter.next())); } push(OpTable.create(retTbl)); } }
@Override public void visit(OpTable opTable) { Table tbl = opTable.getTable(); boolean process = false; for (Var v : tbl.getVars()) { process = process | values.keySet().contains(v); } if (!process) { push(opTable); } else { TableN retTbl = new TableN(tbl.getVars()); Iterator<Binding> iter = tbl.rows(); while (iter.hasNext()) { retTbl.addBinding(rewrite(iter.next())); } push(OpTable.create(retTbl)); } }
@Override public Op transform(OpTable opTable) { if ( opTable.isJoinIdentity() ) return opTable; Table table = opTable.getTable(); if ( table.isEmpty() ) return opTable; if ( TableUnit.isTableUnit(table) ) return opTable; if ( table.getVars().size() == 0 ) return opTable; Table table2 = NodeTransformLib.transform(table, transform); return OpTable.create(table2); }
Op opTable = null; for (Table table : tables) { Op tmp = OpTable.create(table);
Op opTable = null; for (Table table : tables) { Op tmp = OpTable.create(table);
Collection<Table> tables = cacheResult.getTables(); for(Table table : tables) { OpTable opTable = OpTable.create(table);
Collection<Table> tables = cacheResult.getTables(); for(Table table : tables) { OpTable opTable = OpTable.create(table);
@Test public void table_01() { Table table = TableFactory.createEmpty(); Op opTable = OpTable.create(table); String x = str(opTable); assertEquals("(table empty)", x); }
@Test public void table_02() { Table table = TableFactory.create(); table.getVars().add(Var.alloc("a")); Op opTable = OpTable.create(table); String x = str(opTable); assertEquals("(table (vars ?a))", x); }
@Test public void testBuildTable_03() { Op expected = OpTable.create(TableFactory.create(Var.alloc("x"), NodeConst.nodeTrue)); Op actual = SSE.parseOp("(table (vars ?x) (row (?x true)))"); assertEquals(expected, actual); }
@Test public void table_03() { Table table = TableFactory.create(); Binding b = BindingFactory.binding(); table.addBinding(b); Op opTable = OpTable.create(table); String x = str(opTable); assertEquals("(table (vars) (row) )", x); }
for ( Binding binding : query.getValuesData() ) table.addBinding(binding) ; OpTable opTable = OpTable.create(table) ; op = OpJoin.create(op, opTable) ;