use of org.eclipse.rdf4j.repository.sail.SailQueryPreparer in project AJAN-service by aantakli.
the class SPARQLUtil method queryModel.
public static List<BindingSet> queryModel(final Model model, final ParsedTupleQuery query) throws QueryEvaluationException {
SailRepository repo = createRepository(model);
List<BindingSet> resultModel;
try (SailRepositoryConnection conn = repo.getConnection()) {
conn.begin();
SailQueryPreparer preparer = new SailQueryPreparer(conn, false);
TupleQueryResult results = preparer.prepare(query).evaluate();
resultModel = getBindingSetList(results);
conn.commit();
}
repo.shutDown();
return resultModel;
}
use of org.eclipse.rdf4j.repository.sail.SailQueryPreparer in project AJAN-service by aantakli.
the class SPARQLUtil method queryModel.
public static Model queryModel(final Model model, final ParsedGraphQuery query) throws QueryEvaluationException {
SailRepository repo = createRepository(model);
Model resultModel;
try (SailRepositoryConnection conn = repo.getConnection()) {
conn.begin();
SailQueryPreparer preparer = new SailQueryPreparer(conn, false);
GraphQueryResult results = preparer.prepare(query).evaluate();
resultModel = QueryResults.asModel(results);
conn.commit();
}
repo.shutDown();
return resultModel;
}
Aggregations