@Override public List<String> getSignature() throws OWLException { try { return res.getSignature(); } catch (Exception e) { throw new OntopOWLException(e); } }
@Override public TupleQueryResult evaluate() throws QueryEvaluationException { TupleResultSet res; OntopStatement stm; long start = System.currentTimeMillis(); try { stm = conn.createStatement(); if(this.queryTimeout > 0) stm.setQueryTimeout(this.queryTimeout); try { SelectQuery inputQuery = factory.createSelectQuery(getQueryString(), getParsedQuery()); res = stm.execute(inputQuery); } catch (OntopQueryAnsweringException e) { long end = System.currentTimeMillis(); if (this.queryTimeout > 0 && (end - start) >= this.queryTimeout * 1000){ throw new QueryEvaluationException("OntopTupleQuery timed out. More than " + this.queryTimeout + " seconds passed", e); } else throw e; } List<String> signature = res.getSignature(); return new OntopTupleQueryResult(res, signature); } catch (QueryEvaluationException e) { throw e; } catch (Exception e) { throw new QueryEvaluationException(e); } }
@Override public TupleQueryResult evaluate() throws QueryEvaluationException { TupleResultSet res; OntopStatement stm; long start = System.currentTimeMillis(); try { stm = conn.createStatement(); if(this.queryTimeout > 0) stm.setQueryTimeout(this.queryTimeout); try { SelectQuery inputQuery = factory.createSelectQuery(getQueryString(), getParsedQuery()); res = stm.execute(inputQuery); } catch (OntopQueryAnsweringException e) { long end = System.currentTimeMillis(); if (this.queryTimeout > 0 && (end - start) >= this.queryTimeout * 1000){ throw new QueryEvaluationException("OntopTupleQuery timed out. More than " + this.queryTimeout + " seconds passed", e); } else throw e; } List<String> signature = res.getSignature(); return new OntopTupleQueryResult(res, signature); } catch (QueryEvaluationException e) { throw e; } catch (Exception e) { throw new QueryEvaluationException(e); } }