How to Use Jena to save the ontology file to the MySQL database

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.