1 Reply Latest reply on Nov 7, 2011 5:24 PM by alwu-Oracle

    Print results

      there is way to print the data from Describe and Construct queries in a table view like the data are printed from select query?
      In Select Query we use
      ResultSet results = qexec.execSelect();
      ResultSetFormatter.out(System.out, results, query);
      In Describe for example if we try to use we take back error!
      Results results = qexec.execDescribe();
      ResultSetFormatter.out(System.out, results, query);

      if we use System.out.println("describe result = " + m.toString() ); it works but i don't want the results in a line
      can anyone help?
      thx a lpt
        • 1. Re: Print results

          A describe or construct query returns a Jena Model object.
          You can invoke the listStatements API against the Jena Model object and that method will return a

          See http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/model/StmtIterator.html

          It is straightforward to print all the statements from the iterator.

          Hope it helps,

          Zhe Wu