| java.lang.Object com.hp.hpl.jena.util.ModelLoader
ModelLoader | public class ModelLoader (Code) | | A set of static convenience methods for getting models
The loader will guess the language/type of the model using
ModelLoader.guessLang(String) guessLang author: Andy Seaborne version: $Id: ModelLoader.java,v 1.28 2008/01/02 12:07:44 andy_seaborne Exp $ |
Method Summary | |
public static Model | connectToDB(String urlStr, String dbUser, String dbPassword, String modelName, String dbType, String driverName) Connect to a database. | public static String | guessLang(String urlStr, String defaultLang) Guess the language/type of model data. | public static String | guessLang(String urlStr) | public static Model | loadModel(String urlStr) | public static Model | loadModel(String urlStr, String lang) Load a model or attached a persistent store (but not a database). | public static Model | loadModel(String urlStr, String lang, String dbUser, String dbPassword, String modelName, String dbType, String driver) Load a model or attached a persistent store.
Tries to guess syntax type.
Database paramters only needed if its a database.
Parameters: urlStr - The URL or file name of the model Parameters: lang - The language of the data - if null, the system guesses Parameters: dbUser - Database user name (for RDB/JDBC) Parameters: dbPassword - Database password (for RDB/JDBC) Parameters: modelName - The name of the model Parameters: dbType - Database type (e.g. | public static Model | loadModel(Model model, String urlStr) Load a model from a file into a model. | public static Model | loadModel(Model model, String urlStr, String lang) Load a model from a file into a model. |
connectToDB | public static Model connectToDB(String urlStr, String dbUser, String dbPassword, String modelName, String dbType, String driverName)(Code) | | Connect to a database.
Parameters: urlStr - Parameters: dbUser - Parameters: dbPassword - Parameters: dbType - Parameters: driverName - Load this driver (if not null) Model |
guessLang | public static String guessLang(String urlStr, String defaultLang)(Code) | | Guess the language/type of model data. Updated by Chris, hived off the
model-suffix part to FileUtils as part of unifying it with similar code in FileGraph.
- If the URI of the model starts jdbc: it is assumed to be an RDB model
- If the URI ends ".rdf", it is assumed to be RDF/XML
- If the URI end .nt, it is assumed to be N-Triples
- If the URI end .bdb, it is assumed to be BerkeleyDB model [suppressed at present]
Parameters: urlStr - URL to base the guess on Parameters: defaultLang - Default guess String Guessed syntax - or the default supplied |
guessLang | public static String guessLang(String urlStr)(Code) | | Guess the language/type of model data
- If the URI of the model starts jdbc: it is assumed to be an RDB model
- If the URI ends ".rdf", it is assumed to be RDF/XML
- If the URI end .nt, it is assumed to be N-Triples
- If the URI end .bdb, it is assumed to be BerkeleyDB model
Parameters: urlStr - URL to base the guess on String Guessed syntax - null for no guess. |
loadModel | public static Model loadModel(String urlStr)(Code) | | Load a model
Parameters: urlStr - The URL or file name of the model |
loadModel | public static Model loadModel(String urlStr, String lang)(Code) | | Load a model or attached a persistent store (but not a database).
Parameters: urlStr - The URL or file name of the model Parameters: lang - The language of the data - if null, the system guesses |
loadModel | public static Model loadModel(String urlStr, String lang, String dbUser, String dbPassword, String modelName, String dbType, String driver)(Code) | | Load a model or attached a persistent store.
Tries to guess syntax type.
Database paramters only needed if its a database.
Parameters: urlStr - The URL or file name of the model Parameters: lang - The language of the data - if null, the system guesses Parameters: dbUser - Database user name (for RDB/JDBC) Parameters: dbPassword - Database password (for RDB/JDBC) Parameters: modelName - The name of the model Parameters: dbType - Database type (e.g. MySQL) Parameters: driver - JDBC driver to load. Model |
loadModel | public static Model loadModel(Model model, String urlStr)(Code) | | Load a model from a file into a model.
Parameters: model - Model to read into Parameters: urlStr - URL (or filename) to read from Returns the model passed in. |
loadModel | public static Model loadModel(Model model, String urlStr, String lang)(Code) | | Load a model from a file into a model.
Parameters: model - Model to read into Parameters: urlStr - URL (or filename) to read from Parameters: lang - Null mean guess based on the URI String Returns the model passed in. |
|
|