Class FileLoader
Inheritance
Inherited Members
Namespace: VDS.RDF.Parsing
Assembly: dotNetRDF.dll
Syntax
public static class FileLoader
Methods
| Improve this Doc View SourceLoad(IGraph, String)
Declaration
public static void Load(IGraph g, string filename)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
System.String | filename | File to load from. |
Remarks
The FileLoader first attempts to select a RDF Parser by examining the file extension to select the most likely MIME type for the file. This assumes that the file extension corresponds to one of the recognized file extensions for a RDF format the library supports. If this suceeds then a parser is chosen and will be used to attempt to parse the input.
Should this fail then the contents of the file will be read into a String, the StringParser is then used to attempt to parse it. The StringParser uses some simple rules to guess which format the input is likely to be and chooses a parser based on it's guess.
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, IRdfReader)
Declaration
public static void Load(IGraph g, string filename, IRdfReader parser)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
System.String | filename | File to load from. |
IRdfReader | 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)
Declaration
public static void Load(IRdfHandler handler, string filename)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
System.String | filename | File to load from. |
Remarks
The FileLoader first attempts to select a RDF Parser by examining the file extension to select the most likely MIME type for the file. This assumes that the file extension corresponds to one of the recognized file extensions for a RDF format the library supports. If this suceeds then a parser is chosen and will be used to attempt to parse the input.
Should this fail then the contents of the file will be read into a String, the StringParser is then used to attempt to parse it. The StringParser uses some simple rules to guess which format the input is likely to be and chooses a parser based on it's guess.
Load(IRdfHandler, String, IRdfReader)
Declaration
public static void Load(IRdfHandler handler, string filename, IRdfReader parser)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
System.String | filename | File to load from. |
IRdfReader | 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)
Declaration
public static void Load(IRdfHandler handler, string filename, IStoreReader parser)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
System.String | filename | File to load from. |
IStoreReader | parser | Parser to use to parse the given file. |
Remarks
If the parser
parameter is set to null then the FileLoader attempts to select a Store Parser by examining the file extension to select the most likely MIME type for the file. This assume that the file extension corresponds to one of the recognized file extensions for a RDF dataset format the library supports. If this suceeds then a parser is chosen and used to parse the input file.
Load(ITripleStore, String)
Declaration
public static void Load(ITripleStore store, string filename)
Parameters
Type | Name | Description |
---|---|---|
ITripleStore | store | Triple Store to load into. |
System.String | filename | File to load from. |
Remarks
The FileLoader attempts to select a Store Parser by examining the file extension to select the most likely MIME type for the file. This assume that the file extension corresponds to one of the recognized file extensions for a RDF dataset format the library supports. If this suceeds then a parser is chosen and used to parse the input file.
Load(ITripleStore, String, IStoreReader)
Declaration
public static void Load(ITripleStore store, string filename, IStoreReader parser)
Parameters
Type | Name | Description |
---|---|---|
ITripleStore | store | Triple Store to load into. |
System.String | filename | File to load from. |
IStoreReader | parser | Parser to use to parse the given file. |
Remarks
If the parser
parameter is set to null then the FileLoader attempts to select a Store Parser by examining the file extension to select the most likely MIME type for the file. This assume that the file extension corresponds to one of the recognized file extensions for a RDF dataset format the library supports. If this suceeds then a parser is chosen and used to parse the input file.
LoadDataset(IRdfHandler, String)
Declaration
public static void LoadDataset(IRdfHandler handler, string filename)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
System.String | filename | File to load from. |
Remarks
The FileLoader attempts to select a Store Parser by examining the file extension to select the most likely MIME type for the file. This assume that the file extension corresponds to one of the recognized file extensions for a RDF dataset format the library supports. If this suceeds then a parser is chosen and used to parse the input file.
Events
| Improve this Doc View SourceStoreWarning
Declaration
public static event StoreReaderWarning StoreWarning
Event Type
Type | Description |
---|---|
StoreReaderWarning |
Warning
Declaration
public static event RdfReaderWarning Warning
Event Type
Type | Description |
---|---|
RdfReaderWarning |