Hello Max,

See 
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#write-java.io.OutputStream-org.apache.jena.sparql.core.DatasetGraph-org.apache.jena.riot.Lang-
 family of methods.

Here is my regular snippet for pretty-printing a Model in Turtle, but you can 
adjust it do use a graph and RDF/XML instead.

ByteArrayOutputStream b = new ByteArrayOutputStream();
RDFDataMgr.write(b, model, RDFFormat.TURTLE_PRETTY);
String mTurtle = b.toString();

--
Cheers,
Andrew

On 2021-03-15 , at 14:54, Sentient #6 
<[email protected]<mailto:[email protected]>>
 wrote:

Dear all,

I have the question how to convert the output from getGraph() to a RDF/XML
representation.


I did the following:

RDFConnection connectionToSPARQLEndpoint = RDFConnectionFactory.connect("
http://localhost:3030/dataset";);

connectionToSPARQLEndpoint.fetch(identifier).getGraph().toString();


So I have the the graph but I have some trouble to convert it into a
RDF/XML representation.

Has somebody of you an advice?

Cheers,

Max

Reply via email to