Show / Hide Table of Contents

Class BaseRdfWriter

Base implementation of IRdfWriter that simply handles the logic of optionally closing a text writer stream.

Inheritance
object
BaseRdfWriter
BaseGZipWriter
CompressingTurtleWriter
CsvWriter
GraphVizWriter
NTriplesWriter
Notation3Writer
PrettyRdfXmlWriter
RdfJsonWriter
RdfXmlWriter
TsvWriter
TurtleWriter
Implements
IRdfWriter
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 abstract class BaseRdfWriter : IRdfWriter

Methods

| Edit this page View Source

Save(IGraph, TextWriter)

Method for Saving a Graph to a Concrete RDF Syntax via some arbitrary TextWriter.

Declaration
public void Save(IGraph g, TextWriter output)
Parameters
Type Name Description
IGraph g

The Graph to Save.

TextWriter output

The TextWriter to save the Graph to.

Exceptions
Type Condition
RdfException

Thrown if the RDF in the Graph is not representable by the Writer.

IOException

Thrown if the Writer is unable to write to the underlying storage of the TextWriter specified in the output.

| Edit this page View Source

Save(IGraph, TextWriter, bool)

Method for saving a graph to a concrete RDF syntax via some arbitrary TextWriter.

Declaration
public void Save(IGraph g, TextWriter output, bool leaveOpen)
Parameters
Type Name Description
IGraph g

The graph to save.

TextWriter output

The TextWriter to save the graph to.

bool leaveOpen
true
to leave the stream open when the method completes;.
false
otherwise.
Exceptions
Type Condition
RdfException

Thrown if the RDF in the graph is not representable by the writer.

IOException

Thrown if the writer is unable to write to the underlying storage of the TextWriter specified in the output.

| Edit this page View Source

Save(IGraph, string)

Method for Saving a Graph to a Concrete RDF Syntax in a file based format.

Declaration
public virtual void Save(IGraph g, string filename)
Parameters
Type Name Description
IGraph g

The Graph to Save.

string filename

The filename to save the Graph in.

Remarks

The output will be written in UTF-8 with no byte-order mark specified. To override this behaviour, call either Save(IGraph, string, Encoding) with the specific encoding to use, or Save(IGraph, TextWriter) with a TextWriter created with the required text encoding set.

Exceptions
Type Condition
RdfException

Thrown if the RDF in the Graph is not representable by the Writer.

IOException

Thrown if the Writer is unable to write to the File.

| Edit this page View Source

Save(IGraph, string, Encoding)

Method for saving a graph to a concrete RDF syntax in a file-based format with a specific text encoding.

Declaration
public virtual void Save(IGraph g, string filename, Encoding fileEncoding)
Parameters
Type Name Description
IGraph g

The graph to save.

string filename

The path to the file to write to.

Encoding fileEncoding

The text encoding to use when writing the file content.

Exceptions
Type Condition
RdfException

Thrown if the RDF in the Graph is not representable by the Writer.

IOException

Thrown if the Writer is unable to write to the File.

| Edit this page View Source

SaveInternal(IGraph, TextWriter)

Method to be implemented in derived classes to perform the actual writing to a TextWriter.

Declaration
protected abstract void SaveInternal(IGraph graph, TextWriter output)
Parameters
Type Name Description
IGraph graph

The graph to be saved.

TextWriter output

The TextWriter to save the graph to.

Events

| Edit this page View Source

Warning

Event which writers can raise to indicate possible ambiguities or issues in the syntax they are producing

Declaration
public abstract event RdfWriterWarning Warning
Event Type
Type Description
RdfWriterWarning

Implements

IRdfWriter

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Methods
    • Save(IGraph, TextWriter)
    • Save(IGraph, TextWriter, bool)
    • Save(IGraph, string)
    • Save(IGraph, string, Encoding)
    • SaveInternal(IGraph, TextWriter)
  • Events
    • Warning
  • Implements
  • Extension Methods
Back to top Generated by DocFX