An Approach to Building Decision Support Systems Based on an Ontology Service

: Modern decision support systems (DSSs) need components for storing knowledge. More-over, DSSs must support fuzzy inference to work with uncertainty. Ontologies are designed to represent knowledge of complex structures and to perform inference tasks. Developers must use the OWLAPI and SWRL API libraries to use ontology features. They are impossible to use in DSSs written in programming languages not for Java Virtual Machines. The FuzzyOWL library and the FuzzyDL inference engine are required to work with fuzzy ontologies. The FuzzyOWL library is currently unmaintained and does not have a public Git repository. Thus, it is necessary to develop the ontology service. The ontology service must allow working with ontologies and making fuzzy inferences. The article presents ontology models for decision support, fuzzy inference, and the fuzzy inference algorithm. The article considers examples of DSSs for balancing production capacities and image analysis. The article also describes the architecture of the ontology service. The proposed novel ontology models for decision support make it possible to reduce the time of a knowledge base formation. The ontology service can integrate with external systems with HTTP protocol.


Introduction
Different organizations or individuals need timely decision support [1][2][3][4][5].Decisionmakers must know the specifics of the context of a subject area for decision support.The context in making decisions determines the conditions and constraints of a subject area [6][7][8].The context also describes the characteristics (numerical and non-numerical values) of the analyzed object and its relationship with other entities of a subject area.The context is easier to formalize in terms of qualitative rather than quantitative values [9].Moreover, the large volume and continuous change of data regarding the analyzed object can prevent timely decision-making.
DSSs allow improving the efficiency of the decision-making process.Decision-makers use DSSs for a complete and objective analysis of subject area objects.DSSs take the values of analyzed object properties and give recommendations to a decision-maker (DM).Moreover, DSSs allow hiding the complexity of the context from DM to focus on managing the object.DM only gets objective information and does not process a large amount of data.
The central part of DSS is an inference system [9][10][11][12][13][14][15][16][17].An inference system allows inferring results based on information about an analyzed object within a context.In some cases, knowledge about the analyzed object and context can be represented with a high degree of uncertainty.Then the properties of the analyzed object can be described in linguistic terms.In this case, fuzzy inference systems (FISs) can be used to work with uncertainty.
A trained machine learning model produces a result in a reasonable amount of time [14,16].A machine learning model is a black box, so it is difficult to explain the reason for its decisions.The results of fuzzy controllers or simulators are formed by inference and based on a set of fuzzy rules [9][10][11][12][13].However, such rules are usually not contextualized, which can produce logical errors and inconsistencies.Knowledge bases require the involvement of an expert and time for development, but they allow describing the analyzed object considering context features [6][7][8][15][16][17].Moreover, knowledge bases allow controlling the logical consistency of facts.
The following main approaches are used for the building of DSS knowledge bases: • Hybridization of ontological engineering methods with other approaches [16]; • Formation of new inference mechanisms [15]; • Formation of core ontologies to support the DSS building process [15][16][17].
A significant disadvantage of existing approaches to building a DSS is that it regards focusing on a specific subject area, which makes it hard to develop a DSS for other subject areas.
This article describes a service for creating a DSS based on an ontology with support for fuzzy inference.An ontology forms the basis of a DSS knowledge base.Moreover, the article discusses novel ontology models for organizing decision support processes and fuzzy inference.These ontologies reduce the time to a DSS knowledge base formation.A set of SWRL rules defines the logic of inference in a DSS.The DM must complete the following steps to receive recommendations from the ontology service: 1.
Describe the context based on the proposed ontology.

2.
Create a set of SWRL-rules for inference.3.
Send data about the analyzed object to the service.
The developed ontology service allows creating a DSS for any subject area.The ontology service provides the basis for DSS building.The service also allows using the resulting knowledge base within any software application.Now, the OWL API and SWRLAPI libraries are used for full-fledged work with ontologies.These libraries are written for the JVM platform, which does not allow simple usage within other technological stacks.Moreover, the JVM platform has significant hardware requirements.The developed service allows access to inference functions via the HTTP protocol.Thus, the service allows the building of a DSS that can be used within any software system.The proposed ontology models and algorithms make it possible to extend the basis for building a DSS.Any ontology can be used if necessary.
Moreover, the developed service contains a module for fuzzy inference.Currently, there are no easy-to-use/out-of-the-box tools for working with fuzzy ontologies.An ontology model to fuzzy logical inference has been developed.This model allows creating fuzzy sets and describing membership functions and linguistic terms.No additional tools are needed.Crisp numerical values are fuzzified to linguistic terms in the process of fuzzy inference.The obtained degrees of membership are used to calculate the truth degree of the inference result.A user is getting more results (more high recall) within fuzzy inference.Crisp (binary logic) rules and linguistic terms are used for fuzzy inference, the calculation of the truth degree is performed transparently for the user.
The organization of the paper is conducted in the following way.Section 2 describes the basic concepts that the novel developed approach uses.Section 3 describes novel ontology models for DSS creation and fuzzy inference.Section 3 describes the architecture of the developed ontology service.Section 4 presents examples of DSS for balancing production capacities and image analysis created with the ontology service.In Section 5, the approach is discussed in detail.The paper ends with the conclusions.

Preliminaries
This section discusses the basic concepts that the proposed approach uses.Section 2.1 contains an introduction to ontologies and descriptive logic.Section 2.2 covers the basics of fuzzy inference.

Ontologies
Ontological models of knowledge representation allow combining the advantages of declarative and production models [18].Ontologies can describe the features of a subject area and a set of inference rules.Atoms of logical rules are objects of a subject area.
The following expression can represent any ontology [18]: where C is a set of ontology classes.Classes describe entities of a subject area; I is a set of ontology individuals.Individuals describe instances of ontology classes; R is a set of ontology properties: where R C is a tie between ontology classes (object property); R D is a tie between ontology class and data type (data property).Ontology ties describe the properties of subject area objects represented by classes.F is a set of ontology interpretation functions.Interpretation functions infer new knowledge based on the knowledge already contained in the ontology.
Ontologies are based on different description logics (DL).DL allow formalizing the description of the subject area.Moreover, DL can guarantee the logical integrity and consistency of the ontology.DL have decidability and relatively low computational complexity.The features of DL provide a compromise between expressiveness and decidability.Moreover, DL differ in terms of expressiveness.The base family of DL is ALC.Extensions of ALC form new types of logic with a higher level of expressiveness.Any ontology is a set of terminology and assertions in terms of DL [19]: where TBox is a terminological box.The TBox contains sentences describing concepts and relations between concepts; ABox is a assertional box.The ABox contains ground sentences about relations between individuals and concepts.
The OWL 2 standard is currently used as a formal language for representing ontologies.OWL 2 provides the expressiveness of SROIQ(D), OWL-DL is based on SHOIN (D), and for OWL-Lite it is SHIF (D) [19].
SWRL language and its extension SQWRL [20] are used to describe a set of logical rules in OWL 2.
Table 1 contains DL operators and axioms that can be used to describe terminology and assertions in ontology [19].
Various ontology reasoners are used to inference.The main functions of reasoners are [21]

Fuzzy Inference
Fuzzy inference is actively used in various intelligent systems [12][13][14].Conclusions about the state of some objects based on the analysis of its current state are formed with fuzzy inference.The following concepts of the fuzzy sets theory are used for fuzzy inference [22,23] A membership function in fuzzy logic determines a membership degree of the elements of a universal set to some fuzzy set.
Fuzzy set for a universal set U and a membership function µ : U → [0, 1] is defined as [22,23]: Membership function µ A (x) quantitatively grades the membership of the elements of a universal set u ∈ U to a fuzzy set Ã. Membership degree 0 means that an element is not included in a fuzzy set, and membership degree 1 describes a fully included element.Values between 0 and 1 represent fuzzy included elements.
A linguistic variable in THE fuzzy set theory takes THE semantic of terms in a natural or formal language.Terms represent fuzzy variables and are described by a fuzzy set.
A linguistic variable can be represented as an expression [23]: Fuzzy inference is executed based on fuzzy rules.A set of fuzzy rules form a fuzzy production system in the context of some subject area.A fuzzy rule can be represented as the expression: R = K, E, W , where K is the core of a fuzzy rule of the following form: where A = {A 1 , A 2 , . . ., A i , . . ., A n } is an antecedent of a rule consisting of many atoms Aggregation.A truth degree of antecedents for each rule is determined at the aggregation stage.If an antecedent of a fuzzy rule contains one atom, then a truth degree of an antecedent is a truth degree of this atom.A truth degree of an atom is calculated based on the value of a membership function of a linguistic variable term.
If an antecedent of a rule contains several atoms, then a truth degree is calculated based on the truth degrees of the antecedent atoms using fuzzy logic operations.The fuzzy logical AND (min) operator is usually used.

3.
Activation.A truth degree of each consequent atom of the fuzzy rule is determined at the stage of activation.A truth degree of each consequent atom is equal to the algebraic product of a rule weight and a truth degree of a rule antecedent.If weights of production rules are not specified, then their default values are equal to one.Minimum and average functions can be used to calculate truth degrees in addition to the algebraic product.

4.
Accumulation.A membership function is formed for each linguistic variable from the consequent fuzzy rules at the accumulation stage.Accumulation is based on the union of fuzzy sets of all consequent atoms for some linguistic variable.

5.
Defuzzification.The result of defuzzification is quantitative (crisp) values for each output linguistic variable based on the results of the accumulation of all output linguistic terms from THE consequences of fuzzy rules.
The considered stages of fuzzy inference can be implemented in various ways.Different bases of fuzzy logic, different approaches to combining sets, different approaches to activation and defuzzification, etc., can be used at different stages.The following fuzzy inference algorithms are actively used [9][10][11][12][13][14]24]: Mamdani algorithm, Tsukamoto algorithm, Larsen algorithm, Sugeno algorithm, and simplified fuzzy inference algorithm.

Novel Ontology Models for Decision Support and Fuzzy Inference
This section presents novel ontology models for decision support and fuzzy inference.Section 3.1 discusses the model and logical representation of the ontology for decision support.Section 3.2 describes the proposed mechanism for THE recommendations inference.Section 3.3 discusses the model and logical representation of the ontology for fuzzy inference.Section 3.4 describes the proposed fuzzy inference algorithm.Section 3.5 presents the architecture of the developed ontology service.

Model and Logical Representation of the Ontology for Decision Support
The novel model of the ontology for decision support allows to describe:

•
Entities for organizing decision support; • Entities of a subject area.
The model of the ontology for decision support can be presented by the following expression: where Decision is the component for describing entities for decision support; Domain is the component for describing the entities of a subject area; R DM is a set of ties between components.
The Decision component looks as follows: where States is a set of states of analyzed objects; Recommendations is a set of textual recommendations for analyzed objects managing; In f erence is a set of inferred states of analyzed objects; Rules is a set of interpretation functions represented by SWRL rules.The Domain component looks as follows: where Objects is a set of analyzed objects; Entities is a set of entities from a subject area that affects on states of analyzed objects; R Domain is a set of ties between the analyzed objects and entities.R DM can be represented as: where R DM S is a set of ties between an analyzed object and its possible states; R DM R is a set of ties between an analyzed object and recommendations for its management.
Logical representation of the ontology for decision support (Equation ( 1

Proposed Mechanism for Recommendations Inference
This section describes the mechanism for recommendations inference based on the decision support ontology.The mechanism for recommendations inference is based on a set of interpretation functions Rules (Equation ( 2)).Interpretation functions are represented by logical rules in the SWRL and SQWRL languages.These rules are a significant part of the proposed decision support ontology and are applied all at once.Let us consider the main types of interpretation functions and examples of their implementation in the SWRL language: 1.
Function for a transition from a numerical value of a property of an analyzed object to some state of an object: • Calculating a degree of membership of a numerical value in a fuzzy set (described in Section 3.

Model and Logical Representation of the Ontology for Fuzzy Inference
This section discusses the model and logical representation of the ontology for fuzzy inference.This ontology allows describing fuzzy sets and defining various membership functions.
The model of the ontology for fuzzy inference can be represented by the following expression: where Sets is a set of fuzzy sets; Functions is a set of membership functions; Membership is a set of membership degrees of entities to fuzzy sets; R FI is a set of ties between components.At the moment, the ontology service supports the following membership functions: Linear.
Logical representation of the ontology for fuzzy inference (Equation ( 4 • hasMembershipValue is an inverse functional property for determining the degree of membership of any entity ontology in a fuzzy set.

Fuzzy Inference Algorithm
This section describes the fuzzy inference algorithm.The proposed algorithm implements the following stages of fuzzy inference: fuzzification, aggregation, and activation.
Algorithm of the fuzzification stage of a fuzzy inference: 1.
A user specifies a fuzzy set for each numeric indicator.A fuzzy set is defined by the name of an individual of FuzzySet class.

2.
The degree of membership of a quantitative indicator is calculated for each individual of Term class, specified as a range of the property hasTerm of selected fuzzy set.The implementation of a membership function is used to calculate a degree of membership, specified as a range of membershipFunction property of a current linguistic term.

3.
The result of fuzzification is added to the ontology by creating individuals of MembershipValue class.membership property determines a degree of membership, and a range of membershipEntity property is copied from a corresponding individual of Term class.
Algorithm of stages of aggregation and activation of fuzzy inference: 1.
FT dependencies tree of Rules interpretation functions is formed [25].

2.
All rules of level with the highest depth index (i = td(FT)) are processed: FT = {FT j ∈ FT|j = i}.

3.
Following values are calculated for each rule ( FT j = A ⇒ C ) from set FT: • truth degree using the intersection of fuzzy sets of atoms of an antecedent of a rule: If there is no fuzzy set for an atom, then an atom is skipped; • truth degree of a consequent of a rule is set equal to the truth degree of an antecedent condition: C P = A P .If it is impossible to calculate a truth degree of a consequent, then this step is skipped.

4.
Truth degree of consequents and antecedents is calculated, considering calculations performed at the previous step when moving to a higher level of the tree (i = i − 1). 5.
The algorithm continues to run until it reaches the root node of FT dependency tree (i = 0).The results of SQWRL queries are displayed in descending order of a truth degree of consequents.

Architecture of the Developed Ontology Service
This section discusses the architecture of the ontology service for building decision support systems.The service is written in the Java language.Moreover, the OWL API library [26] is used to work with OWL ontologies.The SWRLAPI library [27] is used to work with SWRL rules.The service API is based on the REST architectural style [28].Interaction with the service is based on the HTTP protocol.Data is transmitted in JSON format [29].PostgreSQL is used as the repository of ontologies.Thus, OWL files are stored in PostgreSQL as binary data.
The service has several types of methods to: 1. working with ontologies:

2.
Working with SWRL rules: • Get a list of all SWRL rules contained in the specified ontology; • Get a list of all SQWRL queries contained in the specified ontology; • Execution of a user-selected SQWRL query or queries in a specified ontology (crisp inference); • Execution of a user-selected SQWRL query or queries in the specified ontology with the preliminary addition of axioms in the ontology ABox (crisp inference); • Execution of a user-selected SQWRL query or queries in a specified ontology (fuzzy inference); • Execution of a user-selected SQWRL query or queries in the specified ontology with the preliminary addition of axioms in the ontology ABox (fuzzy inference).
Figure 1 shows the architectural diagram of the developed ontology service.Algorithm of interaction with the ontology service from an expert point of view: (Figure 1): 1.
Formalization of expert knowledge in the form of ontology.

2.
Saving the ontology to an OWL file.

3.
Uploading the ontology to the service.4.
Validation of logical integrity and consistency of the ontology.5.
Saving the ontology in PostgreSQL as binary data.
Algorithm of interaction with the ontology service from a user point of view (Figure 1):

7.
Selection of a required ontology from a database.8.
Loading a required ontology from PostgreSQL. 9.
Fuzzification of numeric values if using fuzzy inference.10.Aggregation and activation of truth degrees of rules if using fuzzy inference.11.Output of inference results.

Examples of DSSs Created with the Ontology Service
This section presents examples of DSSs created with the ontology service.The extended ontology of decision support (Section 3.1) is used as a knowledge base.The extended fuzzy inference ontology (Section 3.3) and proposed fuzzy inference algorithm (Section 3.4) are used for fuzzy inference.
Moreover, experiments to evaluate the quality of created DSSs are presented in this section.The quality of the DSS is determined using two indicators: precision and recall.
The precision is calculated as: where |Correct| is a number of correct DSS results; |Total| is a number of DSS results.The recall is calculated based on the following expression: where |Total| is a number of DSS results; |Rules| is a number of rules assigning textual descriptions and recommendations.Section 4.1 presents the example of the DSS for balancing production capacities.Section 4.2 describes the example of the DSS for image analysis.

DSS for Balancing Production Capacities
The capacity management includes the next steps: • Developing technical passport of the enterprise; • Calculating the capacities for each production unit and the enterprise as a whole; • Developing a shortage control strategy; • Generating a consolidated report with the forecast to implement the product program; • Calculating the capacity balance.
The balancing of production capacities in this example will be based on the numerical values of the performance indicators of employees (EmployeePower) and tools (ToolPower).

DSS for Image Analysis
This section presents an example of the implementation of the DSS for image analysis.This example covers decision support for determining the state of university classrooms.The input data for the system are static images of a classroom.Static images are preprocessed by the YOLO [30] neural network for the entities allocation (Figure 3).
It is necessary to add the following axioms to the decision support ontology: • Classroom conditions (empty, not empty, and for checking) must be added to the the Decision component (Equation ( 2)): Empty In f erence NotEmpty In f erence ForChecking In f erence The query for displaying empty classrooms: Empty(?c) ∧ hasName(?c,?n) ∧ abox:caa(?t,?c) ⇒ sqwrl : select(?n, ?t) The query for displaying not empty classrooms: NotEmpty(?c) ∧ hasName(?c,?n) ∧ abox:caa(?t,?c) ⇒ sqwrl : select(?n, ?t) The query for displaying classrooms for checking: ForChecking(?c) ∧ hasName(?c,?n) ∧ abox:caa(?t,?c) ⇒ sqwrl : select(?n, ?t) The following states of the classrooms are determined after the execution of these queries: • 411 is the empty classroom; • 420 is the not empty classroom; • 431 is the classroom for checking.
The precision of the DSS was determined by an expert.The expert evaluates the condition of the classrooms based on a review of a set of static images.The number of experiments is 108, the number of correct DSS results is 99.The quality of the DSS was influenced by the YOLO neural network.In some cases, YOLO detected that the projector was on when the projector was turned off.

Discussion
This article discussed an approach to building DSSs based on an ontology service.Knowledge bases allow formalizing the experience of an expert in the decision-making process.The complex process of knowledge base formation is the main disadvantage of knowledge bases.The main advantage of knowledge bases is the ability to explain the reason for the decision.Moreover, the advantage of knowledge bases involves the easy adaptation to changes in a subject area.
The main aim of the study was to create tools for DSS creation.The proposed approach has the following advantages:

•
The proposed approach does not depend on a subject area.Existing approaches to build a DSS are focused on a specific subject area, which makes it hard to develop a DSS for other subject areas; • The developed ontology service allows performing inference functions from any software system using the HTTP protocol.Developers must use the OWLAPI and SWRL API libraries to get all ontology features and abilities.These libraries are written in the Java language, so they cannot be used in systems built on other technologies or systems with a limited set of resources; • The service is based on the REST architectural style and the OpenAPI specification.The OpenAPI Specification is a specification for machine-readable interface files for describing, producing, consuming, and visualizing REST API; • The developed service contains a module for fuzzy inference.The proposed implementation of fuzzy inference is the absence of dependencies on third-party solutions.
The proposed ontology for fuzzy inference and the fuzzy inference algorithm implements the fuzzy inference function.Several implementations of fuzzy ontologies are currently available.The most famous implementation of fuzzy ontology is Fuzzy-OWL [31][32][33].Now, the FuzzyOWL library is unmaintained and does not have a public Git repository.Moreover, the plugin for the Protege editor is required to develop fuzzy ontologies for FuzzyOWL.This plugin works only in the 4th version [34] of the Protege editor and does not work in the current 5th version [35].
The proposed approach has the following disadvantages: • The proposed ontology service only has the unfriendly developer-oriented service API and does not have a user interface; • The service supports a limited number of membership functions: crisp, linear, trapezoidal, and triangular; • The proposed approach to the DSS creation cannot be considered production use ready.
The tests of the ontology service with a large volume of data and a large number of concurrent requests were not executed; • The service is based on REST API and does not save request states (stateless).Thus, it is necessary to load an ontology and initialize the inference engine for each request, which requires 2-3 s.

•
The ontologies are loaded and processed in RAM.One axiom takes about 0.34 KB of RAM; therefore, 1 GB of RAM can hold about 3 million axioms.Thus, the service is not designed to use large ontologies.
As future work: • Add support for multi-user mode; • Add the ability to user register and login; • Add user ontology repositories (public and private); • Add a user interface; • Add the ability to edit and create ontologies through the user interface; • Publish a service to the public access.
The proposed approach to DSS creation will be improved.The presented ontology service was in its initial state and has been developed for testing purposes.More features and conceptualizations will be added to it.

Conclusions
The article discusses an approach to DSS creation based on an ontology service.The article proposes novel ontology models for decision support and fuzzy inference.The ontology of decision support allows describing the features of a subject area and entities for the decision-making.Expert rules are described using SWRL and SQWRL languages.The ontology for fuzzy inference allows describing fuzzy sets, membership functions, and linguistic terms.
The HTTP protocol and REST API are used to work with the ontology service.First, a user needs to create an ontology in the Protege editor.Afterward, a user can upload the created ontology to the service.Decision support is implemented based on an inference mechanism.A user needs to specify which SQWRL query from the ontology needs to be executed to get the result.It is also possible to add axioms to the ontology ABox before executing the SQWRL query.Several alternative solutions can be obtained with varying truth degrees in the case of fuzzy inference.
The article discusses examples of using the proposed approach to create DSSs, for balancing production capacities and for analyzing static images.

Figure 1 .
Figure 1.Architectural diagram of the developed ontology service.

Table 1 .
DL operators and axioms.
C 2 , . . ., C i , . . ., C k } is a consequent of a rule consisting of atoms C i .
Recommendations class inherits properties from parent class Decision.Recommendations and States classes are disjoint classes; • States is a class for describing the states of analyzed objects.States class inherits properties from parent class Decision.Recommendations and States classes are disjoint classes; )) in SHOIN (D) • Entities is a class for describing entities from a subject area that affects on states of analyzed objects.Entities class has the following properties: -Entities class inherits properties from parent class Domain; -Entities and Objects classes are disjoint classes; -connectToObject is a property for determining ties between individuals of classes Entities and Objects; -notConnectToObject is a property for determining non-existence ties between individuals of classes Entities and Objects; -connectToObject and notConnectToObject are disjoint properties.The same individuals cannot be values of disjoint properties at the same time for the same individual; -connectToObject property is an inverse property for connectToEntity property of class Objects.Only one property can be instantiated when using inverse properties.An instance of the second property for two individuals will be inferred automatically; • Objects is a class for describing analyzed objects.The Objects class has the following properties: -Objects class inherits properties from parent class Domain; -Objects and Entities classes are disjoint classes; -connectToEntity is a property for determining ties between individuals of classes )) in SHOIN (D) DL notation looks like: -FuzzySet, MembershipFunction, MembershipValue and Term classes are disjoint classes; • MembershipFunction is a parent class for describing a membership function.MembershipFunction class has the following properties: -MembershipFunction class is covered by classes Crisp, Linear, Trapezoidal and Triangular; -Crisp, Linear, Trapezoidal and Triangular classes are disjoint classes; • Trapezoidal is a class for describing a trapezoidal membership function.Trapezoidal class has the following properties: -trapezoidalValueMin, trapezoidalValueMidLow, trapezoidalValueMidHigh, trapezoidalValueMax are functional properties for defining the parameters of a trapezoidal membership function.These properties are sub-properties of the trapezoidalValues property; -Crisp, Linear, Trapezoidal and Triangular classes are disjoint classes; • Triangular is a class for describing a triangular membership function.Triangular class has the following properties: -triangularValueMin, triangularValueMid, triangularValueMax are functional properties for defining the parameters of a triangular membership function.These properties are sub-properties of the triangularValues property; -Crisp, Linear, Trapezoidal and Triangular classes are disjoint classes; • MembershipValue is a class for describing the membership degrees of entities to fuzzy sets.MembershipValue class has the following properties:membership is a property for determining a value of a membership degree; -membershipEntity is a property for defining a linguistic term.The name of any entity of the ontology can be used as a term; -FuzzySet, MembershipFunction, MembershipValue and Term classes are