Package org.openrdf.query

Examples of org.openrdf.query.GraphQueryResult


          }
        }
        qr.add(binding);
      }
    } else if (result instanceof GraphQueryResultImpl) {
      final GraphQueryResult gqr = (GraphQueryResultImpl) result;
      final GraphResult graphResult = new GraphResult();
      while (gqr.hasNext()) {
        graphResult.addGraphResultTriple(SesameturtleParser
            .transformSesameStatementToTriple(gqr.next()));
      }
      return graphResult;
    } else {
      System.out
          .println("Query type currently not supported by SesameQueryEvaluator!");
View Full Code Here


    QueryLanguage language = ConversionUtil.toOpenRDFQueryLanguage(queryLanguage);
   
    try {
      // determine query result
      GraphQuery query = this.connection.prepareGraphQuery(language, queryString);
      GraphQueryResult queryResult = query.evaluate();
     
      // wrap it in a GraphIterable
      return new GraphIterable(queryResult, null);
    } catch(OpenRDFException e) {
      throw new ModelRuntimeException(e);
View Full Code Here

          throws ModelRuntimeException {
    this.assertModel();
    GraphQuery query;
    try {
      query = this.connection.prepareGraphQuery(QueryLanguage.SPARQL, queryString);
      GraphQueryResult graphQueryResult = query.evaluate();
      return new StatementIterable(graphQueryResult, null);
    } catch(OpenRDFException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

          throws ModelRuntimeException {
    this.assertModel();
    GraphQuery query;
    try {
      query = this.connection.prepareGraphQuery(QueryLanguage.SPARQL, queryString);
      GraphQueryResult graphQueryResult = query.evaluate();
      return new StatementIterable(graphQueryResult, null);
    } catch(OpenRDFException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

 
  @Override
  public ClosableIterable<Statement> sparqlDescribe(String query) throws ModelRuntimeException {
    assertModel();
    try {
      GraphQueryResult graphQueryResult = this.connection.prepareGraphQuery(
              QueryLanguage.SPARQL, query).evaluate();
      return new GraphIterable(graphQueryResult, this);
    } catch(MalformedQueryException e) {
      throw new ModelRuntimeException(e);
    } catch(UnsupportedQueryLanguageException e) {
View Full Code Here

 
  @Override
  public ClosableIterable<Statement> sparqlConstruct(String query) throws ModelRuntimeException {
    assertModel();
    try {
      GraphQueryResult graphQueryResult = this.connection.prepareGraphQuery(
              QueryLanguage.SPARQL, query).evaluate();
      return new GraphIterable(graphQueryResult, this);
    } catch(MalformedQueryException e) {
      throw new ModelRuntimeException(e);
    } catch(UnsupportedQueryLanguageException e) {
View Full Code Here

      if(ql == null) {
        throw new QueryLanguageNotSupportedException("Unsupported query language: '"
                + querylanguage + "'");
      }
      try {
        GraphQueryResult graphQueryResult = this.connection.prepareGraphQuery(ql, query)
                .evaluate();
        return new GraphIterable(graphQueryResult, this);
      } catch(MalformedQueryException e) {
        throw new ModelRuntimeException(e);
      } catch(UnsupportedQueryLanguageException e) {
View Full Code Here

    List<Statement> graph = new ArrayList<Statement>();

    try {
      RepositoryConnection repCon = rdfRep.getConnection();
      try {
        GraphQueryResult graphResult = repCon.prepareGraphQuery(QueryLanguage.SPARQL, sparqlQuery).evaluate();

        try {
          while (graphResult.hasNext()) {
            graph.add(graphResult.next());
          }         
        } finally {
          graphResult.close();
        }             
      } finally {
        repCon.close();
      }     
View Full Code Here

  }

  public void evaluate(RDFHandler handler)
    throws QueryEvaluationException, RDFHandlerException
  {
    GraphQueryResult queryResult = evaluate();
    QueryResultUtil.report(queryResult, handler);
  }
View Full Code Here

      conn = repo.getConnection();

      HTTPGraphQuery query = (HTTPGraphQuery)conn.prepareGraphQuery(qInfo.getQueryLanguage(),
          qInfo.getQueryString());
      query.setIncludeInferred(qInfo.isIncludeInferred());
      GraphQueryResult queryResult = null;
      try {
        queryResult = query.evaluate();
      }
      catch (HTTPQueryEvaluationException e) {
        if (e.isCausedByMalformedQueryException()) {
View Full Code Here

TOP

Related Classes of org.openrdf.query.GraphQueryResult

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.