|
|
@ -51,7 +51,7 @@ impl QueryResult { |
|
|
|
/// assert_eq!(results, "{\"head\":{\"vars\":[\"s\"]},\"results\":{\"bindings\":[{\"s\":{\"type\":\"uri\",\"value\":\"http://example.com\"}}]}}".as_bytes());
|
|
|
|
/// assert_eq!(results, "{\"head\":{\"vars\":[\"s\"]},\"results\":{\"bindings\":[{\"s\":{\"type\":\"uri\",\"value\":\"http://example.com\"}}]}}".as_bytes());
|
|
|
|
/// # oxigraph::Result::Ok(())
|
|
|
|
/// # oxigraph::Result::Ok(())
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
pub fn write(self, writer: &mut impl Write, syntax: QueryResultSyntax) -> Result<()> { |
|
|
|
pub fn write(self, writer: impl Write, syntax: QueryResultSyntax) -> Result<()> { |
|
|
|
match syntax { |
|
|
|
match syntax { |
|
|
|
QueryResultSyntax::Xml => write_xml_results(self, writer), |
|
|
|
QueryResultSyntax::Xml => write_xml_results(self, writer), |
|
|
|
QueryResultSyntax::Json => write_json_results(self, writer), |
|
|
|
QueryResultSyntax::Json => write_json_results(self, writer), |
|
|
@ -78,7 +78,7 @@ impl QueryResult { |
|
|
|
/// assert_eq!(results, graph);
|
|
|
|
/// assert_eq!(results, graph);
|
|
|
|
/// # oxigraph::Result::Ok(())
|
|
|
|
/// # oxigraph::Result::Ok(())
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
pub fn write_graph(self, write: &mut impl Write, syntax: GraphSyntax) -> Result<()> { |
|
|
|
pub fn write_graph(self, write: impl Write, syntax: GraphSyntax) -> Result<()> { |
|
|
|
if let QueryResult::Graph(triples) = self { |
|
|
|
if let QueryResult::Graph(triples) = self { |
|
|
|
match syntax { |
|
|
|
match syntax { |
|
|
|
GraphSyntax::NTriples => { |
|
|
|
GraphSyntax::NTriples => { |
|
|
|