/** * @param inputBindings * @throws QueryEvaluationException */ public BatchingServiceIteration( CloseableIteration<BindingSet, QueryEvaluationException> inputBindings, int blockSize, Service service) throws QueryEvaluationException { super(inputBindings, null, EmptyBindingSet.getInstance()); this.blockSize = blockSize; this.service = service; run(); }
if (EMPTY_BINDING_SET.equals(bindingSet)) { currentWork = null; continue;
@Test public void testNoVariableSP() throws Exception { // Insert data insert(OWL.THING, RDF.TYPE, OWL.CLASS); insert(FOAF.PERSON, RDF.TYPE, OWL.CLASS, 1); insert(FOAF.PERSON, RDFS.SUBCLASSOF, OWL.THING); insert(VF.createIRI("urn:Alice"), RDF.TYPE, FOAF.PERSON); dao.flush(); // Define query and expected results final String query = "SELECT * WHERE {\n" + " owl:Thing a owl:Class .\n" + "}"; final Multiset<BindingSet> expectedSolutions = HashMultiset.create(); expectedSolutions.add(new EmptyBindingSet()); // Execute pipeline and verify results final QueryRoot queryTree = new QueryRoot(PARSER.parseQuery(query, null).getTupleExpr()); final SparqlToPipelineTransformVisitor visitor = new SparqlToPipelineTransformVisitor(getRyaCollection()); queryTree.visit(visitor); Assert.assertTrue(queryTree.getArg() instanceof Projection); final Projection projection = (Projection) queryTree.getArg(); Assert.assertTrue(projection.getArg() instanceof AggregationPipelineQueryNode); final AggregationPipelineQueryNode pipelineNode = (AggregationPipelineQueryNode) projection.getArg(); final Multiset<BindingSet> solutions = HashMultiset.create(); final CloseableIteration<BindingSet, QueryEvaluationException> iter = pipelineNode.evaluate(new QueryBindingSet()); while (iter.hasNext()) { solutions.add(iter.next()); } Assert.assertEquals(expectedSolutions, solutions); }
protected CloseableIteration<BindingSet, QueryEvaluationException> evaluateInternal(EvaluationStrategy strategy, TupleExpr tupleExpr) { return strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance()); }
/** * @param inputBindings * @throws QueryEvaluationException */ public BatchingServiceIteration( CloseableIteration<BindingSet, QueryEvaluationException> inputBindings, int blockSize, Service service) throws QueryEvaluationException { super(inputBindings, null, EmptyBindingSet.getInstance()); this.blockSize = blockSize; this.service = service; run(); }
/** * @param inputBindings * @throws QueryEvaluationException */ public BatchingServiceIteration( CloseableIteration<BindingSet, QueryEvaluationException> inputBindings, int blockSize, Service service) throws QueryEvaluationException { super(inputBindings, null, EmptyBindingSet.getInstance()); this.blockSize = blockSize; this.service = service; run(); }
public UpdateContext(UpdateExpr updateExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) { assert updateExpr != null; this.updateExpr = updateExpr; if (dataset == null) { this.dataset = new SimpleDataset(); } else { this.dataset = dataset; } if (bindings == null) { this.bindings = EmptyBindingSet.getInstance(); } else { this.bindings = bindings; } this.includeInferred = includeInferred; }
public UpdateContext(UpdateExpr updateExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) { assert updateExpr != null; this.updateExpr = updateExpr; if (dataset == null) { this.dataset = new SimpleDataset(); } else { this.dataset = dataset; } if (bindings == null) { this.bindings = EmptyBindingSet.getInstance(); } else { this.bindings = bindings; } this.includeInferred = includeInferred; }
@Override protected void meetUnaryValueOperator(UnaryValueOperator unaryValueOp) { super.meetUnaryValueOperator(unaryValueOp); if (isConstant(unaryValueOp.getArg())) { try { Value value = strategy.evaluate(unaryValueOp, EmptyBindingSet.getInstance()); unaryValueOp.replaceWith(new ValueConstant(value)); } catch (ValueExprEvaluationException e) { // TODO: incompatible values types(?), remove the affected part // of the query tree logger.debug("Failed to evaluate UnaryValueOperator with a constant argument", e); } catch (QueryEvaluationException e) { logger.error("Query evaluation exception caught", e); } } }
@Override protected void meetUnaryValueOperator(UnaryValueOperator unaryValueOp) { super.meetUnaryValueOperator(unaryValueOp); if (isConstant(unaryValueOp.getArg())) { try { Value value = strategy.evaluate(unaryValueOp, EmptyBindingSet.getInstance()); unaryValueOp.replaceWith(new ValueConstant(value)); } catch (ValueExprEvaluationException e) { // TODO: incompatible values types(?), remove the affected part // of the query tree logger.debug("Failed to evaluate UnaryValueOperator with a constant argument", e); } catch (QueryEvaluationException e) { logger.error("Query evaluation exception caught", e); } } }
handler.handleSolution(EmptyBindingSet.getInstance());
entry.addSolution(EmptyBindingSet.getInstance()); entries.put(new Key(EmptyBindingSet.getInstance()), entry);
entry.addSolution(EmptyBindingSet.getInstance()); entries.put(new Key(EmptyBindingSet.getInstance()), entry);
Value value = strategy.evaluate(functionCall, EmptyBindingSet.getInstance()); functionCall.replaceWith(new ValueConstant(value));
Value value = strategy.evaluate(functionCall, EmptyBindingSet.getInstance()); functionCall.replaceWith(new ValueConstant(value));
handler.handleSolution(EmptyBindingSet.getInstance());
handler.handleSolution(EmptyBindingSet.getInstance());
@Override protected void meetBinaryValueOperator(BinaryValueOperator binaryValueOp) { super.meetBinaryValueOperator(binaryValueOp); if (isConstant(binaryValueOp.getLeftArg()) && isConstant(binaryValueOp.getRightArg())) { try { Value value = strategy.evaluate(binaryValueOp, EmptyBindingSet.getInstance()); binaryValueOp.replaceWith(new ValueConstant(value)); } catch (ValueExprEvaluationException e) { // TODO: incompatible values types(?), remove the affected part // of the query tree logger.debug("Failed to evaluate BinaryValueOperator with two constant arguments", e); } catch (QueryEvaluationException e) { logger.error("Query evaluation exception caught", e); } } }
@Override protected void meetBinaryValueOperator(BinaryValueOperator binaryValueOp) { super.meetBinaryValueOperator(binaryValueOp); if (isConstant(binaryValueOp.getLeftArg()) && isConstant(binaryValueOp.getRightArg())) { try { Value value = strategy.evaluate(binaryValueOp, EmptyBindingSet.getInstance()); binaryValueOp.replaceWith(new ValueConstant(value)); } catch (ValueExprEvaluationException e) { // TODO: incompatible values types(?), remove the affected part // of the query tree logger.debug("Failed to evaluate BinaryValueOperator with two constant arguments", e); } catch (QueryEvaluationException e) { logger.error("Query evaluation exception caught", e); } } }
EmptyBindingSet.getInstance()).iterator(); return EmptyBindingSet.getInstance();