private void saveToStore(String rdfFileName) throws ClassNotFoundException, IOException { String M_DBDRIVER_CLASS = "com.mysql.jdbc.Driver"; // load the the driver class Class.forName(M_DBDRIVER_CLASS); String dbUrl = "jdbc:mysql://" + hostName + "/" + dbName; // create a database connection IDBConnection conn = new DBConnection(dbUrl, userName, password, "MySQL"); // create a model maker with the given connection parameters ModelMaker maker = ModelFactory.createModelRDBMaker(conn); ModelRDB model = (ModelRDB) maker.openModel(modelName); InputStream file = new FileInputStream(rdfFileName); model.read(file,null,"N3"); file.close(); }
if (connection.containsModel(name)) { ModelMaker m = ModelFactory.createModelRDBMaker(connection, ModelFactory.Convenient); graph = m.openModel(name); } else {