}
endTest(ok && result); // should return sz > 0 results
// do construct
startTest();
Graph g = new GraphImpl();
boolean statementFound = false;
try {
ok = true;
log("Sending construct query");
query = "CONSTRUCT {?s <http://myopenlink.net/mlo/handle> ?o} FROM <" + context + "> WHERE {?s <http://myopenlink.net/foaf/name> ?o}";
g = doGraphQuery(con, query);
Iterator<Statement> it = g.iterator();
statementFound = true;
while(it.hasNext()) {
Statement st = it.next();
if( !st.getPredicate().stringValue().equals("http://myopenlink.net/mlo/handle")) statementFound = false;
}
}
catch (Exception e) {
System.out.println("Error[" + e + "]");
e.printStackTrace();
ok = false;
}
endTest(ok && g.size() > 0); // should return sz > 0 results
// do describe
startTest();
g = new GraphImpl();
statementFound = false;
try {
ok = true;
log("Sending describe query");
query = "DESCRIBE ?s FROM <" + context + "> WHERE {?s <http://myopenlink.net/foaf/name> ?o}";
g = doGraphQuery(con, query);
Iterator<Statement> it = g.iterator();
statementFound = it.hasNext();
// while(it.hasNext()) {
// Statement st = it.next();
// if( !st.getPredicate().stringValue().equals("http://myopenlink.net/mlo/handle")) statementFound = false;
// }