The base class of types that read statements from streams.
|
This is an abstract class. Two subclasses are provided: SemWeb.N3Reader and SemWeb.RdfXmlReader.
SemWeb.RdfReader.LoadFromUri(System.Uri) can be used to load RDF data, in either N3 or XML format, from a web address.
SemWeb.RdfReader.Create(string,string) can be used to create a reader in the factory paradigm.
See Also: Inherited members from object.
RdfReader
() The protected no-arg constructor used by derived classes. |
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. |
Meta
|
Entity . An entity to assign as the meta entity for statements loaded by this reader. |
Namespaces [read-only] | NamespaceManager . Gets the NamespaceManager that contains all of the namespace-prefix mappings used in the input stream. |
ReuseEntities
|
bool . Determines whether the reader must reuse Entity objects that it creates. |
Variables [read-only] | System.Collections.Generic.ICollection<SemWeb.Variable> . A list of SemWeb.Variables found in the stream. |
Warnings [read-only] | System.Collections.Generic.ICollection<System.String> . Gets a list of warnings generated while parsing the input stream. |
static |
Create
(string, string) Creates a RdfReader in the factory paradigm for the given file. |
static |
Create
(string, System.IO.Stream) Creates a RdfReader in the factory paradigm for the given Stream. |
Dispose
() Disposes the reader. |
|
static |
LoadFromUri
(Uri) Loads an RDF document from the Internet. |
abstract |
Select
(StatementSink) Reads the stream into the statement sink. |
AddVariable
(Variable) Adds a Variable to the Variables collection. |
|
OnWarning
(string) Implementors of RdfReader may call this method to indicate a parsing warning. |
The protected no-arg constructor used by derived classes.
Disposes the reader.
Creates a RdfReader in the factory paradigm for the given file.
The type of reader returned is given in the following table.
type | Reader |
---|---|
"xml", "text/xml", "application/xml", "application/rdf+xml" | SemWeb.RdfXmlReader |
"n3", "text/n3", "application/n3", "application/turtle", "application/x-turtle" | SemWeb.N3Reader |
An entity to assign as the meta entity for statements loaded by this reader.
The value of this property is used as the meta argument in calls to the Statement constructor SemWeb.Statement(SemWeb.Entity,SemWeb.Entity,SemWeb.Resource,SemWeb.Entity). The use of SemWeb.Statement.Meta is up to the application.
The default value of this property is SemWeb.Statement.DefaultMeta, which is also the meta value used in the three-arg constructor for SemWeb.Statement. If the meta field is not important for the application, this field should be left unchanged.
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.
Implementors of RdfReader may call this method to indicate a parsing warning.
A list of SemWeb.Variables found in the stream.
Reads the stream into the statement sink.
Determines whether the reader must reuse Entity objects that it creates.
Loads an RDF document from the Internet.
The document is fetched with System.Net.WebRequest and must be in RDF/XML or Notation3 (NTriples/Turtle/N3) format.
The format of the document is detected as follows. If the document has a mime-type of text/xml, application/xml, application/rss+xml, or application/rdf+xml, the document is treated as an RDF/XML document. If the document has a mime-type of text/rdf+n3, application/n3, application/turtle, or application/x-turtle, the document is treated as a Notation3 document. If the mime-type is not recognized, the document's file name extension is checked. If it is .xml or .rss, it is treated as an RDF/XML document. If it is .n3, .ttl, or .nt, it is treated as a Notation3 document.
If the format could not be determined, a InvalidOperationException is thrown.
Gets the NamespaceManager that contains all of the namespace-prefix mappings used in the input stream.
Gets a list of warnings generated while parsing the input stream.
Adds a Variable to the Variables collection.
Creates a RdfReader in the factory paradigm for the given Stream.
The type of reader returned is given in the following table.
type | Reader |
---|---|
"xml", "text/xml", "application/xml", "application/rdf+xml" | SemWeb.RdfXmlReader |
"n3", "text/n3", "application/n3", "application/turtle", "application/x-turtle" | SemWeb.N3Reader |