@Override public GraphQuery prepare(ParsedGraphQuery graphQuery) { GraphQuery query = new SailConnectionGraphQuery(graphQuery, con, vf); query.setIncludeInferred(includeInferred); return query; }
@Override public GraphQuery prepare(ParsedGraphQuery graphQuery) { GraphQuery query = new SailGraphQuery(graphQuery, con); query.setIncludeInferred(includeInferred); return query; }
public void setIncludeInferred(boolean includeInferred) { delegate.setIncludeInferred(includeInferred); node.setIncludeInferred(includeInferred); }
public static GraphQuery getQuery(RepositoryConnection connection, GraphQueryModel graphQueryModel, boolean includeInferred) { try { QUERY_HOLDER.set(graphQueryModel); GraphQuery graphQuery = connection.prepareGraphQuery(DirectQuery.DIRECTQUERY, ""); graphQuery.setIncludeInferred(includeInferred); return graphQuery; } catch (StoreException e) { throw new RepositoryException(e); } catch (MalformedQueryException e) { throw new RepositoryException(e); } }
public static GraphQuery getQuery(RepositoryConnection connection, GraphQueryModel graphQueryModel, boolean includeInferred) { try { QUERY_HOLDER.set(graphQueryModel); GraphQuery graphQuery = connection.prepareGraphQuery(DirectQuery.DIRECTQUERY, ""); graphQuery.setIncludeInferred(includeInferred); return graphQuery; } catch (StoreException e) { throw new RepositoryException(e); } catch (MalformedQueryException e) { throw new RepositoryException(e); } }
public static GraphQuery getQuery(RepositoryConnection connection, ParsedGraphQuery graphQueryModel, boolean includeInferred) { try { QUERY_HOLDER.set(graphQueryModel); GraphQuery graphQuery = connection.prepareGraphQuery(DirectQuery.DIRECTQUERY, ""); graphQuery.setIncludeInferred(includeInferred); return graphQuery; } catch (MalformedQueryException e) { throw new RepositoryException(e); } catch (org.openrdf.repository.RepositoryException e) { throw new RepositoryException(e); } }
public GraphQueryResult evaluate() throws QueryEvaluationException { try { RepositoryConnection con = getConnection(); QueryLanguage ql = getQueryLanguage(); String query = getQuery(); String baseURI = getBaseURI(); GraphQuery qry = con.prepareGraphQuery(ql, query, baseURI); qry.setDataset(getDataset()); qry.setIncludeInferred(getIncludeInferred()); BindingSet bindings = getBindings(); for (String name : bindings.getBindingNames()) { qry.setBinding(name, bindings.getValue(name)); } return qry.evaluate(); } catch (MalformedQueryException e) { throw new QueryEvaluationException(e); } catch (RepositoryException e) { throw new QueryEvaluationException(e); } }
public void evaluate(RDFHandler handler) throws QueryEvaluationException, RDFHandlerException { try { RepositoryConnection con = getConnection(); QueryLanguage ql = getQueryLanguage(); String query = getQuery(); String baseURI = getBaseURI(); GraphQuery qry = con.prepareGraphQuery(ql, query, baseURI); qry.setDataset(getDataset()); qry.setIncludeInferred(getIncludeInferred()); BindingSet bindings = getBindings(); for (String name : bindings.getBindingNames()) { qry.setBinding(name, bindings.getValue(name)); } qry.evaluate(handler); } catch (MalformedQueryException e) { throw new QueryEvaluationException(e); } catch (RepositoryException e) { throw new QueryEvaluationException(e); } }
private RepositoryResult<Statement> getCachableStatements( CachableAugurNode node, Resource subj, Value obj, boolean includeInferred) throws RepositoryException { CloseableIteration<? extends Statement, QueryEvaluationException> stmts; stmts = node.getStatements(subj, obj); if (stmts == null) { try { ParsedGraphQuery parsedQuery = createGraphQuery(node); String queryString = formatter.formatGraphQuery(parsedQuery); GraphQuery graphQuery = super.prepareGraphQuery(QueryLanguage.SERQO, queryString, null); graphQuery.setIncludeInferred(node.isIncludeInferred()); GraphQueryResult results = graphQuery.evaluate(); Iteration<Statement, QueryEvaluationException> iter = results; AResource carried = (AResource)node.getCarriedOverResource(subj, obj); iter = new ConsumeStatementIterator<QueryEvaluationException>(iter, carried, node, getVersion()); return new RepositoryResult<Statement>(new RepositoryCloseableIteration<Statement>( new AStatementIterator<QueryEvaluationException>(iter, node))); } catch (MalformedQueryException e) { throw new RepositoryException(e); } catch (QueryEvaluationException e) { throw new RepositoryException(e); } } return new RepositoryResult<Statement>(new RepositoryCloseableIteration<Statement>(new AStatementIterator<QueryEvaluationException>( stmts, node))); }