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 SemWeb.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, SemWeb.RdfXmlWriter.Options.Full is used. This parameter can be used with the SemWeb.RdfXmlWriter.Options.XMP field to ensure the resulting XML document conforms to the Adobe XMP specification.
See Also: Inherited members from RdfWriter.
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. |
BaseUri
|
string . Gets or sets the base URI for the output document. (Inherited from RdfWriter.) |
Namespaces
[read-only]
abstract |
NamespaceManager . The NamespaceManager that manages namespace URIs and their prefixes. (Inherited from RdfWriter.) |
abstract |
Add
(Statement) Writes a statement to the stream. (Inherited from RdfWriter.) |
Close
() Completes writing the data and closes the stream. (Inherited from RdfWriter.) |
|
Write
(StatementSource) Writes out the contents of the StatementSource. (Inherited from RdfWriter.) |
GetResourceKey
(Resource) See SemWeb.Store.GetResourceKey(SemWeb.Resource). (Inherited from RdfWriter.) |
|
SetResourceKey
(Resource, object) See SemWeb.Store.SetResourceKey(SemWeb.Resource). (Inherited from RdfWriter.) |
Creates an RDF/XML writer that writes to the named file.
Creates an RDF/XML writer that writes to the given TextWriter.
Creates an RDF/XML writer that writes to the given XmlWriter.
Creates an RDF/XML writer that writes to the given XmlDocument.
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 TextWriter 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.