@Override public Iterator<Triple> execDescribeTriples() { for (QueryExecution qe : decoratees) { try { return qe.execDescribeTriples(); } catch (Exception e) { logger.warn(String.format("Query execution failed. Tried %s", qe), e); } } throw new QueryExecutionFallbackFailedException(); }
@Override public Iterator<Triple> execDescribeTriples() { beforeExec(); try { return decoratee.execDescribeTriples(); } catch(Exception e) { onException(e); // throw new RuntimeException(e); throw e; } finally { afterExec(); } }
public static void abortAfterFirstRow(QueryExecution qe) { Query query = qe.getQuery(); assert query != null : "QueryExecution did not tell us which query it is bound to - query was null"; int queryType = query.getQueryType(); try { switch (queryType) { case Query.QueryTypeAsk: qe.execAsk(); break; case Query.QueryTypeConstruct: Iterator<Triple> itC = qe.execConstructTriples(); itC.hasNext(); break; case Query.QueryTypeDescribe: Iterator<Triple> itD = qe.execDescribeTriples(); itD.hasNext(); break; case Query.QueryTypeSelect: ResultSet rs = qe.execSelect(); rs.hasNext(); break; default: throw new RuntimeException("Unknown query type - should not happen: queryType = " + queryType); } } finally { qe.abort(); } }
Iterator<Triple> it = qe.execDescribeTriples(); return wrapWriter(qe, writer, it);
break; case Query.QueryTypeDescribe: Iterator<Triple> itD = qe.execDescribeTriples(); result = Iterators.size(itD); break;
case ResultSet.TYPE_SCROLL_INSENSITIVE: this.currResults = new TripleListResults(this, qe, Iter.toList(this.connection.applyPostProcessors(qe .execDescribeTriples())), false); break; case ResultSet.TYPE_FORWARD_ONLY: default: this.currResults = new TripleIteratorResults(this, qe, this.connection.applyPostProcessors(qe .execDescribeTriples()), needsCommit); break;
case ResultSet.TYPE_SCROLL_INSENSITIVE: this.currResults = new TripleListResults(this, qe, Iter.toList(this.connection.applyPostProcessors(qe .execDescribeTriples())), false); break; case ResultSet.TYPE_FORWARD_ONLY: default: this.currResults = new TripleIteratorResults(this, qe, this.connection.applyPostProcessors(qe .execDescribeTriples()), needsCommit); break;
} else if (query.isDescribeType()) { if (streamMode) { Iterator<Triple> results = qe.execDescribeTriples(); streamResults(results); } else {