Hi,
when I am executing queries in a loop using java. It got stuck after 20 iterations, means after execution of 20 queries.
code below:
while ((record = reader.readNext()) != null) {
//reader.readNext();
//System.out.println(record[0]);
String p = "<"+record[0]+">";
System.out.println(p);
String query = "SELECT (COUNT(*) as ?total_triples) { ?s"+p+" ?o }";
SelectQuery sparQ = connection.select(query);
System.out.println("query making...!!!");
SelectQueryResult tupleQueryResult = sparQ.execute();
System.out.println("query executed...!!!");
while(tupleQueryResult.hasNext()) {
BindingSet result = tupleQueryResult.next();
int val = Literal.intValue((Literal) result.get("total_triples"));
System.out.println(val);
System.out.println(i);
// predicatesJson.put(record[0], val);
// System.out.println(Literal.integerValue((Literal) result.get("total_triples")));
}
}
it got stuck in "SelectQueryResult tupleQueryResult = sparQ.execute();" line.
basically, I am reading predicates from a csv file, and for each predicate I am executing a query to find out no of triples associated with this predicate.
But this program is got stuck after executing 20 iterations.
Please help me to solve this. ?