Click or drag to resize

UriLoaderLoad Method (IGraph, Uri)

Attempts to load a RDF Graph from the given URI into the given Graph.

Namespace:  VDS.RDF.Parsing
Assembly:  dotNetRDF (in dotNetRDF.dll) Version:
Syntax
public static void Load(
	IGraph g,
	Uri u
)

Parameters

g
Type: VDS.RDFIGraph
Graph to assert Triples in.
u
Type: SystemUri
URI to attempt to get RDF from.
Remarks

Attempts to select the relevant Parser based on the Content Type header returned in the HTTP Response.

If you know ahead of time the Content Type you can just open a HTTP Stream yourself and pass it to an instance of the correct Parser.

In the event that the URI is a File URI the FileLoader will be used instead. If the URI is a Data URI then the DataUriLoader will be used instead.

Note: UriLoader will assign the Graph the source URI as it's Base URI unless the Graph already has a Base URI or is non-empty prior to attempting parsing. Note that any Base URI specified in the RDF contained in the file will override this initial Base URI. In some cases this may lead to invalid RDF being accepted and generating strange relative URIs, if you encounter this either set a Base URI prior to calling this method or create an instance of the relevant parser and invoke it directly.

See Also