@Override public Map<String, String> getNamespaces() throws QueryEvaluationException { return unfiltered.getNamespaces(); } }
@Override public Map<String, String> getNamespaces() throws QueryEvaluationException { return unfiltered.getNamespaces(); } }
@Override public Map<String, String> getNamespaces() throws QueryEvaluationException { return unfiltered.getNamespaces(); } }
@Override public Map<String, String> getNamespaces() throws QueryEvaluationException { return result.getNamespaces(); }
@Override public void writeGraphQueryResult(GraphQueryResult queryResult) throws ExportException { try { writer.startRDF(); for (Map.Entry<String, String> me : queryResult.getNamespaces().entrySet()) { writer.handleNamespace(me.getKey(), me.getValue()); } while (queryResult.hasNext()) { writer.handleStatement(queryResult.next()); tick(); } writer.endRDF(); } catch (QueryEvaluationException | RDFHandlerException e) { throw new ExportException(e); } }
/** * Returns a {@link GraphQueryResult} that returns at most the specified maximum number of solutions, * starting at the supplied offset. * * @param queryResult * a query result possibly containing more solutions than the specified maximum. * @param limit * the maximum number of solutions to return. If set to 0 or lower, no limit will be applied. * @param offset * the number of solutions to skip at the beginning. If set to 0 or lower, no offset will be * applied. * @return A {@link GraphQueryResult} that will at return at most the specified maximum number of * solutions. If neither {@code limit} nor {@code offset} are applied, this returns the original * {@code queryResult}. */ public static GraphQueryResult limitResults(GraphQueryResult queryResult, long limit, long offset) { CloseableIteration<Statement, QueryEvaluationException> iter = queryResult; if (offset > 0) { iter = new OffsetIteration<>(iter, offset); } if (limit > 0) { iter = new LimitIteration<>(iter, limit); } if (!(iter instanceof GraphQueryResult)) { return new IteratingGraphQueryResult(queryResult.getNamespaces(), iter); } return (GraphQueryResult)iter; }
/** * Returns a {@link GraphQueryResult} that returns at most the specified maximum number of solutions, * starting at the supplied offset. * * @param queryResult * a query result possibly containing more solutions than the specified maximum. * @param limit * the maximum number of solutions to return. If set to 0 or lower, no limit will be applied. * @param offset * the number of solutions to skip at the beginning. If set to 0 or lower, no offset will be * applied. * @return A {@link GraphQueryResult} that will at return at most the specified maximum number of * solutions. If neither {@code limit} nor {@code offset} are applied, this returns the original * {@code queryResult}. */ public static GraphQueryResult limitResults(GraphQueryResult queryResult, long limit, long offset) { CloseableIteration<Statement, QueryEvaluationException> iter = queryResult; if (offset > 0) { iter = new OffsetIteration<>(iter, offset); } if (limit > 0) { iter = new LimitIteration<>(iter, limit); } if (!(iter instanceof GraphQueryResult)) { return new IteratingGraphQueryResult(queryResult.getNamespaces(), iter); } return (GraphQueryResult)iter; }
/** * Returns a {@link GraphQueryResult} that returns at most the specified maximum number of solutions, * starting at the supplied offset. * * @param queryResult * a query result possibly containing more solutions than the specified maximum. * @param limit * the maximum number of solutions to return. If set to 0 or lower, no limit will be applied. * @param offset * the number of solutions to skip at the beginning. If set to 0 or lower, no offset will be * applied. * @return A {@link GraphQueryResult} that will at return at most the specified maximum number of * solutions. If neither {@code limit} nor {@code offset} are applied, this returns the original * {@code queryResult}. */ public static GraphQueryResult limitResults(GraphQueryResult queryResult, long limit, long offset) { CloseableIteration<Statement, QueryEvaluationException> iter = queryResult; if (offset > 0) { iter = new OffsetIteration<>(iter, offset); } if (limit > 0) { iter = new LimitIteration<>(iter, limit); } if (!(iter instanceof GraphQueryResult)) { return new IteratingGraphQueryResult(queryResult.getNamespaces(), iter); } return (GraphQueryResult)iter; }
rdfHandler.startRDF(); for (Map.Entry<String, String> entry : gqr.getNamespaces().entrySet()) { String prefix = entry.getKey(); String namespace = entry.getValue();
rdfHandler.startRDF(); for (Map.Entry<String, String> entry : gqr.getNamespaces().entrySet()) { String prefix = entry.getKey(); String namespace = entry.getValue();
rdfHandler.startRDF(); for (Map.Entry<String, String> entry : gqr.getNamespaces().entrySet()) { String prefix = entry.getKey(); String namespace = entry.getValue();
@Override public Model execConstruct(Model m) { GraphQueryResult result = getConstructResult(); if (m == null) { m = ModelFactory.createDefaultModel(); } try { m.setNsPrefixes(result.getNamespaces()); while (result.hasNext()) { m.add(model.asStatement(AGNodeFactory.asTriple(result.next()))); } } catch (QueryEvaluationException e) { throw new QueryException(e); } return m; }