SemWeb.N3Writer

SemWeb : SemWeb Namespace
N3Writer Class

Writes out RDF statements to a stream in Notation 3, Turtle (the default), or NTriples format.

public class N3Writer : RdfWriter, CanForgetBNodes

#### Remarks

The following example writes out RDF statements in Turtle format to a file:

C# Example
    using (N3Writer output = new N3Writer("filename.n3")) {
        store.Write(data);
    }

## Members

See Also: Inherited members from RdfWriter.

### Constructors

N3Writer (System.IO.TextWriter) Creates an N3Writer that outputs statements to a TextWriter.
N3Writer (string) Creates an N3Writer that outputs statements to a file.

### Properties

BaseUri | string . Gets or sets the base URI for the output document. (Inherited from RdfWriter.)
Format | N3Writer.Formats . Sets the format for output to Notation3, Turtle, or NTriples.
Namespaces [read-only] abstract | NamespaceManager . The NamespaceManager that manages namespace URIs and their prefixes. (Inherited from RdfWriter.)

### Methods

abstract | Add (Statement) Writes a statement to the stream. (Inherited from RdfWriter.)
| Close () Completes writing the data and closes the stream. (Inherited from RdfWriter.)
| Write (StatementSource) Writes out the contents of the StatementSource. (Inherited from RdfWriter.)

### Protected Methods

| GetResourceKey (Resource) : object See SemWeb.Store.GetResourceKey(SemWeb.Resource). (Inherited from RdfWriter.)
| SetResourceKey (Resource, object) See SemWeb.Store.SetResourceKey(SemWeb.Resource). (Inherited from RdfWriter.)

## Member Details

### N3Writer Constructor

public N3Writer (string file)

Creates an N3Writer that outputs statements to a file.

#### Parameters

file
  The path to a file where the statements will be stored, or "-" to output to Console.Out.

#### Remarks

None.

### N3Writer Constructor

public N3Writer (System.IO.TextWriter writer)

Creates an N3Writer that outputs statements to a TextWriter.

#### Parameters

writer
  The TextWriter to which statements will be written.

#### Remarks

None.

### Format Property

public N3Writer.Formats Format { set; get; }

Sets the format for output to Notation3, Turtle, or NTriples.

#### Value

A value from SemWeb.N3Writer.Formats that specifies the output format.

#### Remarks

The default format is Turtle.