Either
* your query is not returning one line
* you called .next once already and then called it again
Once again you do not provide a complete, minimal example. No one can
tell which of these is happening.
Read this
http://stackoverflow.com/help/mcve
Andy
On 03/11/16 13:53, neha gupta wrote:
It gives me error:
NoSuchElementException: QueryIteratorCloseable
t
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.nextBinding(QueryIteratorBase.java:93)
^^^^^^^^^^^^^^^^^^^
Your version of Jena is out of date.
On Thu, Nov 3, 2016 at 3:35 PM, neha gupta <[email protected]> wrote:
Thanks Lorenz, I did not know about this method.
On Thu, Nov 3, 2016 at 3:00 PM, Lorenz B. <[email protected]
leipzig.de> wrote:
If you know that there is exactly 1 result why does it not work to call
just once rs.next() ? E.g.
rs.next().getLiteral(THE_VAR_NAME).getLexicalForm();
Lorenz
I have a query which has output of one single string line "My name is
---,
living in city -----, located in country ----.
After query string , I have executed the query
Query query = QueryFactory.create(queryString);
QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
ResultSet rs = qexec.execSelect() ;
I want this string to be displayed as string:
JOptionPane.showMessageDialog(null, string);
But I dont think I need while(rs.hasNext()) and convert it to string
because resultset only contain one string output at one time.
How can I display the resultset as string?
--
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center