3

I'm trying to convert a ResultSet to a Model in Apache Jena 3.0.

Previously I used the

ResultSetFormatter.toModel function, but this seems to have been removed.

What's the best way currently to get a Model (for serialization to JSON-LD and RDF/XML) of the ResultSet?

JoelKuiper
  • 4,362
  • 2
  • 22
  • 33
  • Haven't used the API for a long time (since version 2) but there seems to be a [`getResourceModel` in `ResultSet`](https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/ResultSet.html#getResourceModel--) itself. Not sure it has the right semantics but the types match up. – toniedzwiedz Aug 22 '15 at 18:34

1 Answers1

5

RDFOutput.toModel

ResultSetFormatter operations were deprecated in jena 2.13.0 with placeholders left behind and javadoc referring to RDFOutput.

AndyS
  • 16,345
  • 17
  • 21
  • Hmm there are no placeholders or references to it in https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/ResultSetFormatter.html that I can see! – JoelKuiper Aug 22 '15 at 19:07
  • In 2.13.0 there are. Did you skip that version? – AndyS Aug 22 '15 at 19:40
  • 1
    I was out of the loop for a bit, would be nice to at least mention the RDFOutput in the most current version though (since it does mention the XML serialization is not RDF, but doesn't provide hints how to get it). – JoelKuiper Aug 22 '15 at 20:45
  • `ResultSetFormatter` is still documented at http://jena.apache.org/documentation/query/app_api.html – jaco0646 May 09 '17 at 20:51
  • The documentation will be updated. `RDFOutput.toModel` exists but of course the format is non-standard. – AndyS May 11 '17 at 07:49