private <E extends Exception> ImmutableTupleQueryResult (final Collection<String> bindingNames, final Iteration<? extends BindingSet, E> iteration) throws E { this.bindingNames.addAll(bindingNames); Iterations.addAll(iteration, this.bindingSets); // this also closes iteration }
public <E extends Exception> MutableTupleQueryResult(Collection<String> bindingNames, Iteration<? extends BindingSet, E> bindingSetIter) throws E { this.bindingNames.addAll(bindingNames); Iterations.addAll(bindingSetIter, this.bindingSets); }
public <E extends Exception> MutableTupleQueryResult(Collection<String> bindingNames, Iteration<? extends BindingSet, E> bindingSetIter) throws E { this.bindingNames.addAll(bindingNames); Iterations.addAll(bindingSetIter, this.bindingSets); }
public <E extends Exception> MutableTupleQueryResult(Collection<String> bindingNames, Iteration<? extends BindingSet, E> bindingSetIter) throws E { this.bindingNames.addAll(bindingNames); Iterations.addAll(bindingSetIter, this.bindingSets); }
/** * Get a Set containing all elements obtained from the specified Iteration. * * @param iter * the Iteration to get the elements from * @return a Set containing all elements obtained from the specified Iteration. */ public static <E, X extends Exception> Set<E> asSet(Iteration<? extends E, X> iter) throws X { Set<E> result = new HashSet<E>(); addAll(iter, result); return result; }
/** * Get a Set containing all elements obtained from the specified Iteration. * * @param iter * the Iteration to get the elements from * @return a Set containing all elements obtained from the specified Iteration. */ public static <E, X extends Exception> Set<E> asSet(Iteration<? extends E, X> iter) throws X { Set<E> result = new HashSet<E>(); addAll(iter, result); return result; }
/** * Get a List containing all elements obtained from the specified Iteration. * * @param iter * the Iteration to get the elements from * @return a List containing all elements obtained from the specified Iteration. */ public static <E, X extends Exception> List<E> asList(Iteration<? extends E, X> iter) throws X { List<E> result = new ArrayList<E>(); addAll(iter, result); return result; }
/** * Get a List containing all elements obtained from the specified Iteration. * * @param iter * the Iteration to get the elements from * @return a List containing all elements obtained from the specified Iteration. */ public static <E, X extends Exception> List<E> asList(Iteration<? extends E, X> iter) throws X { List<E> result = new ArrayList<E>(); addAll(iter, result); return result; }
private Collection<IRI> getClasses(Resource subj) throws QueryEvaluationException { List<IRI> classes = new LinkedList<IRI>(); CloseableIteration<? extends IRI, QueryEvaluationException> classIter = TripleSources.getObjectURIs( subj, RDF.TYPE, tripleSource); Iterations.addAll(classIter, classes); return classes; }
protected Set<BindingSet> makeSet(Iteration<BindingSet, X> rightArg2) throws X { return Iterations.addAll(rightArg, makeSet()); }
protected Set<BindingSet> makeSet(Iteration<BindingSet, X> rightArg2) throws X { return Iterations.addAll(rightArg, makeSet()); }
private List<Resource> getConstraintsForClass(Resource cls) throws QueryEvaluationException { List<Resource> constraints = new ArrayList<Resource>(2); CloseableIteration<? extends Resource, QueryEvaluationException> constraintIter = TripleSources.getObjectResources( cls, SPIN.CONSTRAINT_PROPERTY, tripleSource); Iterations.addAll(constraintIter, constraints); return constraints; }
private List<Resource> getConstraintsForClass(Resource cls) throws QueryEvaluationException { List<Resource> constraints = new ArrayList<Resource>(2); CloseableIteration<? extends Resource, QueryEvaluationException> constraintIter = TripleSources.getObjectResources( cls, SPIN.CONSTRAINT_PROPERTY, tripleSource); Iterations.addAll(constraintIter, constraints); return constraints; }
public Set<E> addSecondSet(Iteration<? extends E, ? extends X> arg2, Set<E> set) throws X { return Iterations.addAll(arg2, makeSet()); }
private List<Resource> getConstructorsForClass(IRI cls) throws RDF4JException { List<Resource> constructors = new ArrayList<Resource>(2); CloseableIteration<? extends Resource, QueryEvaluationException> constructorIter = TripleSources.getObjectResources( cls, SPIN.CONSTRUCTOR_PROPERTY, tripleSource); Iterations.addAll(constructorIter, constructors); return constructors; }
public Set<E> addSecondSet(Iteration<? extends E, ? extends X> arg2, Set<E> set) throws X { return Iterations.addAll(arg2, makeSet()); }
private Collection<IRI> getClasses(Resource subj) throws QueryEvaluationException { List<IRI> classes = new LinkedList<IRI>(); CloseableIteration<? extends IRI, QueryEvaluationException> classIter = TripleSources.getObjectURIs( subj, RDF.TYPE, tripleSource); Iterations.addAll(classIter, classes); return classes; }
private List<Resource> getConstructorsForClass(IRI cls) throws RDF4JException { List<Resource> constructors = new ArrayList<Resource>(2); CloseableIteration<? extends Resource, QueryEvaluationException> constructorIter = TripleSources.getObjectResources( cls, SPIN.CONSTRUCTOR_PROPERTY, tripleSource); Iterations.addAll(constructorIter, constructors); return constructors; }
public Set<E> addSecondSet(Iteration<? extends E, ? extends X> arg2, Set<E> set) throws X { return Iterations.addAll(arg2, makeSet()); }
@Test public void testRemoveStatementCollection() throws Exception { testCon.setAutoCommit(false); testCon.add(alice, name, nameAlice); testCon.add(bob, name, nameBob); testCon.setAutoCommit(true); assertTrue(testCon.hasStatement(bob, name, nameBob, false)); assertTrue(testCon.hasStatement(alice, name, nameAlice, false)); Collection<Statement> c = Iterations.addAll(testCon.getStatements(null, null, null, false), new ArrayList<Statement>()); testCon.remove(c); assertFalse(testCon.hasStatement(bob, name, nameBob, false)); assertFalse(testCon.hasStatement(alice, name, nameAlice, false)); }