Examples of execSelect()


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

 
  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

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

 
  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

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

  {
    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

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

  {
    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

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

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

}
View Full Code Here

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

        "}"
        );
   
    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

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

        "}"
        );
   
    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

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

        "}"
        );
   
    QueryEngine qe = new LdapQueryEngine(query, config);
    qe.setDataset(DatasetFactory.create());
    ResultSet res = qe.execSelect();
    assertTrue("I have results", res.hasNext());
    QuerySolution result = res.nextSolution();
    assertTrue("I have a country", result.contains("country"));
    assertEquals("I have the correct country", Node.createLiteral("GB"), result.get("country").asNode());
  }
View Full Code Here

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

        "}"
        );
   
    QueryEngine qe = new LdapQueryEngine(query, config);
    qe.setDataset(DatasetFactory.create());
    ResultSet res = qe.execSelect();
    assertTrue("I have results", res.hasNext());
  }
 
  /* Very simple, but possibly tricky... -- negative version of above */
  public void testTripleNotExists()
View Full Code Here

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

        "}"
        );
   
    QueryEngine qe = new LdapQueryEngine(query, config);
    qe.setDataset(DatasetFactory.create());
    ResultSet res = qe.execSelect();
    assertFalse("I have results", res.hasNext());
  }
}
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.