Class StringWriter
Static Helper class for the writing of RDF Graphs and SPARQL Result Sets to Strings rather than Streams/Files.
Inherited Members
Namespace: VDS.RDF.Writing
Assembly: dotNetRdf.dll
Syntax
public static class StringWriter
Methods
| Edit this page View SourceWrite(IGraph, IRdfWriter)
Writes the Graph to a String and returns the output in your chosen concrete RDF Syntax.
Declaration
public static string Write(IGraph g, IRdfWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to save. |
IRdfWriter | writer | Writer to use to generate the concrete RDF Syntax. |
Returns
Type | Description |
---|---|
string |
Remarks
Since the API allows for any TextWriter to be passed to the Save() method of a IRdfWriter you can just pass in a StringWriter to the Save() method to get the output as a String. This method simply provides a wrapper to doing just that.
Write(ITripleStore, IStoreWriter)
Writes the given Triple Store to a String and returns the output in your chosen concrete RDF dataset syntax.
Declaration
public static string Write(ITripleStore store, IStoreWriter writer)
Parameters
Type | Name | Description |
---|---|---|
ITripleStore | store | Triple Store. |
IStoreWriter | writer | Writer to use to generate conrete RDF Syntax. |
Returns
Type | Description |
---|---|
string |
Write(SparqlResultSet, ISparqlResultsWriter)
Writes the SPARQL Result Set to a String and returns the Output in your chosen format.
Declaration
public static string Write(SparqlResultSet results, ISparqlResultsWriter writer)
Parameters
Type | Name | Description |
---|---|---|
SparqlResultSet | results | SPARQL Result Set. |
ISparqlResultsWriter | writer | Writer to use to generate the SPARQL Results output. |
Returns
Type | Description |
---|---|
string |