/** * 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>(); }
@Override public CloseableIteration<? extends Statement, QueryEvaluationException> getStatements( Resource subj, IRI pred, Value obj, Resource... contexts) throws QueryEvaluationException { if (funcInstance.equals(subj)) { if (pred != null) { Value v = argValues.get(pred); if (v != null && (obj == null || v.equals(obj))) { return new SingletonIteration<Statement, QueryEvaluationException>( vf.createStatement(subj, pred, v)); } } return new EmptyIteration<Statement, QueryEvaluationException>(); } else { return qpTripleSource.getStatements(subj, pred, obj, contexts); } }
@Override public CloseableIteration<? extends Statement, QueryEvaluationException> getStatements( Resource subj, IRI pred, Value obj, Resource... contexts) throws QueryEvaluationException { if (funcInstance.equals(subj)) { if (pred != null) { Value v = argValues.get(pred); if (v != null && (obj == null || v.equals(obj))) { return new SingletonIteration<Statement, QueryEvaluationException>( vf.createStatement(subj, pred, v)); } } return new EmptyIteration<Statement, QueryEvaluationException>(); } else { return qpTripleSource.getStatements(subj, pred, obj, contexts); } }
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>(); }
/** * This method pairs each {@link BindingSet} in the specified collection * with the StatementPattern constraints and issues a query to Rya using the * {@link RyaQueryEngine}. */ @Override public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Collection<BindingSet> bindingset) throws QueryEvaluationException { if (bindingset.size() == 0) { return new EmptyIteration<>(); } queryEngine = RyaQueryEngineFactory.getQueryEngine(conf); Set<Map.Entry<RyaStatement, BindingSet>> statements = new HashSet<>(); Iterator<BindingSet> iter = bindingset.iterator(); while (iter.hasNext()) { BindingSet bs = iter.next(); statements.add(new RdfCloudTripleStoreUtils.CustomEntry<RyaStatement, BindingSet>( getRyaStatementFromBindings(bs), bs)); } final CloseableIteration<? extends Entry<RyaStatement, BindingSet>, RyaDAOException> iteration; try { iteration = queryEngine.queryWithBindingSet(statements, conf); } catch (RyaDAOException e) { throw new RuntimeException(e); } return new PropertyFilterAndBindingSetJoinIteration(iteration, properties, statement); }
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; }