Class FileLoader
Static Helper Class for loading RDF Files into Graphs/Triple Stores.
Inheritance
Inherited Members
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public static class FileLoader
Methods
| Improve this Doc View SourceLoad(IGraph, string, IRdfReader)
Loads the contents of the given File into a Graph using the given RDF Parser.
Declaration
public static void Load(IGraph g, string filename, IRdfReader parser)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
string | filename | File to load from. |
IRdf |
parser | Parser to use. |
Remarks
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.
Load(IGraph, string)
Loads the contents of the given File into a Graph providing the RDF format can be determined.
Declaration
public static void Load(IGraph g, string filename)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
string | filename | File to load from. |
Remarks
The File
Should this fail then the contents of the file will be read into a String, the String
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.
Load(IRdfHandler, string, IRdfReader)
Loads the contents of the given File using a RDF Handler using the given RDF Parser.
Declaration
public static void Load(IRdfHandler handler, string filename, IRdfReader parser)
Parameters
Type | Name | Description |
---|---|---|
IRdf |
handler | RDF Handler to use. |
string | filename | File to load from. |
IRdf |
parser | Parser to use. |
Remarks
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.
Load(IRdfHandler, string, IStoreReader)
Loads the contents of the given File using a RDF Handler providing the RDF dataset format can be determined.
Declaration
public static void Load(IRdfHandler handler, string filename, IStoreReader parser)
Parameters
Type | Name | Description |
---|---|---|
IRdf |
handler | RDF Handler to use. |
string | filename | File to load from. |
IStore |
parser | Parser to use to parse the given file. |
Remarks
If the parser
parameter is set to null then the File
Load(IRdfHandler, string)
Loads the contents of the given File using a RDF Handler providing the RDF format can be determined.
Declaration
public static void Load(IRdfHandler handler, string filename)
Parameters
Type | Name | Description |
---|---|---|
IRdf |
handler | RDF Handler to use. |
string | filename | File to load from. |
Remarks
The File
Should this fail then the contents of the file will be read into a String, the String
Load(ITripleStore, string, IStoreReader)
Loads the contents of the given File into a Triple Store providing the RDF dataset format can be determined.
Declaration
public static void Load(ITripleStore store, string filename, IStoreReader parser)
Parameters
Type | Name | Description |
---|---|---|
ITriple |
store | Triple Store to load into. |
string | filename | File to load from. |
IStore |
parser | Parser to use to parse the given file. |
Remarks
If the parser
parameter is set to null then the File
Load(ITripleStore, string)
Loads the contents of the given File into a Triple Store providing the RDF dataset format can be determined.
Declaration
public static void Load(ITripleStore store, string filename)
Parameters
Type | Name | Description |
---|---|---|
ITriple |
store | Triple Store to load into. |
string | filename | File to load from. |
Remarks
The File
LoadDataset(IRdfHandler, string)
Loads the contents of the given File using a RDF Handler providing the RDF dataset format can be determined.
Declaration
public static void LoadDataset(IRdfHandler handler, string filename)
Parameters
Type | Name | Description |
---|---|---|
IRdf |
handler | RDF Handler to use. |
string | filename | File to load from. |
Remarks
The File
Events
| Improve this Doc View SourceStoreWarning
Event which is raised when the Store parser invoked by the FileLoader detects a non-fatal issue with the RDF syntax
Declaration
public static event StoreReaderWarning StoreWarning
Event Type
Type | Description |
---|---|
Store |
Warning
Event which is raised when the parser invoked by the FileLoader detects a non-fatal issue with the RDF syntax
Declaration
public static event RdfReaderWarning Warning
Event Type
Type | Description |
---|---|
Rdf |