Show / Hide Table of Contents

Class StringWriter

Static Helper class for the writing of RDF Graphs and SPARQL Result Sets to Strings rather than Streams/Files.

Inheritance
object
StringWriter
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Writing
Assembly: dotNetRdf.dll
Syntax
public static class StringWriter

Methods

| Edit this page View Source

Write(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.

| Edit this page 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
string
| Edit this page View Source

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
  • Edit this page
  • View Source
In this article
  • Methods
    • Write(IGraph, IRdfWriter)
    • Write(ITripleStore, IStoreWriter)
    • Write(SparqlResultSet, ISparqlResultsWriter)
Back to top Generated by DocFX