Reads RDF statements from an RDF/XML file.
|
The RdfXmlReader streams the statements to the StatementSink as they are read from the XML stream. The entire XML document will not be loaded into memory.
The following example reads a RDF/XML file from disk:
C# Example |
using (RdfReader data = new RdfXmlReader("filename.rdf")) { store.Import(data); } |
It is strongly recommended that you use one of the constructors that takes a Base URI argument, or else set the Base URI of the reader before reading statements from it, so that relative URIs found in the document can be interpreted. If a BaseURI has not been set and a relative URI is encountered, parsing the document will fail.
The stream is begun to be read as soon as the constructor is called. Any namespace declarations found on the document element of the RDF/XML document will be available in the SemWeb.RdfXmlReader.Namespaces property once the constructor returns. Once the document is fully read, all namespace declarations in the document are available in the SemWeb.RdfReader.Namespaces property and can be copied into the namespace manager of a SemWeb.RdfWriter using the SemWeb.NamespaceManager.AddFrom(SemWeb.NamespaceManager) method.
See Also: Inherited members from RdfReader.
Creates a parser from a stream. |
Creates a parser from a TextReader. |
Creates a parser for a file. |
Creates a parser for an XML document already loaded. |
Creates a parser for an XmlReader. |
Creates a parser from a stream with the given base URI. |
Creates a parser from a TextReader with the given base URI. |
Creates a parser from a file with the given base URI. |
BaseUri
|
string . The base URI for resolving relative URIs found in the stream. If a base URI is provided within the stream, this property may be updated to indicate the base URI found. (Inherited from RdfReader.) |
Meta
|
Entity . An entity to assign as the meta entity for statements loaded by this reader. (Inherited from RdfReader.) |
Namespaces [read-only] | NamespaceManager . Gets the NamespaceManager that contains all of the namespace-prefix mappings used in the input stream. (Inherited from RdfReader.) |
ReuseEntities
|
bool . Determines whether the reader must reuse Entity objects that it creates. (Inherited from RdfReader.) |
Variables [read-only] | System.Collections.Generic.ICollection<SemWeb.Variable> . A list of SemWeb.Variables found in the stream. (Inherited from RdfReader.) |
Warnings [read-only] | System.Collections.Generic.ICollection<System.String> . Gets a list of warnings generated while parsing the input stream. (Inherited from RdfReader.) |
Dispose
() Disposes the reader. (Inherited from RdfReader.) |
|
abstract |
Select
(StatementSink) Reads the stream into the statement sink. (Inherited from RdfReader.) |
Creates a parser for an XML document already loaded.
Creates a parser for an XmlReader.
Creates a parser from a TextReader.
Creates a parser from a stream.
Creates a parser for a file.
Creates a parser from a TextReader with the given base URI.
Creates a parser from a stream with the given base URI.
Creates a parser from a file with the given base URI.