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 according to the resources on the network, and a problem occurs.

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.