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 System.IO.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 System.IO.TextWriter specified as the target of the writing in the global context.
Properties
| Improve this Doc View SourceCompressionLevel
Gets/Sets the Compression Level for the writer.
Declaration
public int CompressionLevel { get; set; }
Property Value
Type | Description |
---|---|
int |
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 System.IO.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 System.IO.TextWriter specified as the target of the writing in the global context.
HighSpeedModePermitted
Gets/Sets whether High Speed Write Mode is permitted.
Declaration
public bool HighSpeedModePermitted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 System.IO.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 System.IO.TextWriter specified as the target of the writing in the global context.
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 System.IO.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 System.IO.TextWriter specified as the target of the writing in the global context.
Syntax
Get/Sets the syntax mode for the writer.
Declaration
public TriGSyntax Syntax { get; set; }
Property Value
Type | Description |
---|---|
TriGSyntax |
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 System.IO.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 System.IO.TextWriter specified as the target of the writing in the global context.
UseMultiThreadedWriting
Gets/Sets whether multi-threaded writing will be used to generate output faster.
Declaration
public bool UseMultiThreadedWriting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 System.IO.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 System.IO.TextWriter specified as the target of the writing in the global context.
Methods
| Improve this Doc 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. |
System.IO.TextWriter | writer | Writer to save to. |
System.Boolean | leaveOpen | Boolean flag indicating if |
Overrides
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 System.IO.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 System.IO.TextWriter specified as the target of the writing in the global context.
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
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 System.IO.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 System.IO.TextWriter specified as the target of the writing in the global context.
Events
| Improve this Doc 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 |
Overrides
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 System.IO.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 System.IO.TextWriter specified as the target of the writing in the global context.