Class TriGWriter
Class for writing a Triple Store in named Graph TriG syntax to a file/stream.
Implements
Inherited Members
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 SourceCompressionLevel
Gets/Sets the Compression Level for the writer.
Declaration
public int CompressionLevel { get; set; }
Property Value
Type | Description |
---|---|
int |
HighSpeedModePermitted
Gets/Sets whether High Speed Write Mode is permitted.
Declaration
public bool HighSpeedModePermitted { get; set; }
Property Value
Type | Description |
---|---|
bool |
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.
PrettyPrintMode
Gets/Sets whether Pretty Printing is used.
Declaration
public bool PrettyPrintMode { get; set; }
Property Value
Type | Description |
---|---|
bool |
Syntax
Get/Sets the syntax mode for the writer.
Declaration
public TriGSyntax Syntax { get; set; }
Property Value
Type | Description |
---|---|
TriGSyntax |
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 SourceSave(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 |
Overrides
| Edit this page View SourceToString()
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
Events
| Edit this page View SourceWarning
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 |