Click or drag to resize

TriGWriter Class

Class for writing a Triple Store in named Graph TriG syntax to a file/stream.
Inheritance Hierarchy
SystemObject
  VDS.RDF.WritingTriGWriter

Namespace:  VDS.RDF.Writing
Assembly:  dotNetRDF (in dotNetRDF.dll) Version:
Syntax
public class TriGWriter : IStoreWriter, IHighSpeedWriter, 
	IPrettyPrintingWriter, ICompressingWriter, IMultiThreadedWriter

The TriGWriter type exposes the following members.

Constructors
  NameDescription
Public methodTriGWriter
Initializes a new instance of the TriGWriter class
Top
Properties
  NameDescription
Public propertyCompressionLevel
Gets/Sets the Compression Level for the writer.
Public propertyHighSpeedModePermitted
Gets/Sets whether High Speed Write Mode is permitted.
Public propertyN3CompatabilityMode
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.
Public propertyPrettyPrintMode
Gets/Sets whether Pretty Printing is used.
Public propertyUseMultiThreadedWriting
Gets/Sets whether multi-threaded writing will be used to generate output faster.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSave(ITripleStore, TextWriter)
Saves a Store in TriG (Turtle with Named Graphs) format.
Public methodSave(ITripleStore, String)
Saves a Store in TriG (Turtle with Named Graphs) format.
Public methodSave(ITripleStore, TextWriter, Boolean)
Saves a Store in TriG (Turtle with Named Graphs) format.
Public methodToString
Gets the String representation of the writer which is a description of the syntax it produces.
(Overrides ObjectToString.)
Top
Events
  NameDescription
Public eventWarning
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
Top
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.

Thread Safety
Designed to be Thread Safe - should be able to call Save() from several threads with no issue. See Remarks for potential performance impact of this.
See Also