Package com.hp.hpl.jena.query.engine1

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


      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

 
  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

 
  public void testJoinQuery() throws SQLException, ConfigException
  {
    QueryEngine qe = prepareQuery("SELECT ?val1 ?val2 ?val3 WHERE { ?s1 <urn:ex:TABLE1_FIELD1> ?val1 ; <urn:ex:TABLE1_FIELD2> ?val2 . ?s2 <urn:ex:TABLE2_FIELD1> ?val1 ; <urn:ex:TABLE2_FIELD2> ?val3 .}");
   
    ResultSet res = qe.execSelect();
   
    assertTrue("Query has results", res.hasNext());
    ResultSetFormatter.out(System.out, res);
  }
 
View Full Code Here

 
  public void testOptionalSelectQuerySameSubject() throws SQLException, ConfigException
  {
    QueryEngine qe = prepareQuery("SELECT * WHERE { ?s <urn:ex:TABLE1_FIELD1> ?val1 . OPTIONAL { ?s <urn:ex:TABLE1_FIELD2> ?val2} }");
   
    ResultSet res = qe.execSelect();
   
    assertTrue("Optional subject join has result", res.hasNext());
   
    // No more than two results!
    res.next(); res.next();
View Full Code Here

  {
    QueryEngine qe;
   
    qe = prepareQuery("SELECT ?subj WHERE { ?subj <urn:ex:TABLE1_FIELD2> 'C' }");
   
    ResultSet res = qe.execSelect();
   
    assertTrue("I have results", res.hasNext());
   
    QuerySolution soln = res.nextSolution();
   
View Full Code Here

  {
    QueryEngine qe;
   
    qe = prepareQuery("SELECT ?s WHERE { ?s a <urn:ex:TABLE1> }");
   
    ResultSet res = qe.execSelect();
   
    assertTrue("I have a result", res.hasNext());
  }
}
View Full Code Here

        "}"
        );
   
    QueryEngine qe = new LdapQueryEngine(query, config);
    qe.setDataset(DatasetFactory.create());
    ResultSet res = qe.execSelect();
   
    ResultSetFormatter.out(System.out, res);
  }

}
View Full Code Here

        "}"
        );
   
    QueryEngine qe = new LdapQueryEngine(query, config);
    qe.setDataset(DatasetFactory.create());
    ResultSet res = qe.execSelect();
    assertTrue("I have results", res.hasNext());
    ResultSetFormatter.out(System.out, res);
  }
 
  /* This will fail -- no lat and long for bristol (?) */
 
View Full Code Here

        "}"
        );
   
    QueryEngine qe = new LdapQueryEngine(query, config);
    qe.setDataset(DatasetFactory.create());
    ResultSet res = qe.execSelect();
    assertFalse("I have results", res.hasNext());
  }
 
  /* There is a country, however */
  public void testPosPos()
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.