@Override protected QueryEvaluationException convert(Exception e) { return new QueryEvaluationException(e); } };
@Override protected void handleSailException(SailException e) throws QueryEvaluationException { throw new QueryEvaluationException(e); } };
@Override protected QueryEvaluationException convert(Exception exception) { return new QueryEvaluationException(exception); } };
@Override protected void increment() throws QueryEvaluationException { if (used.incrementAndGet() > maxSize) { throw new QueryEvaluationException( "Size limited reached inside order operator query, max size is:" + maxSize); } }
@Override protected void put(Map<BindingSet, List<BindingSet>> hashTable, BindingSet hashKey, List<BindingSet> hashValue) throws QueryEvaluationException { List<BindingSet> put = hashTable.put(hashKey, hashValue); if (put == null && used.incrementAndGet() > maxSize) { throw new QueryEvaluationException(SIZE_LIMIT_REACHED + maxSize); } }
protected void putHashTableEntry(Map<BindingSetHashKey, List<BindingSet>> hashTable, BindingSetHashKey hashKey, List<BindingSet> hashValue) throws QueryEvaluationException { List<BindingSet> put = hashTable.put(hashKey, hashValue); if (put == null && used.incrementAndGet() > maxSize) { throw new QueryEvaluationException(SIZE_LIMIT_REACHED + maxSize); } }
@Override protected void put(Map<BindingSet, List<BindingSet>> hashTable, BindingSet hashKey, List<BindingSet> hashValue) throws QueryEvaluationException { List<BindingSet> put = hashTable.put(hashKey, hashValue); if (put == null && used.incrementAndGet() > maxSize) { throw new QueryEvaluationException(SIZE_LIMIT_REACHED + maxSize); } }
protected <E> void add(Collection<E> col, E value) throws QueryEvaluationException { if (col.add(value) && used.incrementAndGet() > maxSize) { throw new QueryEvaluationException(SIZE_LIMIT_REACHED + maxSize); } }
@Override protected void addAll(List<BindingSet> hashTableValues, List<BindingSet> values) throws QueryEvaluationException { Iterator<BindingSet> iter = values.iterator(); while (iter.hasNext()) { if (hashTableValues.add(iter.next()) && used.incrementAndGet() > maxSize) { throw new QueryEvaluationException(SIZE_LIMIT_REACHED + maxSize); } } }
@Override public void close() throws QueryEvaluationException { try { this.graphResultSet.close(); } catch (OntopConnectionException e) { throw new QueryEvaluationException(e); } }
@Override protected boolean add(BindingSet object) throws QueryEvaluationException { boolean add = super.add(object); if (add && used.incrementAndGet() > maxSize) throw new QueryEvaluationException("Size limited reached inside query operator."); return add; }
@Override public void close() throws QueryEvaluationException { try { this.graphResultSet.close(); } catch (OntopConnectionException e) { throw new QueryEvaluationException(e); } }
@Override public void close() throws QueryEvaluationException { try { res.close(); } catch (Exception e) { throw new QueryEvaluationException(e); } }
@Override protected boolean add(BindingSet object) throws QueryEvaluationException { boolean add = super.add(object); if (add && used.incrementAndGet() > maxSize) throw new QueryEvaluationException("Size limited reached inside query operator."); return add; }
@Override public boolean hasNext() throws QueryEvaluationException { try { return graphResultSet.hasNext(); } catch (OntopConnectionException | OntopQueryAnsweringException e) { throw new QueryEvaluationException(e); } }
@Override public boolean hasNext() throws QueryEvaluationException { try { return res.hasNext(); } catch (Exception e) { throw new QueryEvaluationException(e); } }
@Override public void close() throws QueryEvaluationException { try { res.close(); } catch (Exception e) { throw new QueryEvaluationException(e); } }
@Override public void initialize() throws QueryEvaluationException { try { rep.initialize(); } catch (RepositoryException e) { throw new QueryEvaluationException(e); } }
@Override public GraphQueryResult evaluate() throws QueryEvaluationException { if (hasStarted) throw new QueryEvaluationException("A materialization GraphQuery can only be evaluated once"); hasStarted = true; return new IteratingGraphQueryResult(ImmutableMap.of(), new GraphMaterializationIteration(graphResultSet)); }
@Override public boolean evaluate() throws QueryEvaluationException { AskQuery query = factory.createAskQuery(getQueryString(), getParsedQuery()); try (OntopStatement stm = conn.createStatement(); BooleanResultSet rs = stm.execute(query)) { return rs.getValue(); } catch (OntopConnectionException | OntopQueryAnsweringException e) { throw new QueryEvaluationException(e); } }