@Override public T next() throws RepositoryException { return wrappedIter.next(); }
@Override public T next() { return iteration.next(); } };
public T next() throws RepositoryException { return wrappedIter.next(); }
@Override public E next() { return iteration.next(); }
@Override public E next() { return iteration.next(); }
@Override public E next() { return iteration.next(); }
/** * Returns the next element from the source type iteration. * * @throws X * @throws java.util.NoSuchElementException * If all elements have been returned. * @throws IllegalStateException * If the iteration has been closed. */ @Override public T next() throws X { if (isClosed()) { throw new NoSuchElementException("The iteration has been closed."); } return convert(iter.next()); }
/** * Returns the next element from the source type iteration. * * @throws X * @throws java.util.NoSuchElementException * If all elements have been returned. * @throws IllegalStateException * If the iteration has been closed. */ @Override public T next() throws X { if (isClosed()) { throw new NoSuchElementException("The iteration has been closed."); } return convert(iter.next()); }
/** * Calls the <tt>next</tt> method of the underlying iteration. */ @Override public E next() throws X { if (isClosed()) { throw new NoSuchElementException("Iteration has been closed"); } Iteration<? extends E, ? extends X> resultIter = iter; if (resultIter == null) { // Underlying iterator has not yet been initialized synchronized (this) { resultIter = iter; if (resultIter == null) { resultIter = iter = createIteration(); } } } return resultIter.next(); }
/** * Returns the next element from the source type iteration. * * @throws X * @throws java.util.NoSuchElementException * If all elements have been returned. * @throws IllegalStateException * If the iteration has been closed. */ @Override public T next() throws X { if (isClosed()) { throw new NoSuchElementException("The iteration has been closed."); } return convert(iter.next()); }
/** * Calls the <tt>next</tt> method of the underlying iteration. */ @Override public E next() throws X { if (isClosed()) { throw new NoSuchElementException("Iteration has been closed"); } Iteration<? extends E, ? extends X> resultIter = iter; if (resultIter == null) { // Underlying iterator has not yet been initialized synchronized (this) { resultIter = iter; if (resultIter == null) { resultIter = iter = createIteration(); } } } return resultIter.next(); }
private void visitInsert(Resource insert) throws RDF4JException { Iteration<? extends Resource, QueryEvaluationException> groupIter = TripleSources.listResources( insert, store); while (groupIter.hasNext()) { Resource r = groupIter.next(); Value type = TripleSources.singleValue(r, RDF.TYPE, store); visitPattern(r, (type != null) ? Collections.singleton((IRI)type) : Collections.<IRI> emptySet(), null); } }
private void visitDelete(Resource delete) throws RDF4JException { Iteration<? extends Resource, QueryEvaluationException> groupIter = TripleSources.listResources( delete, store); while (groupIter.hasNext()) { Resource r = groupIter.next(); Value type = TripleSources.singleValue(r, RDF.TYPE, store); visitPattern(r, (type != null) ? Collections.singleton((IRI)type) : Collections.<IRI> emptySet(), null); } }
public <E extends Exception> void remove( Iteration<? extends Statement, E> statements, Resource... contexts) throws RepositoryException, E { OpenRDFUtil.verifyContextNotNull(contexts); JSONArray rows = new JSONArray(); while (statements.hasNext()) { append(rows, encodeJSON(statements.next(), null, contexts)); } prepareHttpRepoClient().deleteJSON(rows); }
private Order visitOrderBy(Resource orderby) throws RDF4JException { Order order = new Order(); Iteration<? extends Resource, QueryEvaluationException> iter = TripleSources.listResources(orderby, store); while (iter.hasNext()) { Resource r = iter.next(); OrderElem orderElem = visitOrderByCondition(r); order.addElement(orderElem); } return order; }
public <E extends Exception> void add( Iteration<? extends Statement, E> statementIter, Resource... contexts) throws RepositoryException, E { OpenRDFUtil.verifyContextNotNull(contexts); JSONArray rows = new JSONArray(); while (statementIter.hasNext()) { append(rows, encodeJSON(statementIter.next(), null, contexts)); } try { prepareHttpRepoClient().uploadJSON(rows); } catch (AGHttpException e) { throw new RepositoryException(e); } }
public <E extends Exception> void add( Iteration<? extends Statement, E> statementIter, JSONObject attributes, Resource... contexts) throws RepositoryException, E { OpenRDFUtil.verifyContextNotNull(contexts); JSONArray rows = new JSONArray(); while (statementIter.hasNext()) { append(rows, encodeJSON(statementIter.next(), attributes, contexts)); } try { prepareHttpRepoClient().uploadJSON(rows); } catch (AGHttpException e) { throw new RepositoryException(e); } }
private Projection visitResultVariables(Resource resultVars, Map<String, ProjectionElem> previousProjElems) throws RDF4JException { ProjectionElemList projElemList = new ProjectionElemList(); Iteration<? extends Resource, QueryEvaluationException> iter = TripleSources.listResources( resultVars, store); while (iter.hasNext()) { Resource r = iter.next(); ProjectionElem projElem = visitResultVariable(r, previousProjElems); projElemList.addElement(projElem); } Projection proj = new Projection(); proj.setProjectionElemList(projElemList); tupleRoot = proj; return proj; }
private Projection visitResultNodes(Resource resultNodes) throws RDF4JException { ProjectionElemList projElemList = new ProjectionElemList(); Iteration<? extends Resource, QueryEvaluationException> iter = TripleSources.listResources( resultNodes, store); while (iter.hasNext()) { Resource r = iter.next(); ProjectionElem projElem = visitResultNode(r); projElemList.addElement(projElem); } Projection proj = new Projection(); proj.setProjectionElemList(projElemList); tupleRoot = new DescribeOperator(proj); return proj; }
private TupleExpr visitHaving(Resource having) throws RDF4JException { UnaryTupleOperator op = (UnaryTupleOperator)group.getParentNode(); op.setArg(new Extension(group)); Iteration<? extends Resource, QueryEvaluationException> iter = TripleSources.listResources(having, store); while (iter.hasNext()) { Resource r = iter.next(); ValueExpr havingExpr = visitExpression(r); Filter filter = new Filter(op.getArg(), havingExpr); op.setArg(filter); op = filter; } return op; }