Class TriGWriter
Class for writing a Triple Store in named Graph TriG syntax to a file/stream.
Inheritance
System.Object
TriGWriter
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: VDS.RDF.Writing
Assembly: dotNetRDF.dll
Syntax
public class TriGWriter : 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 |
---|---|
System.Int32 |
HighSpeedModePermitted
Gets/Sets whether High Speed Write Mode is permitted.
Declaration
public bool HighSpeedModePermitted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
N3CompatabilityMode
Gets/Sets whether N3 Compatability 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 N3CompatabilityMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Defaults to false from the 0.4.1 release onwards.
|
Improve this Doc
View Source
PrettyPrintMode
Gets/Sets whether Pretty Printing is used.
Declaration
public bool PrettyPrintMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
Methods
| Improve this Doc View SourceSave(ITripleStore, TextWriter)
Saves a Store in TriG (Turtle with Named Graphs) format.
Declaration
public void Save(ITripleStore store, TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
ITripleStore | store | Store to save. |
System.IO.TextWriter | writer | Writer to save to. |
Save(ITripleStore, TextWriter, Boolean)
Saves a Store in TriG (Turtle with Named Graphs) format.
Declaration
public 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 writer should be left open after the store is saved. |
Save(ITripleStore, String)
Saves a Store in TriG (Turtle with Named Graphs) format.
Declaration
public void Save(ITripleStore store, string filename)
Parameters
Type | Name | Description |
---|---|---|
ITripleStore | store | Store to save. |
System.String | filename | File to save to. |
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 |
---|---|
System.String |
Overrides
System.Object.ToString()
Events
| Improve this Doc View SourceWarning
Event which is raised when there is an issue with the Graphs being serialized that doesn't prevent serialization but the user should be aware of
Declaration
public event StoreWriterWarning Warning
Event Type
Type | Description |
---|---|
StoreWriterWarning |