Show / Hide Table of Contents

Class TriGWriter

Class for writing a Triple Store in named Graph TriG syntax to a file/stream.

Inheritance
object
BaseStoreWriter
TriGWriter
Implements
IStoreWriter
IHighSpeedWriter
IPrettyPrintingWriter
ICompressingWriter
IMultiThreadedWriter
Inherited Members
BaseStoreWriter.Save(ITripleStore, string)
BaseStoreWriter.Save(ITripleStore, string, Encoding)
BaseStoreWriter.Save(ITripleStore, TextWriter)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: VDS.RDF.Writing
Assembly: dotNetRdf.dll
Syntax
public class TriGWriter : BaseStoreWriter, IStoreWriter, IHighSpeedWriter, IPrettyPrintingWriter, ICompressingWriter, IMultiThreadedWriter
Remarks

For efficiency the TriG Writer splits it's writing over several threads (currently 4), these threads share a reference to a Context object which gives Global writing context eg. the target TextWriter being written to. Each thread generates temporary local writing contexts as it goes along, each of these is scoped to writing a specific Graph. Graphs are written to a StringWriter so the output for each Graph is built completely and then written in one go to the TextWriter specified as the target of the writing in the global context.

Properties

| Edit this page View Source

CompressionLevel

Gets/Sets the Compression Level for the writer.

Declaration
public int CompressionLevel { get; set; }
Property Value
Type Description
int
| Edit this page View Source

HighSpeedModePermitted

Gets/Sets whether High Speed Write Mode is permitted.

Declaration
public bool HighSpeedModePermitted { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

N3CompatibilityMode

Gets/Sets whether N3 Compatibility Mode is used, in this mode an = is written after Graph Names so an N3 parser can read the TriG file correctly.

Declaration
public bool N3CompatibilityMode { get; set; }
Property Value
Type Description
bool
Remarks

Defaults to false from the 0.4.1 release onwards.

| Edit this page View Source

PrettyPrintMode

Gets/Sets whether Pretty Printing is used.

Declaration
public bool PrettyPrintMode { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

Syntax

Get/Sets the syntax mode for the writer.

Declaration
public TriGSyntax Syntax { get; set; }
Property Value
Type Description
TriGSyntax
| Edit this page View Source

UseMultiThreadedWriting

Gets/Sets whether multi-threaded writing will be used to generate output faster.

Declaration
public bool UseMultiThreadedWriting { get; set; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

Save(ITripleStore, TextWriter, bool)

Saves a Store in TriG (Turtle with Named Graphs) format.

Declaration
public override void Save(ITripleStore store, TextWriter writer, bool leaveOpen)
Parameters
Type Name Description
ITripleStore store

Store to save.

TextWriter writer

Writer to save to.

bool leaveOpen

Boolean flag indicating if writer should be left open after the store is saved.

Overrides
BaseStoreWriter.Save(ITripleStore, TextWriter, bool)
| Edit this page View Source

ToString()

Gets the String representation of the writer which is a description of the syntax it produces.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

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 override event StoreWriterWarning Warning
Event Type
Type Description
StoreWriterWarning
Overrides
BaseStoreWriter.Warning

Implements

IStoreWriter
IHighSpeedWriter
IPrettyPrintingWriter
ICompressingWriter
IMultiThreadedWriter

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Properties
    • CompressionLevel
    • HighSpeedModePermitted
    • N3CompatibilityMode
    • PrettyPrintMode
    • Syntax
    • UseMultiThreadedWriting
  • Methods
    • Save(ITripleStore, TextWriter, bool)
    • ToString()
  • Events
    • Warning
  • Implements
  • Extension Methods
Back to top Generated by DocFX