Class DataUriLoader
A Class for parsing RDF data from Data URIs.
Inherited Members
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public static class DataUriLoader
Remarks
Data URIs use the data: scheme and are defined by the IETF in RFC 2397 and provide a means to embed data directly in a URI either in Base64 or ASCII encoded format. This class can extract the data from such URIs and attempt to parse it as RDF using the StringParser.
The parsing process for data: URIs involves first extracting and decoding the data embedded in the URI - this may either be in Base64 or ASCII encoding - and then using the StringParser to actually parse the data string. If the data: URI defines a MIME type then a parser is selected (if one exists for the given MIME type) and that is used to parse the data, in the event that no MIME type is given or the one given does not have a corresponding parser then the StringParser will use its basic heuristics to attempt to auto-detect the format and select an appropriate parser.
If you attempt to use this loader for non data: URIs then the standard UriLoader is used instead.
Methods
| Edit this page View SourceLoad(IGraph, Uri)
Loads RDF data into a Graph from a data: URI.
Declaration
public static void Load(IGraph g, Uri u)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
Uri | u | URI to load from. |
Remarks
Invokes the normal UriLoader instead if a the URI provided is not a data: URI.
Exceptions
Type | Condition |
---|---|
UriFormatException | Thrown if the metadata portion of the URI which indicates the MIME Type, Character Set and whether Base64 encoding is used is malformed. |
Load(IRdfHandler, Uri)
Loads RDF data using an RDF Handler from a data: URI.
Declaration
public static void Load(IRdfHandler handler, Uri u)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler. |
Uri | u | URI to load from. |
Remarks
Invokes the normal UriLoader instead if a the URI provided is not a data: URI.
Exceptions
Type | Condition |
---|---|
UriFormatException | Thrown if the metadata portion of the URI which indicates the MIME Type, Character Set and whether Base64 encoding is used is malformed. |