webcaching.guerrerotome.com

Just another WordPress weblog

Archive for November, 2007

Posted by Carlos Guerrero on November 27, 2007

Fundamentals of TCP/IP and LAMP Tuning

Two interesting presentations about the protocols TCP/IP and how to tune LAMP (Linux, Apache, MySQL, PHP) architectures. (Author:Alejandro Castan Salinas Download from http://www.xtec.net/~acastan/textos/)

TCP/IP Fundamentals (spanish)
Tuning LAMP (spanish)

Posted by Carlos Guerrero on November 21, 2007

Problem to open an existing ontological model in a MySQL DB with Jena

I don’t know why, but openModel method of Jena is not recognize.  Looking for in web forums I have found that solution:
String inputFileName = “rutalocal al archivo .owl”;

String className = “com.mysql.jdbc.Driver”;         // path of driver class
Class.forName (className);                          // Load the Driver
String DB_URL =    “jdbc:mysql://localhost/modelo”;  // URL of database
String DB_USER =   ”root”;                          // database user id
String DB_PASSWD = “admin”;                          // database password
String DB =        “MySQL”;                         // database type

DBConnection conn = new DBConnection ( DB_URL, DB_USER, DB_PASSWD, DB );

ModelMaker maker = ModelFactory.createModelRDBMaker(conn);

Model model = maker.createModel(”modelo_1″);

InputStream in = FileManager.get().open( inputFileName );
if (in == null) {
throw new IllegalArgumentException( “File: ” + inputFileName + ” not found”);
}

model.read(in, null);

model.commit();

conn.close();

}

Extract from:  http://www.juglar.org/index.php?topic=64.0;prev_next=next