Examples of execSelect()


Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

            QueryExecution qexec = QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql", query);
            // Set the DBpedia specific timeout.
            ((QueryEngineHTTP)qexec).addParam("timeout", "10000") ;

            // Execute.
            ResultSet rs = qexec.execSelect();
            ResultSetFormatter.out(System.out, rs, query);
            qexec.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

        Query query = QueryFactory.create(prefixes+string) ;
        QuerySolutionMap initValues = null ;
        if ( varName != null )
            initValues = querySolution(varName, value) ;
        QueryExecution qExec = QueryExecutionFactory.create(query, m, initValues) ;
        ResultSet rs = ResultSetFactory.copyResults(qExec.execSelect()) ;
        qExec.close() ;
        return rs ;
    }
   
    private static QuerySolutionMap querySolution(String varName, RDFNode value)
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

        QueryExecution qexec = createQueryExecution(query, dataset) ;
        setAnyTimeouts(qexec, action);

        if ( query.isSelectType() )
        {
            ResultSet rs = qexec.execSelect() ;
           
            // Force some query execution now.
            // Do this to force the query to do something that should touch any underlying database,
            // and hence ensure the communications layer is working.
            // MySQL can time out after 8 hours of an idle connection
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

    final Date a = new Date();
    final QueryExecution qe = QueryExecutionFactory.create(query, model);
    if (query.isAskType()) {
      qe.execAsk();
    } else if (query.isSelectType()) {
      final ResultSet results = qe.execSelect();
      ResultSetFormatter.consume(results);
    }
    qe.close();
    return ((new Date()).getTime() - a.getTime());
  }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

        final QueryResult qr = new BooleanResult();
        qe.close();
        return qr;
      }
    } else if (query.isSelectType()) {
      final ResultSet results = qe.execSelect();
      final QueryResult list = resultSetToBindingsList(results);
      qe.close();
      return list;
    } else if (query.isConstructType()) {
      final Model model = qe.execConstruct();
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

    Query query = QueryFactory.create(queryString);   
   
    // Execute the query and obtain results
    QueryExecution qe = QueryExecutionFactory.create(query, model);
    ResultSet results = qe.execSelect();

    // Output query results
    ByteArrayOutputStream debug = new ByteArrayOutputStream();
    ResultSetFormatter.out(debug, results, query);
    logger.debug(debug.toString());
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

            // A ResultSet is an iterator - any query solutions returned by .next()
            // are not accessible again.
            // Create a ResultSetRewindable that can be reset to the beginning.
            // Do before first use.
           
            ResultSetRewindable rewindable = ResultSetFactory.makeRewindable(qexec.execSelect()) ;
            ResultSetFormatter.out(rewindable) ;
            rewindable.reset() ;
            ResultSetFormatter.out(rewindable) ;
        }
        finally
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execSelect()

      qe = new LdapQueryEngine(q, config);
    }
   
    qe.setDataset(DatasetFactory.create());
   
    ResultSet results = qe.execSelect();
   
    ResultSetFormatter.out(System.out, results);
  }

  private static String readFromStream(InputStream in) throws IOException
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execSelect()

      else
        qe = new SQLQueryEngine(query, config);

      qe.setDataset(DatasetFactory.create());

      ResultSet results = qe.execSelect();
      resp.setHeader("Content-Type", "application/xml");
      ResultSetFormatter.outputAsXML(resp.getOutputStream(), results,
          stylesheet);
    }
    catch (Throwable e)
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execSelect()

 
  public void testBasicSelectQuery() throws SQLException, ConfigException
  {
    QueryEngine qe = prepareQuery("SELECT ?s ?val1 WHERE { ?s <urn:ex:TABLE1_FIELD1> ?val1 }");
   
    ResultSet res = qe.execSelect();
   
    assertTrue("Query has results", res.hasNext());
    ResultSetFormatter.out(System.out, res);
  }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.