Class StringWriter
Static Helper class for the writing of RDF Graphs and SPARQL Result Sets to Strings rather than Streams/Files.
Inheritance
System.Object
StringWriter
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF.Writing
Assembly: dotNetRDF.dll
Syntax
public static class StringWriter
Methods
| Improve this Doc 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 |
---|---|
System.String |
Remarks
Since the API allows for any System.IO.TextWriter to be passed to the Save(IGraph, TextWriter) 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.
|
Improve this Doc
View Source
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 |
---|---|
System.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 |
---|---|
System.String |