Package com.clarkparsia.empire.ds

Examples of com.clarkparsia.empire.ds.QueryException


      TupleQueryResult aResult = mConnection.prepareTupleQuery(mQueryLang, theQuery).evaluate();

      return new TupleQueryResultSet(aResult);
    }
    catch (Exception e) {
      throw new QueryException(e);
    }
  }
View Full Code Here


      GraphQuery aQuery = mConnection.prepareGraphQuery(mQueryLang, theQuery);
      aQuery.evaluate(aHandler);     
      return aHandler.getGraph();   
    }
    catch (Exception e) {
      throw new QueryException(e);
    }
  }
View Full Code Here

  public boolean ask(final String theQuery) throws QueryException {
    try {
      return mConnection.prepareBooleanQuery(mQueryLang, theQuery).evaluate();
    }
    catch (Exception e) {
      throw new QueryException(e);
    }
  }
View Full Code Here

          else {
            return (T) parseTupleResult(aResponse);
          }
        }
        catch (Exception e) {
          throw new QueryException("Could not parse SPARQL-XML results", e);
        }
      }
    }
    catch (IOException e) {
      throw new QueryException(e);
    }
    finally {
      if (aResponse != null) {
        try {
          aResponse.close();
View Full Code Here

   * @param theQuery the query being executed that caused the error
   * @param theResponse the response which indicate a server error
   * @return the Response as an Exception
   */
  private QueryException responseToException(String theQuery, Response theResponse) {
    return new QueryException("Error evaluating query: " + theQuery + "\n(" + theResponse.getResponseCode() + ") " + theResponse.getMessage() + "\n\n" + theResponse.getContent());
  }
View Full Code Here

      else {
        try {
          return GraphIO.readGraph(aResponse.getContent(), RDFFormat.TURTLE);
        }
        catch (RDFParseException e) {
          throw new QueryException("Error while parsing rdf/xml-formatted query results", e);
        }
      }
    }
    catch (IOException e) {
      throw new QueryException(e);
    }
    finally {
      if (aResponse != null) {
        try {
          aResponse.close();
View Full Code Here

                    // no-op
                }
            };
    }
    catch (MalformedQueryException e) {
      throw new QueryException("Unsupported or invalid SeRQL query.", e);
    }
    catch (QueryEvaluationException e) {
      throw new QueryException("Error during query evaluation.", e);
    }
    catch (Exception e) {
      throw new QueryException(e);
    }
  }
View Full Code Here

  public Graph graphQuery(final String theQuery) throws QueryException {
    try {
      return Graphs.newGraph(Repositories.constructQuery(mRepo, QueryLanguage.SERQL, theQuery));
    }
    catch (MalformedQueryException e) {
      throw new QueryException("Unsupported or invalid SeRQL query.", e);
    }
    catch (QueryEvaluationException e) {
      throw new QueryException("Error during query evaluation.", e);
    }
    catch (Exception e) {
      throw new QueryException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.clarkparsia.empire.ds.QueryException

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.