Package org.openrdf.query

Examples of org.openrdf.query.QueryEvaluationException


    }
    else if (expr == null) {
      throw new IllegalArgumentException("expr must not be null");
    }
    else {
      throw new QueryEvaluationException("Unsupported value expr type: " + expr.getClass());
    }
  }
View Full Code Here


    throws ValueExprEvaluationException, QueryEvaluationException
  {
    Function function = FunctionRegistry.getInstance().get(node.getURI());

    if (function == null) {
      throw new QueryEvaluationException("Unknown function '" + node.getURI() + "'");
    }

    List<ValueExpr> args = node.getArgs();

    Value[] argValues = new Value[args.size()];
View Full Code Here

                    protected QueryEvaluationException convert(Exception e) {
                        if (e instanceof ClosedByInterruptException) {
                            return new QueryInterruptedException(e);
                        }
                        else if (e instanceof IOException) {
                            return new QueryEvaluationException(e);
                        }
                        else if (e instanceof SailException) {
                            if(e.getCause() instanceof ResultInterruptedException) {
                                return new QueryInterruptedException(e);
                            } else {
                                return new QueryEvaluationException(e);
                            }
                        }
                        else if (e instanceof RuntimeException) {
                            throw (RuntimeException)e;
                        }
                        else if (e == null) {
                            throw new IllegalArgumentException("e must not be null");
                        }
                        else {
                            throw new IllegalArgumentException("Unexpected exception type: " + e.getClass(),e);
                        }
                    }
                };
            } catch (SailException ex) {
                throw new QueryEvaluationException(ex);
            }
        }
View Full Code Here

    private void query(TupleQuery query, TupleQueryResultWriter writer) throws QueryEvaluationException {
        try {
            query.evaluate(writer);
        } catch (TupleQueryResultHandlerException e) {
            throw new QueryEvaluationException("error while writing query tuple result: ",e);
        }
    }
View Full Code Here

    private void query(BooleanQuery query, BooleanQueryResultWriter writer) throws QueryEvaluationException {
        try {
            writer.write(query.evaluate());
        } catch (IOException e) {
            throw new QueryEvaluationException("error while writing query boolean result: ",e);
        }
    }
View Full Code Here

    private void query(GraphQuery query, SPARQLGraphResultWriter writer) throws QueryEvaluationException {
        try {
            writer.write(query.evaluate());
        } catch (IOException e) {
            throw new QueryEvaluationException("error while writing query graph result: ",e);
        }
    }
View Full Code Here

    }

    @Override
    public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Join join, BindingSet bindings) throws QueryEvaluationException {
        if(Thread.currentThread().isInterrupted()) {
            throw new QueryEvaluationException("SPARQL evaluation has already been cancelled");
        }

        if(isSupported(join)) {
            log.debug("applying KiWi JOIN optimizations on SPARQL query ...");

            try {
                return new ExceptionConvertingIteration<BindingSet, QueryEvaluationException>(connection.evaluateJoin(join, bindings)) {
                    @Override
                    protected QueryEvaluationException convert(Exception e) {
                        return new QueryEvaluationException(e);
                    }
                };
            } catch (SQLException e) {
                throw new QueryEvaluationException(e.getMessage(),e);
            } catch (IllegalArgumentException e) {
                throw new QueryEvaluationException(e.getMessage(),e);
            } catch (InterruptedException e) {
                throw new QueryInterruptedException(e.getMessage());
            }
        } else {
            return super.evaluate(join, bindings);
View Full Code Here

            try {
                return new ExceptionConvertingIteration<BindingSet, QueryEvaluationException>(connection.evaluateJoin(join, bindings)) {
                    @Override
                    protected QueryEvaluationException convert(Exception e) {
                        return new QueryEvaluationException(e);
                    }
                };
            } catch (SQLException e) {
                throw new QueryEvaluationException(e);
            } catch (IllegalArgumentException e) {
                throw new QueryEvaluationException(e);
            } catch (InterruptedException e) {
                throw new QueryInterruptedException(e);
            }
        } else {
            return super.evaluate(join, bindings);
View Full Code Here

                    protected QueryEvaluationException convert(Exception e) {
                        if (e instanceof ClosedByInterruptException) {
                            return new QueryInterruptedException(e);
                        }
                        else if (e instanceof IOException) {
                            return new QueryEvaluationException(e);
                        }
                        else if (e instanceof RuntimeException) {
                            throw (RuntimeException)e;
                        }
                        else if (e == null) {
                            throw new IllegalArgumentException("e must not be null");
                        }
                        else {
                            throw new IllegalArgumentException("Unexpected exception type: " + e.getClass(),e);
                        }
                    }
                };
            } catch (SailException ex) {
                throw new QueryEvaluationException(ex);
            }
        }
View Full Code Here

    }

    @Override
    public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Join join, BindingSet bindings) throws QueryEvaluationException {
        if(Thread.currentThread().isInterrupted()) {
            throw new QueryEvaluationException("SPARQL evaluation has already been cancelled");
        }

        if(isSupported(join)) {
            log.debug("applying KiWi JOIN optimizations on SPARQL query ...");

            try {
                return new ExceptionConvertingIteration<BindingSet, QueryEvaluationException>(connection.evaluateJoin(join, bindings, dataset)) {
                    @Override
                    protected QueryEvaluationException convert(Exception e) {
                        return new QueryEvaluationException(e);
                    }
                };
            } catch (SQLException e) {
                throw new QueryEvaluationException(e.getMessage(),e);
            } catch (IllegalArgumentException e) {
                throw new QueryEvaluationException(e.getMessage(),e);
            } catch (InterruptedException e) {
                throw new QueryInterruptedException(e.getMessage());
            }
        } else {
            return super.evaluate(join, bindings);
View Full Code Here

TOP

Related Classes of org.openrdf.query.QueryEvaluationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.