/** Create an HttpEntity for the graph */ protected HttpEntity graphToHttpEntity(Graph graph, RDFFormat syntax) { EntityTemplate entity = new EntityTemplate((out)->RDFDataMgr.write(out, graph, syntax)); String ct = syntax.getLang().getContentType().getContentType(); entity.setContentType(ct); return entity; }
/** Create an HttpEntity for the graph */ protected HttpEntity graphToHttpEntity(Graph graph, RDFFormat syntax) { EntityTemplate entity = new EntityTemplate((out)->RDFDataMgr.write(out, graph, syntax)); String ct = syntax.getLang().getContentType().getContentType(); entity.setContentType(ct); return entity; }
/** Create an HttpEntity for the dataset */ protected HttpEntity datasetToHttpEntity(DatasetGraph dataset, RDFFormat syntax) { EntityTemplate entity = new EntityTemplate((out)->RDFDataMgr.write(out, dataset, syntax)); String ct = syntax.getLang().getContentType().getContentType(); entity.setContentType(ct); return entity; }
/** Create an HttpEntity for the dataset */ protected HttpEntity datasetToHttpEntity(DatasetGraph dataset, RDFFormat syntax) { EntityTemplate entity = new EntityTemplate((out)->RDFDataMgr.write(out, dataset, syntax)); String ct = syntax.getLang().getContentType().getContentType(); entity.setContentType(ct); return entity; }
/** Create an HttpEntity for the graph */ protected HttpEntity graphToHttpEntity(final Graph graph) { final RDFFormat syntax = getOutboundSyntax() ; ContentProducer producer = new ContentProducer() { @Override public void writeTo(OutputStream out) { RDFDataMgr.write(out, graph, syntax) ; } } ; EntityTemplate entity = new EntityTemplate(producer) ; String ct = syntax.getLang().getContentType().getContentType() ; entity.setContentType(ct) ; return entity ; } }
/** Create an HttpEntity for the graph */ protected HttpEntity graphToHttpEntity(final Graph graph) { final RDFFormat syntax = getOutboundSyntax() ; ContentProducer producer = new ContentProducer() { @Override public void writeTo(OutputStream out) throws IOException { RDFDataMgr.write(out, graph, syntax) ; } } ; EntityTemplate entity = new EntityTemplate(producer) ; String ct = syntax.getLang().getContentType().getContentType() ; entity.setContentType(ct) ; return entity ; } }
/** Create an HttpEntity for the graph */ protected static HttpEntity graphToHttpEntity(final Graph graph) { final RDFFormat syntax = RDFFormat.TURTLE_BLOCKS ; ContentProducer producer = new ContentProducer() { @Override public void writeTo(OutputStream out) { RDFDataMgr.write(out, graph, syntax) ; } } ; EntityTemplate entity = new EntityTemplate(producer) ; ContentType ct = syntax.getLang().getContentType() ; entity.setContentType(ct.getContentType()) ; return entity ; }
/** Create an HttpEntity for the graph */ protected static HttpEntity graphToHttpEntity(final Graph graph) { final RDFFormat syntax = RDFFormat.TURTLE_BLOCKS ; ContentProducer producer = new ContentProducer() { @Override public void writeTo(OutputStream out) { RDFDataMgr.write(out, graph, syntax) ; } } ; EntityTemplate entity = new EntityTemplate(producer) ; ContentType ct = syntax.getLang().getContentType() ; entity.setContentType(ct.getContentType()) ; return entity ; } }
/** Create an HttpEntity for the graph */ protected static HttpEntity graphToHttpEntity(final Graph graph) { final RDFFormat syntax = RDFFormat.TURTLE_BLOCKS ; ContentProducer producer = new ContentProducer() { @Override public void writeTo(OutputStream out) { RDFDataMgr.write(out, graph, syntax) ; } } ; EntityTemplate entity = new EntityTemplate(producer) ; ContentType ct = syntax.getLang().getContentType() ; entity.setContentType(ct.getContentType()) ; return entity ; }
/** Create an HttpEntity for the graph */ protected static HttpEntity graphToHttpEntity(final Graph graph) { final RDFFormat syntax = RDFFormat.TURTLE_BLOCKS ; ContentProducer producer = new ContentProducer() { @Override public void writeTo(OutputStream out) { RDFDataMgr.write(out, graph, syntax) ; } } ; EntityTemplate entity = new EntityTemplate(producer) ; ContentType ct = syntax.getLang().getContentType() ; entity.setContentType(ct.getContentType()) ; return entity ; }
/** Create an HttpEntity for the graph */ protected static HttpEntity graphToHttpEntity(final Graph graph) { final RDFFormat syntax = RDFFormat.TURTLE_BLOCKS ; ContentProducer producer = new ContentProducer() { @Override public void writeTo(OutputStream out) { RDFDataMgr.write(out, graph, syntax) ; } } ; EntityTemplate entity = new EntityTemplate(producer) ; ContentType ct = syntax.getLang().getContentType() ; entity.setContentType(ct.getContentType()) ; return entity ; } }
/** Create an HttpEntity for the graph */ protected static HttpEntity graphToHttpEntity(final Graph graph) { final RDFFormat syntax = RDFFormat.TURTLE_BLOCKS ; ContentProducer producer = new ContentProducer() { @Override public void writeTo(OutputStream out) { RDFDataMgr.write(out, graph, syntax) ; } } ; EntityTemplate entity = new EntityTemplate(producer) ; ContentType ct = syntax.getLang().getContentType() ; entity.setContentType(ct.getContentType()) ; return entity ; } }
body.setContentType("text/html; charset=UTF-8"); response.setEntity(body);