On 15/02/12 11:57, Milorad Tosic wrote:
Andy,

Yes, results are ResultSet. What you described about
ResultSetFormatter.output is exactly what I noticed, but couldn't
find it in any documentation, so I concluded that I did something
wrong. Thanks for the explanation.

Prefixes only matter the presentation style and are not related to
resource identity IRI/URI etc. However, it would be more convenient
for a human user to watch query results presented without full URI
names. In fact, my personal choice would be turtle format with
prefixes instead of full URI names.


Are you suggesting that if I set prefixes explicitly in the Model
containing results before I try to do
results.getResourceModel().write(out, "TURTLE") it would print turtle
format with prefixes instead of full URL names?

Thanks, Milorad

Hi Milorad,

Results.getResourceModel() does not contain the results of the query. In some cases it's undefined, sometimes its empty, sometimes it is the data queried.

If you want the results as RDF (non-standard format) you need to call outputAsRDF. That's a model and you can set it's prefixes.

If you want to process a result set, then try out the text format output, you'll find it does try to use prefixes where available. It uses FmtUtils.stringForRDFNode to format the result set items.

A complete, minimal example of what you're trying to do would be helpful.

        Andy

Reply via email to