Writes RDF statements to an RDF/XML file.
The RdfXmlWriter buffers the entire output document in memory, before writing the document to the stream when Close is called.
The namespaces used in the output data must be registered with the NamespaceManager in the RdfWriter.Namespaces property before the first call to Add. Failure to do so may prevent the document from being written to the stream, as not all URIs can be automatically converted into an XML qualified name.
The following example writes out RDF statements in RDF/XML format to a file:
C# Example using (RdfXmlWriter output = new RdfXmlWriter("filename.rdf")) { output.Namespaces.AddNamespace("http://xmlns.com/foaf/0.1/", "foaf"); output.BaseUri = "http://www.example.org/"; output.Write(datasource); }All constructors for the RdfXmlWriter have a couterpart with an additional parameter for a SemWeb.RdfXmlWriter.Options object that specifies formatting parameters for the output. When an Options object is not used, RdfXmlWriter.Options.Full is used. This parameter can be used with the RdfXmlWriter.Options.XMP field to ensure the resulting XML document conforms to the Adobe XMP specification.
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.6.0, 1.0.6.2
See Also: Inherited members from RdfWriter.
⊟ Public Constructors
Creates an RDF/XML writer that writes to the given TextWriter. Creates an RDF/XML writer that writes to the named file. Creates an RDF/XML writer that writes to the given XmlDocument. Creates an RDF/XML writer that writes to the given XmlWriter. Creates an RDF/XML writer that writes to the given TextWriter with output style options. Creates an RDF/XML writer that writes to the named file with output style options. Creates an RDF/XML writer that writes to the given XmlDocument with output style options. Creates an RDF/XML writer that writes to the given XmlWriter with output style options. ⊟ Public Properties
BaseUri string . Gets or sets the base URI for the output document. (Inherited from RdfWriter.) [read-only] abstractNamespaces NamespaceManager . The NamespaceManager that manages namespace URIs and their prefixes. (Inherited from RdfWriter.) ⊟ Public Methods
⊟ Protected Methods
GetResourceKey (Resource) : object See Store.GetResourceKey(Resource). (Inherited from RdfWriter.)SetResourceKey (Resource, object) See Store.SetResourceKey(Resource). (Inherited from RdfWriter.)⊟ Explicitly Implemented Interface Members
SemWeb.StatementSink.Add Documentation for this section has not yet been entered. (Inherited from RdfWriter.) IDisposable.Dispose Documentation for this section has not yet been entered. (Inherited from RdfWriter.)
⊟ RdfXmlWriter Constructor
Creates an RDF/XML writer that writes to the given TextWriter.
public RdfXmlWriter (System.IO.TextWriter writer)⊟ Parameters
- writer
- A TextWriter.
⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.6.2
⊟ RdfXmlWriter Constructor
Creates an RDF/XML writer that writes to the named file.
public RdfXmlWriter (string file)⊟ Parameters
- file
- A file name, or "-" for standard output.
⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.6.2
⊟ RdfXmlWriter Constructor
Creates an RDF/XML writer that writes to the given XmlDocument.
public RdfXmlWriter (System.Xml.XmlDocument dest)⊟ Parameters
- dest
- A new, empty XmlDocument.
⊟ Remarks
The document must be empty.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.6.2
⊟ RdfXmlWriter Constructor
Creates an RDF/XML writer that writes to the given XmlWriter.
public RdfXmlWriter (System.Xml.XmlWriter writer)⊟ Parameters
- writer
- An XmlWriter.
⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.6.2
⊟ RdfXmlWriter Constructor
Creates an RDF/XML writer that writes to the given TextWriter with output style options.
public RdfXmlWriter (System.IO.TextWriter writer, RdfXmlWriter.Options style)⊟ Parameters
- writer
- A TextWriter.
- style
- An instance of SemWeb.RdfXmlWriter.Options providing options for how the output document should be formatted.
⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.6.2
⊟ RdfXmlWriter Constructor
Creates an RDF/XML writer that writes to the named file with output style options.
public RdfXmlWriter (string file, RdfXmlWriter.Options style)⊟ Parameters
- file
- A file name, or "-" for standard output.
- style
- An instance of SemWeb.RdfXmlWriter.Options providing options for how the output document should be formatted.
⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.6.2
⊟ RdfXmlWriter Constructor
Creates an RDF/XML writer that writes to the given XmlDocument with output style options.
public RdfXmlWriter (System.Xml.XmlDocument dest, RdfXmlWriter.Options style)⊟ Parameters
- dest
- A new, empty XmlDocument.
- style
- An instance of SemWeb.RdfXmlWriter.Options providing options for how the output document should be formatted.
⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.6.2
⊟ RdfXmlWriter Constructor
Creates an RDF/XML writer that writes to the given XmlWriter with output style options.
public RdfXmlWriter (System.Xml.XmlWriter writer, RdfXmlWriter.Options style)⊟ Parameters
- writer
- An XmlWriter.
- style
- An instance of SemWeb.RdfXmlWriter.Options providing options for how the output document should be formatted.
⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.6.2