Java Code Examples for org.eclipse.rdf4j.query.TupleQuery#setMaxExecutionTime()

The following examples show how to use org.eclipse.rdf4j.query.TupleQuery#setMaxExecutionTime() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AccumuloRyaSailFactoryLoadFilesIT.java    From rya with Apache License 2.0 5 votes vote down vote up
private static int performTupleQuery(final String query, final RepositoryConnection conn) throws RepositoryException, MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException {
    final TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, query);
    tupleQuery.setMaxExecutionTime(10);
    final CountingResultHandler handler = new CountingResultHandler();
    tupleQuery.evaluate(handler);
    return handler.getCount();
}
 
Example 2
Source File: MongoDbRyaSailFactoryLoadFilesIT.java    From rya with Apache License 2.0 5 votes vote down vote up
private static int performTupleQuery(final String query, final RepositoryConnection conn) throws RepositoryException, MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException {
    final TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, query);
    tupleQuery.setMaxExecutionTime(10);
    final CountingResultHandler handler = new CountingResultHandler();
    tupleQuery.evaluate(handler);
    return handler.getCount();
}