Show / Hide Table of Contents

Class PrettyRdfXmlWriter

Class for generating RDF/XML Concrete Syntax.

Inheritance
System.Object
BaseRdfWriter
PrettyRdfXmlWriter
Implements
IRdfWriter
IPrettyPrintingWriter
ICompressingWriter
IDtdWriter
INamespaceWriter
IFormatterBasedWriter
IAttributeWriter
Inherited Members
BaseRdfWriter.Save(IGraph, string)
BaseRdfWriter.Save(IGraph, string, Encoding)
BaseRdfWriter.Save(IGraph, TextWriter)
BaseRdfWriter.Save(IGraph, TextWriter, bool)
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 PrettyRdfXmlWriter : BaseRdfWriter, IRdfWriter, IPrettyPrintingWriter, ICompressingWriter, IDtdWriter, INamespaceWriter, IFormatterBasedWriter, IAttributeWriter
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

Constructors

| Improve this Doc View Source

PrettyRdfXmlWriter()

Creates a new RDF/XML Writer.

Declaration
public PrettyRdfXmlWriter()
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

| Improve this Doc View Source

PrettyRdfXmlWriter(int, bool, bool)

Creates a new RDF/XML Writer.

Declaration
public PrettyRdfXmlWriter(int compressionLevel, bool useDtd, bool useAttributes)
Parameters
Type Name Description
int compressionLevel

Compression Level.

System.Boolean useDtd

Whether to use DTDs to further compress output.

System.Boolean useAttributes

Whether to use attributes to encode triples with simple literal objects where possible.

Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

| Improve this Doc View Source

PrettyRdfXmlWriter(int, bool)

Creates a new RDF/XML Writer.

Declaration
public PrettyRdfXmlWriter(int compressionLevel, bool useDtd)
Parameters
Type Name Description
int compressionLevel

Compression Level.

System.Boolean useDtd

Whether to use DTDs to further compress output.

Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

| Improve this Doc View Source

PrettyRdfXmlWriter(int)

Creates a new RDF/XML Writer.

Declaration
public PrettyRdfXmlWriter(int compressionLevel)
Parameters
Type Name Description
int compressionLevel

Compression Level.

Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

Properties

| Improve this Doc View Source

CompressionLevel

Gets/Sets the Compression Level in use.

Declaration
public int CompressionLevel { get; set; }
Property Value
Type Description
int
Remarks

Compression Level defaults to High - if Compression Level is set to below More i.e. < 5 then Collections will not be compressed into more compact syntax.

| Improve this Doc View Source

DefaultNamespaces

Gets/Sets the Default Namespaces that are always available.

Declaration
public INamespaceMapper DefaultNamespaces { get; set; }
Property Value
Type Description
INamespaceMapper
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

| Improve this Doc View Source

PrettyPrintMode

Gets/Sets Pretty Print Mode for the Writer.

Declaration
public bool PrettyPrintMode { get; set; }
Property Value
Type Description
System.Boolean
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

| Improve this Doc View Source

TripleFormatterType

Gets the type of the Triple Formatter used by the writer.

Declaration
public Type TripleFormatterType { get; }
Property Value
Type Description
System.Type
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

| Improve this Doc View Source

UseAttributes

Gets/Sets whether triples which have a literal object will be expressed as attributes rather than elements where possible (defaults to true).

Declaration
public bool UseAttributes { get; set; }
Property Value
Type Description
System.Boolean
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

| Improve this Doc View Source

UseDtd

Gets/Sets whether DTDs are used in the output.

Declaration
public bool UseDtd { get; set; }
Property Value
Type Description
System.Boolean
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

Methods

| Improve this Doc View Source

SaveInternal(IGraph, TextWriter)

Saves a Graph to an arbitrary output stream.

Declaration
protected override void SaveInternal(IGraph g, TextWriter output)
Parameters
Type Name Description
IGraph g

Graph to save.

System.IO.TextWriter output

Stream to save to.

Overrides
BaseRdfWriter.SaveInternal(IGraph, TextWriter)
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

| Improve this Doc 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()
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

Events

| Improve this Doc View Source

Warning

Event which is raised when there is a non-fatal issue with the RDF being output

Declaration
public override event RdfWriterWarning Warning
Event Type
Type Description
RdfWriterWarning
Overrides
BaseRdfWriter.Warning
Remarks

This is a fast writer based on the fast writing technique used in the other non-RDF/XML Writers.

Note: If the Graph to be serialized makes heavy use of collections it may result in a StackOverflowException. To address this set the CompressionLevel property to < 5.

Implements

IRdfWriter
IPrettyPrintingWriter
ICompressingWriter
IDtdWriter
INamespaceWriter
IFormatterBasedWriter
IAttributeWriter

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • PrettyRdfXmlWriter()
    • PrettyRdfXmlWriter(int, bool, bool)
    • PrettyRdfXmlWriter(int, bool)
    • PrettyRdfXmlWriter(int)
  • Properties
    • CompressionLevel
    • DefaultNamespaces
    • PrettyPrintMode
    • TripleFormatterType
    • UseAttributes
    • UseDtd
  • Methods
    • SaveInternal(IGraph, TextWriter)
    • ToString()
  • Events
    • Warning
  • Implements
  • Extension Methods
Back to top Generated by DocFX