An Ontology-Based Approach to Diagnosis and Classification for an Expert System in Health and Food

In this chapter, we will discuss how to make an ontology-based expert system easy to use and apply to community sustainability issues without pay. Ontology itself plays an essential role in the diversity of knowledge and management methods that can simplify communication between expert domains and users. The scope of this study is health and food, which is expected to help people realize the disturbances they experience. In this chapter, we will discuss two cases: (i) determine the depressive disorder a person has based on their health condition and (ii) determine the type and variant of rice according to needs. Ontology is a method used in research that can be structured and systematic real-world representation that is equal and provides a reference model. The results of this study are an expert system model and mobile applications to help users overcome the problems in the health and food fields with the ontology method. The objective of this study is to develop the application based on the ontology method to make it easy for people to find information on expert systems.


Introduction
Ontology matching is a field of research that is in high demand today, where information exchange and reuse of knowledge are essential topics in the development of the ontology; this is one solution to the problem of semantic heterogeneity.Matching ontology aims to find correspondence between entities in the semantic ontology.In this study, we will discuss how to make an ontology-based expert system to be easily used by the community without pay.Ontology itself plays a vital role in the diversity of knowledge and the way it is regulated.Ontology is a structured and systematic equivalent real-world representation.Moreover, ontology also provides a referral model that can simplify communication between expert domains and improve understanding and information sharing.There are several previous research related to ontology.The first paper describes a knowledge system for improving RFID recognition by using fuzzy ontology [1].The second paper shows the fuzzy ontology with fuzzy concepts is an extension of the domain ontology with crisp concepts [2].The third paper concerns to integrate ontologies from food, health, and nutrition domains to help the personalized information systems to retrieve food and health recommendations based on the user's health conditions and food preferences [3].The fourth paper provides advancement to the research of diabetes diagnosis using CBR algorithm [4].The fifth paper proposes a search based on multiple ontologies to make information retrieval efficient.It rewrites the user query by adding semantic information, after consulting multiple ontologies [5].The other paper is to integrate ontologies from food, health, and nutrition domains to help the personalized information systems to retrieve food and health recommendations based on the user's fitness conditions and food preferences [6].
In this study, the object of research to be used is a ubiquitous object in the community, namely, health and food.Ontology itself plays an essential role in the diversity of science and how to regulate it.Cytology is a real structured and systematic representation of the world.Moreover, ontology also provides a reference model that can simplify communication between domain experts and improve understanding and information sharing.
Many similar studies have used the decision tree so that its use is more familiar than ontology.However, in this study, classification ontology does not require elimination or precise calculations to be able to take a conclusion, as did the decision tree, because the results are taken from predetermined criteria.Although ontology cannot be flexible in choosing criteria for different outcomes, the classification ontology method is more directed at relationships within each entity rather than elimination based decision-making.
(i) Health is a very complicated problem, which is the result of various natural and human-made environmental problems.The coming of a disease is something that cannot be rejected, although sometimes it can be prevented or rejected.The concept of health or sickness is truly undivided and universal because other factors influence greatly, especially sociocultural factors.Therefore, it is crucial to have thoughts about the concepts of health and illness.If the idea of the concept is based on the correct concept, then the community will also find the right alternative to solve their health problems.The type of disease in this world is comprehensive.Some include common diseases, but some include diseases that are quite difficult to avoid.One of them is an allergic disease.(ii) Food will be discussed for the selection of rice to be consumed in fulfilling daily intake depending on consumer tastes.Rice is one of the essential cereals needed by humans for consumption.Even though some countries in the world have basic needs to switch to wheat products, the Indonesian people still rely heavily on rice as a basic necessity to meet their daily needs.
The results of this study are an expert system model and application in the form of a mobile application using ontology created by Protégé ontology web language (OWL) to help users.This research is also expected to help users know the types of depressive disorders and recognize the criteria of someone experiencing the depressive disorder in the health sector and help to sort and select the variants and types of rice that best suit the needs of users with the ontology method.The method that will be used is ontology because ontology provides potential compatibility and chooses the results that are most suitable according to the needs and criteria given.Also, ontology is a way to describe the meaning and relationship of a term.The description can help computer systems to understand the terms used more efficiently.Thus the needs can be sorted and chosen appropriately without just perception.
Based on the above problems, these are the objectives of this study: 1. Know the application of the ontology method in making expert systems.
2. Make it easy for people to find information on expert systems.

Problem statement and research methodology
In this study, there are two scenarios to be discussed: health and food.
i. Health: The Indonesian people still lie about mental disorder, so what usually happens is that they isolate patients.Activities, social life, the rhythm of work, and relationships with families are disrupted due to symptoms of anxiety, depression, and psychosis.Someone with any mental disorder must get treatment immediately.Delay in treatment will be more detrimental to sufferers, families, and society.In this study, mental health ontology (for cases of depressive disorder) will be made based on the types and provide any information that characterizes a person suffering from a depressive disorder.The design will use Protégé, with the latest data made by the American Psychiatric Association and implemented into an Android-based mobile application, which is expected to help people realize the disturbances they experience and get immediate treatment.
ii. Food: In this scenario in the selection of rice, there is no specific reference for making choices.Difficulties are also felt when there are no specific benchmarks based on experts or the right knowledge to determine the compatibility between processed and rice types.Besides, the application of ontology can also be applied in the world of food and medicine.This makes it interesting to apply the ontology to one aspect of food, in this study, rice, intending to create an Android-based model and expert system application to sort and select the variants and types of rice that best suit the needs of users with the ontology method.Because ontology provides potential compatibility and choices, the results that are most suitable according to the needs and criteria are given.Thus the needs can be sorted and chosen appropriately, not only with perception.
The method used in this study is the classification ontology method; besides because it is the method most often used in similar studies, this method shows more the real identity and relationship in each entity compared to the decision tree which leads to eliminating unnecessary calculations.Ontology consists of basic terms, the relationship between those terms, and rules that incorporate them.The ontology can become knowledge that can be shared and used in multiple applications.The reason for using this method is because it is the most suitable way to perform data groupings and interclass entity relationships.Considering the object of this study, then the method used in this study is the classification ontology method because this study does not require the elimination of particular calculations and the classification ontology method is more directed at relationships in each entity rather than elimination-based decision-making.
In this research, the rapid application development (RAD) system development method will be used to develop mobile applications because this method is commonly used for making relatively short systems.The stages in the rapid application development method are [7-9]:

Stage requirement planning
At this stage, a plan is carried out to determine what data is needed for system requirements.

Stage design
At this stage, a temporary design is made that focuses on presentation.

Implementation phase
At this stage, the results will be translated into the appropriate programming language and then be tested before being disseminated.

First scenario
Requirement planning, in the system requirement: the system can select for user data search purposes, and the system can do searching or filtering to find the right data.In data requirement: All data were from the Diagnostic and Statistical Manual of Mental Disorders Fifth Edition, which was created by a selection of selected psychiatrists from the American Psychiatric Association.In this study, only a limited part of the depressive disorder and diagnostic criteria in it.
Depressive disorder is the presence of sad, empty, or irritable mood, accompanied by physical and cognitive changes that impact function [10].Based on that, we can categorize it into eight types: Someone who has disruptive mood dysregulation disorder does not experience depressed mood, but becomes more irritable and more sensitive, often has problems with his mood, has experienced symptoms for more than 12 months, is not affected by drugs, has never had medical treatment, is not coming month (for women), and does not have other psychological diagnoses.Also, the person exhibits persistent irritability and frequent episodes of extreme verbal and behavioral dyscontrol toward people or property out of proportion to the situation and is inconsistent with developmental level occurring on average three or more times per week.Someone who has major depressive disorder experiences depressed mood, does not become more irritable and more sensitive, often has problems with his mood, has experienced symptoms for more than 2 weeks, is not under the influence of drugs, has never had medical treatment, is not coming month (for women), and does not have other psychological diagnoses.Someone who has persistent depressive disorder experiences depressed mood, does not become more irritable or more sensitive, often has problems with his mood, has experienced symptoms for more than 2 years, is not under the influence of drugs, has never had medical treatment, is not coming month (for women), and does not have other psychological diagnoses.Someone who has premenstrual dysphoric disorder experiences depressed mood, becomes more irritable or more sensitive, often has problems with his mood, does not know when to start feeling the problem, is not under the influence of drugs, has never had medical treatment, is on the moon (for women), and does not have other psychological diagnoses.In all of the cycles, symptoms present in the final week before menses, start to improve within a few days after onset, and become minimal or absent in the week postmenses.Someone who has substance-/medication-induced depressive disorder experiences depressed mood, does not become more irritable or more sensitive, often has problems in his mood, has experienced symptoms for more than 1 month, is in the influence of drugs, is undergoing medical treatment, does not have moderate menstruation (for women), and does not have other psychological diagnoses.Someone who has depressive disorder due to another medical condition experiences depressed mood, does not become more irritable and more sensitive, often has problems with his mood, does not know when to start feeling the problem, is not influenced by drugs, has undergone medical treatment, is not having menstruation (for women), and does not have other psychological diagnoses.Someone who has other specified disorder and unspecified depressive disorder experiences depressed mood, becomes more irritable or more sensitive, rarely has problems with his mood, has experienced symptoms within a period of time but not daily, is not influenced by drugs, has never had medical treatment, is not having a period (for women), and maybe having another psychological diagnosis.
Table 1 shows the choice of whether the user experiences a depressed mood.Depressed mood includes poor appetite or overeating, insomnia or hypersomnia, low energy or fatigue, low self-esteem, difficulty in concentrating or difficulty in making decisions, despair, and anxiety.
In Table 2, the more the user is accessible to anger means the user is more accessible to emotion than he should.It is easier to get angry because he is more sensitive to ordinary things.
Table 3 shows the problem in the mood is divided into three, such as, all the time which means the problem in the mood is experienced at any time; often which means the problem in the mood is experienced almost every day, but not every time; while rarely can mean the problem in the mood is only experienced occasionally and not necessarily every day, or only at certain times.
Table 4 describes the effect of narcotics on users.If a user is a drug user when feeling symptoms of depressive disorder, then the user may be included in substance-/medication-induced depressive disorder or even not included in any depressive disorder.
Medical treatment can be seen in Table 5.If the user is undergoing treatment, there is a possibility that the user will enter into substance-/medication-induced depressive disorder, or if the user has undergone treatment, there is a possibility that the user will enter into depressive disorder due to another medical condition, or even depressive disorder.Table 6 is only for women, and if it meets the criteria, there is a possibility that the user includes premenstrual dysphoric disorder, but it may not be included in any depressive disorder.depressive disorder or unspecified depressive disorder or even not including depressive disorder.

Second scenario
In order to create a system, a thorough analysis of system requirements is needed to make a great system.The analysis was carried out on interview data that had been conducted so far to produce a proper application which ran smoothly according to the initial needs.In this scenario, interviews were conducted to obtain the data needed.From the results of interviews conducted with the three speakers, one of the resource persons summarized the knowledge of the three experts, including himself, to make a rule in determining the type of rice that matches the processed food, along with the brand according to the specified criteria.Criteria are determined based on information from experts regarding the type of rice according to processing.Table 9 shows the types of rice found in Indonesia based on the interviews. The

Results
Figure 1 describes a flowchart design used in the process of making this system or application.First, the collected data will be analyzed and will be used as a reference in making classes and subclasses on ontology, and the process of creating classes and subclasses will involve the use of Protégé tools.Then the next step is to determine the property.At this stage, we will determine the property object and data property, which will be needed as attributes and relations of each data.The first property object is created based on the class and subclass that were created before, and each class will have its data property.
After that create a data property; this time the creation will be affected by property objects, and this data property will be useful to name the class and the data to be included in this ontology because each data will have its name used for identifying it.Then classify all data entered into ontology.Each incoming data must have at least one relationship with other data so that it can be used based on the relationship they have.All data will be given a relationship with each other; after that the data is ready and stored in the form of an OWL file, which will be used later in the application.Next is creating a SPARQL query that will be used to retrieve data from the OWL file.To be able to make the query, PREFIX must first be specified, which is the name of the place of the data [11].Furthermore, the WHERE is determined, to give a limit on the data to be taken, by determining the conditions or conditions that must be met to retrieve the data.Inside the WHERE, there is a FILTER, which is useful for classifying data retrieval as needed.The next step is to do the making of an application, starting from the design of how the application will look up to the functions in the application.Besides that, it also makes a connection between the OWL file containing the ontology data and the application.
Ontology graphics, or commonly referred to as OntoGraf, is one of the features found in Protégé tools.This feature was introduced to the user, starting from version 4.3 [12].The Protégé software adapts the Java programming language which can be customized according to user needs [13].Usually, ontology research and acquired knowledge using Protégé software.The function of OntoGraf itself is to provide an interface so that users can manage navigation from relationships between classes, properties, and individuals contained in OWL files [14].By using this menu, the user can see the display of relations between class, property, and individuals in the OWL file.There is an OntoGraf feature that provides interactive support for navigating the OWL ontology relationship.Various layouts are supported to regulate the structure of the ontology [15].The types of data relationships supported include subclass, individual, domain or range object properties, and equivalence.
Figure 2 is an ontograph wherein the Protégé application; there are seven depressive disorders and eight subclasses of depressive disorder.Other specified depressive disorder and unspecified disorder is being one part because they have the same characteristics.The picture shows the depressed mood subclass has two individuals, namely, not experiencing and experiencing.The subclass of psychological diagnosis has two individuals, namely, none and possible; subclass how long describes how long the user has experienced problems such as depressed mood or more irritable, that is, more than 12 months, more than 2 weeks, do not know, more than 1 month, not long ago, and more than 2 years.
Figure 3 is the first-level display of the ontograph.The conclusion is that rice has members, namely, the type of rice that exists.Then as a subclass of rice, there are descriptions and dishes.The description has a brand and variable, while the dishes contain rice dishes.Next level 2 of the ontograph is a member of each subclass.Rice dishes consist of names of processed foods, and brands have members, namely, existing rice brands, while variables have members, namely, the criteria for rice used.
The OWL file is the output generated from the design that has been done before, namely, the design of classes, subclasses, property objects, and datatype properties.The following are the results of the design.The class in the class design is depressive order.Figure 4 shows that the depressive order class has subclasses, which are how long, depressed food, psychological diagnosis, food problems, problems with tempers, menstruation, drugs, and medicinal medicine, while Figure 5 shows the contents of the class and subclass of OWL in the second scenario.The input of the first scenario: 1. How long the user has experienced problems such as depressed mood or more irritable has six individuals, that is, more than 12 months, more than 2 weeks, do not know, more than 1 month, not long ago, and more than 2 years.
2. Depressed mood has two individuals: not experiencing and experiencing.6. Menstruation has two individuals: no and moderate period.This menstruation is only experienced by women, as an initial indication of premenstrual dysphoric disorder.
7. Narcotics have two individuals: users and nonusers.
8. Medical treatment has three individuals: ever undergoing, undergoing, and never undergoing.
The output of the first scenario is the application which can find information about signs of depressive disorder.Users will choose the type of depressive disorder they want to know the information, and then the system will process.Then the desired data will appear; after getting the desired data, the user can try again to find the other data, or if there is nothing to look for, the application is complete.
The input of the second scenario is class rice has property objects and datatype properties that vary according to the characteristics of each rice.Rice class has members, namely, the type of rice.Each type of rice has different attributes.Then brands have types of rice and rice variables.Each subclass rice dish contains rice.These preparations also have object properties and datatype properties that differ according to the needs of each processed rice.Members or identifiers in the rice dish class are types of rice.Subclass brand is a subclass of the brands of rice sold in Indonesia.Each brand has an object property such as compatibility with the type of rice and the characteristic determinant of rice.Subclass variable contains variables that are used to classify the types of rice, and aroma has attributes such as the type of rice and the brand of rice that has these characteristics.
The output of the second scenario is to build an application to make it easy for users to find the most suitable type of rice so that the desired rice processing is appropriate and to find out the application of the ontology method in making expert system applications based on Android.
The next step is to convert the results from Protégé to the database.In the first scenario, we will use a CSV file where the results of Protégé are then exported to a CSV format file with entities containing individuals from depressive disorder and values of properties containing object properties.This step is shown in Figure 6.
Whereas in the second scenario directly using PHP, where the SPARQL query is used to retrieve data from OWL files that have been created using PHP.In this process function filters one and two function as complex character removers so that the results of the OWL can be read clearly [16][17][18].This function is essential, so there is no error in retrieving data from OWL.Also, this function is useful for calling data from the OWL while matching data that has been previously made according to the right results.The match function is given results for the function to  be displayed on the application.Moreover, thus it can be concluded that the query used to retrieve data is SELECT DISTINCT * to retrieve all data using the conditions specified in the WHERE where there are conditions that must be met to choose the right results [19,20].This step is shown in Figure 7.
The following are some of the pseudocodes contained in the design: Begin foreach dishes if criteria dish_rice = criteria rice then rice = rice_variance end if After doing the development and the prototype is declared complete, the implementation is done.Implementation is done when publishing the application in Play Store.After that is monitoring the users who are interested in using this application.The application created can be seen on the Google Play Store with the name MentalHelp application for the first scenario and RicheApp for the second scenario.
Figure 8 describes the Disorder search menu, wherein the user can choose the answer that is perceived by the user and then look for what kind of depressive disorder might be suitable, but the user may not find the answer sought.This image is part of the search menu where the results will appear in the selection which matches the existing data and can show the display for depressive info where there is a choice of each type of depressive disorder containing information about each type.Figure 9 is the main menu display of the application when the application starts.The main menu includes Rice Ontology, Rice Info, Rice Dishes, and Rice Seller.The Rice Selection feature makes it easy to find types of rice processed foods that are common in Indonesia.After the type of processing is selected, the user can click the "Calculate" button.After clicking the "Calculation" button, it will display the type of rice and the brand that sells the rice in Indonesia.There is a menu to return to the selection of processed types, to return to the main menu, or to exit the application.
Based on the results, the information presented in the application is complete and valid following the results of interviews from experts.In the first scenario, several developments exist after the system is created which can make it easier for people to know information about the depressive disorder.Previously to find out the type of depressive disorder, users cannot know quickly, while after this application, users can know that depressive disorder has several types.In the process of estimating the type of depressive disorder, previously it was difficult for the user to estimate whether he had a specific depressive disorder, while after this application, the user could estimate the depressive disorder that he had or whether he did not have it at all.
In the second scenario, previously in the rice selection process, the user used perceptions without specific guidelines and benchmarks, while after the application of the expert system, there could be a proper and correct reference for selecting each rice selection.In the delivery of information, the user previously conveyed information about the suitability of rice with processing based on perceptions and little knowledge of others, while after this application, information about the suitability of rice can be obtained quickly and surely whenever and wherever.

Conclusions
Based on the results of the research that has been carried out, these are the several conclusions for health and food problems using the ontology method, which produces the following Android-based applications: In the first scenario: In each type of depressive disorder, it can be concluded that the characteristics of a person experiencing depressive disorder can be seen from how long someone feels it.Besides, it can be seen whether someone becomes more irritable, whether someone always feels sad, whether someone is coming for a month, whether someone has had medical treatment, whether someone is a drug user, and whether someone has another psychological diagnosis.The results of all that can be a feature of a person having a depressive disorder.
In the second scenario: Users have the convenience of being able to choose the type of rice that matches the desired rice processing and recommendations of the right type and brand through an Android-based smartphone application that can be accessed anytime and anywhere.By using this expert system, the process of selecting rice types for beginners becomes more appropriate according to expert recommendations.

9 An
The following are processed rice commonly made by consumers in the rice stores according to the seller's knowledge: Ontology-Based Approach to Diagnosis and Classification for an Expert System in Health… DOI: http://dx.doi.org/10.5772/intechopen.88180

Figure 4 .
Figure 4. Design class of the first scenario.

Figure 5 .
Figure 5. Design class of the second scenario.

Figure 6 .
Figure 6.SPARQL query for the first scenario.

Figure 7 .
Figure 7. SPARQL query for the second scenario.

Figure 8 .
Figure 8. Result of the first scenario.

Figure 9 .
Figure 9. Result of the second scenario.

Table 2 .
Easy to get angry.

Table 7
has shown the length of time for how long a person experiences symptoms of depressive disorder, starting from 2 weeks, 1 month, 12 months, 2 years, not

Table 4 .
The influence of drugs.

Table 5 .
Medical treatment.longagoforthosewho experience infrequently, or do not know, because they feel they have enough old but only certain moments.Table8describes that one of the main requirements in depressive disorder is not having another psychological diagnosis.Several other mental disorders have characteristics similar to depressive disorder; if the user feels that he has another psychological diagnosis, then maybe the user is included in other specified

Table 6 .
In the menstruation time.

Table 8 .
Have other psychological diagnosis.

Table 9 .
following are brands of rice that sell these types: Brief description of rice types.