/** * Creates a new UnionIteration that returns the bag union of the results of a number of Iterations. * * @param args * The Iterations containing the elements to iterate over. */ public UnionIteration(Iterable<? extends Iteration<? extends E, X>> args) { argIter = args.iterator(); // Initialize with empty iteration currentIter = new EmptyIteration<E, X>(); }
/** * Creates a new UnionIteration that returns the bag union of the results of a number of Iterations. * * @param args * The Iterations containing the elements to iterate over. */ public UnionIteration(Iterable<? extends Iteration<? extends E, X>> args) { argIter = args.iterator(); // Initialize with empty iteration currentIter = new EmptyIteration<E, X>(); }
/** * Creates a new UnionIteration that returns the bag union of the results of a number of Iterations. * * @param args * The Iterations containing the elements to iterate over. */ public UnionIteration(Iterable<? extends Iteration<? extends E, X>> args) { argIter = args.iterator(); // Initialize with empty iteration currentIter = new EmptyIteration<>(); }
public RepositoryResult<Namespace> getNamespaces() throws RepositoryException { return new RepositoryResult<Namespace>(new EmptyIteration<Namespace, RepositoryException>()); }
public RepositoryResult<Namespace> getNamespaces() throws RepositoryException { return new RepositoryResult<Namespace>(new EmptyIteration<Namespace, RepositoryException>()); }
@Override public RepositoryResult<Namespace> getNamespaces() throws RepositoryException { return new RepositoryResult<>(new EmptyIteration<>()); }
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(EmptySet emptySet, BindingSet bindings) throws QueryEvaluationException { return new EmptyIteration<BindingSet, QueryEvaluationException>(); }
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(EmptySet emptySet, BindingSet bindings) throws QueryEvaluationException { return new EmptyIteration<BindingSet, QueryEvaluationException>(); }
@Override protected CloseableIteration<BindingSet, QueryEvaluationException> evaluateInternal(EvaluationStrategy strategy, TupleExpr tupleExpr) { print("Optimized query:", tupleExpr); return new EmptyIteration<>(); } private void print(String msg, TupleExpr expr) {
public JoinIterator(EvaluationStrategy strategy, Join join, BindingSet bindings) throws QueryEvaluationException { this.strategy = strategy; this.join = join; leftIter = strategy.evaluate(join.getLeftArg(), bindings); // Initialize with empty iteration so that var is never null rightIter = new EmptyIteration<BindingSet, QueryEvaluationException>(); }
public JoinIterator(EvaluationStrategy strategy, Join join, BindingSet bindings) throws QueryEvaluationException { this.strategy = strategy; this.join = join; leftIter = strategy.evaluate(join.getLeftArg(), bindings); // Initialize with empty iteration so that var is never null rightIter = new EmptyIteration<BindingSet, QueryEvaluationException>(); }
public LeftJoinIterator(EvaluationStrategy strategy, LeftJoin join, BindingSet bindings) throws QueryEvaluationException { this.strategy = strategy; this.join = join; this.scopeBindingNames = join.getBindingNames(); leftIter = strategy.evaluate(join.getLeftArg(), bindings); // Initialize with empty iteration so that var is never null rightIter = new EmptyIteration<BindingSet, QueryEvaluationException>(); }
public LeftJoinIterator(EvaluationStrategy strategy, LeftJoin join, BindingSet bindings) throws QueryEvaluationException { this.strategy = strategy; this.join = join; this.scopeBindingNames = join.getBindingNames(); leftIter = strategy.evaluate(join.getLeftArg(), bindings); // Initialize with empty iteration so that var is never null rightIter = new EmptyIteration<BindingSet, QueryEvaluationException>(); }
private RepositoryResult<Statement> getStatementsSingleTriple(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException { if (hasStatement(subj, pred, obj, includeInferred, contexts)) { Statement st = getValueFactory().createStatement(subj, pred, obj); CloseableIteration<Statement, RepositoryException> cursor; cursor = new SingletonIteration<Statement, RepositoryException>(st); return new RepositoryResult<Statement>(cursor); } else { return new RepositoryResult<Statement>(new EmptyIteration<Statement, RepositoryException>()); } }
private RepositoryResult<Statement> getStatementsSingleTriple(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException { if (hasStatement(subj, pred, obj, includeInferred, contexts)) { Statement st = getValueFactory().createStatement(subj, pred, obj); CloseableIteration<Statement, RepositoryException> cursor; cursor = new SingletonIteration<Statement, RepositoryException>(st); return new RepositoryResult<Statement>(cursor); } else { return new RepositoryResult<Statement>(new EmptyIteration<Statement, RepositoryException>()); } }
private RepositoryResult<Statement> getStatementsSingleTriple(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException { if (hasStatement(subj, pred, obj, includeInferred, contexts)) { Statement st = getValueFactory().createStatement(subj, pred, obj); CloseableIteration<Statement, RepositoryException> cursor; cursor = new SingletonIteration<>(st); return new RepositoryResult<>(cursor); } else { return new RepositoryResult<>(new EmptyIteration<>()); } }
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Extension extension, BindingSet bindings) throws QueryEvaluationException { CloseableIteration<BindingSet, QueryEvaluationException> result; try { result = this.evaluate(extension.getArg(), bindings); } catch (ValueExprEvaluationException e) { // a type error in an extension argument should be silently ignored // and // result in zero bindings. result = new EmptyIteration<BindingSet, QueryEvaluationException>(); } result = new ExtensionIterator(extension, result, this); return result; }
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Extension extension, BindingSet bindings) throws QueryEvaluationException { CloseableIteration<BindingSet, QueryEvaluationException> result; try { result = this.evaluate(extension.getArg(), bindings); } catch (ValueExprEvaluationException e) { // a type error in an extension argument should be silently ignored // and // result in zero bindings. result = new EmptyIteration<BindingSet, QueryEvaluationException>(); } result = new ExtensionIterator(extension, result, this); return result; }
private CloseableIteration<BindingSet, QueryEvaluationException> createNextIteration(Value subject, Value object) throws QueryEvaluationException { if (subject == null && object == null) { return new EmptyIteration<BindingSet, QueryEvaluationException>(); } Var subjVar = new Var(VARNAME_SUBJECT, subject); Var predVar = new Var(VARNAME_PREDICATE); Var objVar = new Var(VARNAME_OBJECT, object); StatementPattern pattern = new StatementPattern(subjVar, predVar, objVar); return strategy.evaluate(pattern, parentBindings); }
private CloseableIteration<BindingSet, QueryEvaluationException> createNextIteration(Value subject, Value object) throws QueryEvaluationException { if (subject == null && object == null) { return new EmptyIteration<BindingSet, QueryEvaluationException>(); } Var subjVar = new Var(VARNAME_SUBJECT, subject); Var predVar = new Var(VARNAME_PREDICATE); Var objVar = new Var(VARNAME_OBJECT, object); StatementPattern pattern = new StatementPattern(subjVar, predVar, objVar); return strategy.evaluate(pattern, parentBindings); }