Yesterday it was configured for a day, its configuration is Jena 2.4.0, MySQL database version is 5.1.42-community, JDK version is 1.6.0, mysqldriver is mysql-connector-java-3.1.14;
An example is written based on the resources on the network, and a problem occurs,ProgramIn debug
Create a model maker using database connection Parameters
Modelmaker maker = modelfactory. createmodelrdbmaker (conn );
Create a default model named myontology
Model defmodel = maker. createmodel ("myontology ");
You cannot create a model from maker. createmodel;
Then I wrote some debug debugging. One is to use the Java interface to access mysql. The test is successful, indicating that there is no error in connectivity between Java and MySQL. Then the problem occurs on Jena;
Then update Jena to version 2.6 to locate the problem.
TIPS:
After doing this research, we found that the most common problem with using these open-source software and APIS is the version compatibility. We have encountered the compatibility problem between protege and graphviz versions before, in addition, it often takes a long time to encounter such a problem, because the first suspect object is often the person who knows little about it.
The above content is an introduction to using Jena to save the ontology file to the MySQL database. I hope you will gain some benefits.
The above content describes how to use Jena to store the ontology file into the MySQL database. I hope it will help you in this regard.