In the below code:
1 .String queryString = SPARQL QUERY
2. Query query = QueryFactory.create(queryString,Syntax.syntaxARQ);
3. QueryExecution qexec = QueryExecutionFactory.create(query, model);
4. ResultSet results = qexec.execSelect();
5. ResultSetFormatter.out(System.out, results,query);
Instead of using line 5. and printing output on console , I want to populate Subject, Predicate and Object returned from Query in my Userdefined Objects, Hw can i do that. I dont want to execute line number 5. Is there a way to get the resultset without executing line 5 and iterate through it and populate my userdefined objects.
Can you share any sample example.
Thanks and Regards,
Here is the Javadoc for ResultSet
You can iterate through it, get the QuerySolution out and construct your own Java objects out of query solutions.