Ontology programming implementation

Source: Internet
Author: User

Near the end of the course, I had a final project to build an application system in the education field. So recently I often think about the role of ontology in such a system and how to implement it. (Can an ontology only play a role in the web environment? Is it worthwhile to use the ontology to describe the model of an independent system ?)

Assuming that the course selection system is to be used, it is easy to see that the system should have these objects: courses, students, and teachers, and they are interconnected. The question is, what role does the ontology, Java, and database play? Currently, I have the following methods:

    1. Create these classes and relationships in the Ontology (OWL) and create the same bean classes in Java. during runtime, the system converts the individuals in the ontology to Java class instances, that is, to obtain a set of Java instances in the memory, all the operations for selecting a course are to modify the set, and perform reverse conversion when exiting the system to reflect the modification to the ontology. In this implementation method, the ontology actually plays the role of the database, so when there are many data (individuals), efficiency will be very problematic. (Protege's owl editing tool provides the ability to generate an EMF model from the ontology.CodeAlthough the current version is Alpha, this may be a good choice for synchronizing the two models .)

    2. The method above is modified so that the ontology does not store individuals. Modifications to the Java instance set are eventually reflected in the relational database (it is not difficult to use hibernate ), during runtime, the system directly retrieves data from the database and converts it to a Java instance. Such implementation can solve the efficiency problem, but it is not much different from traditional applications, and the role of ontology is almost zero.
    3. Another extreme approach is to use only the ontology maintenance class and individuals. Java does not have any model related to the application. At the beginning, the system reads the ontology into the memory as an RDF graph, the course selection operation is converted to the modification to this graph (using APIs such as Jena ). There are two problems with this method: efficiency, and reduced readability of Java code, which is equivalent to the difference in using JDBC instead of hibernate for database operations.

In the solo project, I used the first method, which is acceptable in all aspects, but the role of the ontology is not enough. This is a very important aspect, because if there is no difference with traditional projects, what is the reason for the painstaking efforts to introduce the ontology, especially the function of ontology reasoning, I think the most critical issue is to find the most suitable Ontology for the application. It is indeed a learning to define the ontology.

Update: IBM alphaWorks also provides a set of ontology tools (including Orient, eodm, and rstar). EMF should be well supported. Today, I initially tried Orient. It only supports RDF (s), but does not support owl. Therefore, it cannot meet the requirements of the Course Project. There are some minor bugs in the current version of Orient, except for the known ones. the output of the ontology file to the ecore model is always unsuccessful, and the output to the RDF file is acceptable.

Update: We recommend a slide about the ontology and model-driven. The main content is to introduce how to construct the ontology by using the visual editing function of UML and the extension function of the metadata model, many related concepts (many of which I have never heard of) and their causes are introduced here, which is helpful for us to clarify our ideas.

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.