Click or drag to resize

GraphExtensionsLoadFromFile Method (IGraph, String, IRdfReader)

Loads RDF data from a file into a Graph.

Namespace:  VDS.RDF
Assembly:  dotNetRDF (in dotNetRDF.dll) Version:
public static void LoadFromFile(
	this IGraph g,
	string file,
	IRdfReader parser


Type: VDS.RDFIGraph
Graph to load into.
Type: SystemString
File to load from.
Type: VDS.RDFIRdfReader
Parser to use.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IGraph. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

This is just a shortcut to using the static Load() methods from the FileLoader class located in the Parsing namespace.

Note: FileLoader will assign the Graph a file 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.

If a File URI is assigned it will always be an absolute URI for the file.

See Also