Research of Contextual Semantic Reasoning Model Based on Domain Ontology

With the development of mobile network technology and the popularization of mobile terminals, traditional information recommendation systems are gradually changing in the direction of real-time and mobile information recommendation. Information recommendation brings the problem of user contextual sensitivity within the mobile environment. For this problem, first, this paper constructs a domain ontology, which is applicable to the contextual semantic reasoning model. Second, based on the “5W+1H”method, this paper constructs a context pedigree of the mobile environment using a model framework of a domain ontology. -e contextual factors of the mobile environment are divided into six categories: the What-object context, the Whereplace context, the When-time context, the Who-subject context, the Why-reason context, and the How-effect context. -en, considering the degree of influence of each contextual factor from the mobile context pedigree to the user is different, this paper uses contextual conditional entropy to calculate the contextual weight of each contextual attribute in the recommendation process. Based on this, a contextual semantic reasoning model based on a domain ontology is constructed. Finally, based on the open dataset provided by GroupLens, this paper verifies the validity and efficiency of the model through a simulation experiment.


Introduction
User sensitivity to context and user preference are two major mechanisms of information recommendation in the mobile Internet environment. Between them, user preference has been widely studied by domestic and foreign scholars, and many user preference models that can be used in recommendation systems have been constructed. For example, Wu et al. constructed an anonymous user preference model by combining the short-term preferences of anonymous users with the long-term preferences of various professional user groups [1]. Weng et al. used a standard LDA model to mine user preferences [2]. However, although scholars have preliminarily explored contextual sensitivity, there is still a lack of systematic and in-depth study.
Context is the environmental factor that influences the expression of user needs [3]. Concerning the definition of contextual sensitivity, Akbulut et al. explained that contextual sensitivity refers to the reactions and special needs of users in a given environment [4]. In the mobile network environment, the user recommendation service not only needs to consider the user's preferences but also needs to meet the individual needs according to the real-time environment in which the user is. Most of the existing context-sensitive recommendation services provide user location information based on GPS and recommend eligible information using a group of users at the same location. On this basis, to better provide personalized services for users in the mobile network environment, some scholars introduce other contextual factors such as time to achieve real-time and on-the-spot delivery of information corresponding to user context to meet the user's personalized needs in a specific geographical location and at a specific time [5,6].
It can be seen that context plays a key role in the personalized needs of users in the mobile environment. However, through the study of recommendation problems in different fields, it is found that the contextual factors considered in different fields are not the same, and the degree of influence of various contextual factors on the personalized needs of users is also quite different. e sensitivities of different users to the context are different. How the context affects the user's personalized selection is a function of the contextual semantics, while the contextual semantics in specific environments are derived from a contextual semantic reasoning model. erefore, this paper will focus on the reasoning process of contextual semantics.

Related Literature Research
is section mainly reviews the latest domestic and foreign related studies that focus on the application and reasoning of contextual semantics.
Li et al. constructed a recommendation algorithm that combined semantic association and context awareness. e algorithm improved the overspecialization problem of traditional recommendations by employing a case similarity algorithm based on semantic association. It enhanced the contextual sensitivity of recommendation results based on context awareness [7]. Aleman et al. also combined semantic association with context awareness and assigned different weights for semantic association and context awareness to recommend and rank resources through postcontext filtering. It was proven that a recommendation algorithm combining semantic association and context awareness can improve the problem of a lack of contextual sensitivity [8,9]. In the dynamic service quality prediction of personalized service recommendations, Jin et al. designed a two-stage prediction method based on historical and current contexts. is method predicted the missing value of the current context based on the results of the historical context [10]. Zhang et al. researched the anchor recommendation of live streaming platforms. ey proposed a model of multihead related unit to capture the preference matching between the viewer and the anchor based on the dynamic changes of the context and the preference of both the viewer and the anchor [11]. Kim et al. proposed a contextaware model by merging context awareness in a personalized health service system. e model was applied to extract missing values of user preference in a collaborative filtering algorithm and realized the fusion of collaborative filtering and context awareness [12]. e usage of contextual semantics in personalized recommendation systems is mainly divided into two categories: one is based on context filtering and the other is based on context modeling. For the method based on context filtering, the contexts of the target user are determined, and then the similarity between the current context and each historical context is calculated. e datasets with low similarity are removed, and the filtered datasets are used for recommendation. Compared with the recommendation based on the whole dataset, this method has lower time and space complexity, but some semantic relevance is lost while filtering the dataset [13]. e method based on context modeling has higher recommendation performance, although the modeling process is more complex. Nitu et al. integrated users' recent travel interests into a personalized travel recommendation system. An improvising personalized travel recommendation system was constructed by adding the recency weight, which was sensitive to time context, into the model [14]. Karatzoglou et al. applied multivariate recommendation to context modeling and implemented tensor decomposition by using Tucker decomposition. is method has good prediction accuracy, but it can only be applied to simple classification contexts [15]. Mi et al. proposed an enterprise knowledge recommendation algorithm based on a factor decomposition machine. By transforming contextual data of knowledge into feature vectors, enterprise data can be effectively utilized to meet the individual knowledge needs of employees, and knowledge recommendations can be targeted accurately [16].
In addition to being widely used in the field of personalized recommendation, the context has also been applied in some special fields. For example, in the study of cell type identification which is a key step in cellular heterogeneity analysis, Tian et al. regarded the data of single-cell RNA-sequencing themselves, which needed to be identified as contextual factors in the recommendation of clustering methods, to recommend the most suitable clustering method for cell type identification [17]. Malek et al. proposed an electric vehicle speed prediction method for univariate and multivariate contexts based on long shortterm memory. e results show that the multivariate context model is better than the univariate context model in shortterm and long-term prediction [18]. Khazbak et al. proposed an enhanced scheme that allows a user to specify their location context privacy preference for user privacy in ridehailing services, and the scheme can better protect a user's privacy at the cost of limited matching accuracy [19].
In the mobile Internet environment, the user's context information is more dynamic, and the existing context classification cannot cover all the contexts that may appear. erefore, a context modeling method based on the classification context has poor universality. In a recommendation based on context awareness, the importance of each contextual factor to the user's preferences is different, which cannot be simply treated equally, so it is necessary to analyze the influence of different contextual factors on a user's preferences.

Construction of Contextual Semantic Reasoning Model Based on Domain Ontology
Ontology is considered the most effective tool for modeling contextual semantics. Contextual information can develop contextual ontology using domain ontology, so the entities in a contextual reality can be formalized and mapped into a machine-understandable and sharable knowledge structure for reasoning in contextual semantics [20]. erefore, this paper builds a contextual semantic reasoning model based on a domain ontology.

Construction of Domain Ontology.
Based on the specific domain requirements involved in the mobile environment, the domain ontology required by the reasoning model is determined. On the one hand, the mapping rules for the conversion from a vocabulary to an ontology are made based on a thesaurus. On the other hand, taking existing ontologies in the domain as supplementary resources, the concept of vocabulary is formalized and mapped, and the ontology is reused and reconstructed to form the core concept and relational system that can reflect the common characteristics of the domain. us, a domain ontology for the organization and description of contextual semantics is constructed, and the detailed description file of domain ontology is formed [21]. e construction of a concept system is the focus of the construction of a domain ontology [22]. It mainly consists of five parts: identifying the core classes of the ontology, determining the hierarchy of the classes, defining the relationships between the classes, defining the attributes of the classes, and creating instances of the classes. e specific process of constructing a domain ontology is shown in Figure 1.

Construction of the Mobile Context Pedigree.
Due to the contextual factors in the mobile environment being numerous and difficult to use, by using the "5W + 1H" method, this paper will construct a context pedigree of the mobile environment using a model framework of domain ontology. e contextual factors of the mobile environment are divided into six categories: the What-object context, the Where-location context, the When-time context, the Whosubject context, the Why-reason context, and the How-effect context. ese six kinds of context basically cover all kinds of contextual factors in the mobile environment. Before the storage of the context, each contextual factor in the mobile environment is converted into one of the "5W + 1H" methods to ensure the integrity of the context.

What-Object Context.
e object context refers to the relevant information of the recommended object, including the superior category and subordinate attributes of the recommended object, that is, the upper and lower levels of the object in the ontology.

Where-Location Context.
e location context not only refers to the location information of the object and subject but also includes the environment, weather conditions, and traffic conditions related to the specific location. e contextual sensitivity of the users in the mobile environment is affected so much by these factors that the change of any subfactors will cause significant changes in the information service requirements of the users.

When-Time Context.
e time context includes not only the time node the user is currently in but also the occurrence and duration times and the frequency of occurrence of a user's behavior. Such contextual factors can mine a user's behavior habits and capture the user's preferences and interests more accurately.

Who-Subject Context.
e subject context covers the user's identity, job, income, educational background, interest, preference, and so forth. It is used to describe the basic situation of the user.

Why-Reason Context.
e reason context includes not only the reasons for the user's demand for information services, such as birthday parties and family dinners but also the reasons for the user's behavior that has occurred. e recommended objects will be filtered according to the comparison between current and historical reasons and the evaluation of historical behaviors.

How-Effect Context.
e effect context includes the content and quality of a successful recommendation and the feedback.
e mobile environment makes the feedback behavior free from a time and place. Timely feedback can better reflect objective facts and ensure credibility.
Based on the above analysis of the "5W + 1H" method, the mobile context pedigree is constructed with the domain ontology as the model framework, as shown in Figure 2.
e mobile context pedigree is composed of a series of core context concepts. ese core concepts have a certain semantic relationship to ensure the integrity of the mobile context pedigree. Each core concept derives many subconcepts and correlates with many attributes.

Calculation of the Contextual Influence Based on the Conditional Entropy.
e influence of the different contextual factors on a user is different in the mobile context pedigree. e different values of some context attributes have a greater influence on the user's selection during the recommendation process, which indicates that these context attributes have a greater influence on the user's preferences. e different values of some context attributes have a smaller influence on the user's selection, which indicates that these context attributes have a small influence on the user's preferences. In this paper, conditional entropy is used to calculate the influence of each context attribute in the recommendation process, and the influence weight of each context attribute on users is measured based on the contextual conditional entropy. e contextual conditional entropy reflects the uncertainty when a user selects the recommended object based on a certain context attribute. e greater the conditional entropy is, the smaller the influence of the conditional entropy on the user's selection of the recommended object will be. e smaller the conditional entropy is, the greater the influence of the conditional entropy on the user's selection of the recommended object will be. e method to calculate contextual conditional entropy is shown in the following: where H(I|c) represents the contextual conditional entropy of the context attribute c corresponding to the recommended object I. e larger H(I|c) is, the smaller the influence of the context attribute on the user's selection of the Scientific Programming recommended object I will be and vice versa. n represents that context attribute c contains n attribute values. m expresses that the recommended object I is divided into m selections. P(c i ) represents the probability that the context attribute c takes the value c i , and P(I j |c i ) represents the probability that the user selects the recommended object I j when the context attribute c takes the value c i . e contextual weight represents the proportion of the context attribute when the user selects the recommended object. e smaller the contextual conditional entropy value is, the less uncertainty there is regarding the user's selection after the context attribute is known, and the greater the influence of the context attribute on the user's selection of the recommended object, which means that this context attribute has a greater weight in the recommendation. e higher the conditional entropy value is, the smaller the influence of the contextual attribute on the user's selection of the recommended object will be. e calculation method of the contextual weight is shown as follows: where H(I|c) is the contextual conditional entropy in which the context attribute c corresponds to the recommended object I based on formula (1). C represents the set of all context attributes, and |C| represents the number of all context attributes. Formula (2) shows that the contextual weight is inversely correlated with the value of the contextual condition entropy.
e smaller the value of the contextual condition entropy is, the larger the contextual weight is, that is, the higher the influence of the context attribute on the user's selection of the recommended object.

Contextual Semantic Reasoning Model Based on Domain
Ontology. e mobile context pedigree constructed in this paper not only includes mobile context information, which is divided by the Where-location context, When-time context, and Why-reason context, but also includes recommended object information which is divided by the What-object context, the user's personal information which is divided by the Who-subject context, and the user's evaluation information regarding the recommended object, which is divided by the How-effect context. erefore, before performing contextual semantic reasoning, it is necessary to update the mobile context pedigree with the user's historical context information to obtain the initial Howeffect context. According to the contextual semantics contained in the mobile context pedigree, through semantic analysis, determine the relevance of user interests and contexts and summarize the reasoning rules. en, collect the user's current context information through the mobile client, and based on the mobile context pedigree, the user's current context information is standardized to the standard style in the mobile context pedigree. en, according to the reasoning rules, the user's interest in the current context is inferred. According to the user's feedback on the recommended object, the mobile context system is maintained and updated. e contextual semantic reasoning model based on domain ontology is shown in Figure 3. e concept set of the context attributes includes not only the concept of the current context attribute but also the weight factor corresponding to the attribute.
e key to the contextual semantic reasoning model lies in the generation of a reasoning rule set [6]. e specific process of the reasoning rule set generation is as follows.
Assume that the mobile context pedigree instance set is I. First, the four concept sets of I i for each instance are extracted from the instance set I: the context attribute concept set CI, the user attribute concept set UI, the product attribute concept set PI, and the effect attribute concept set EI.
e CI contains the concept of the context attribute instance and its weight factor, the UI contains the concept of the user attribute instance, the PI contains the concept of the product attribute instance, and the EI contains the concept of the effect attribute instance. e CI, UI, PI, and EI concept sets extracted from the mobile context pedigree instances are shown in Figure 4, where the concept class to which the instance concept belongs is in brackets. e concepts extracted from a single mobile context pedigree instance I i are related to each other. Using the Apriori association rule mining algorithm, frequent concept association patterns can be induced from all concepts extracted by I. For each associated pattern, the concept of the context attributes belonging to CI, the concept of the user attributes belonging to UI, and the concept of the effect attributes belonging to EI are regarded as the reasoning preconditions, and the concept of the product attributes belonging to PI is regarded as the reasoning results. e associated CI, UI, PI, and EI generate the reasoning rules. A reasoning rule corresponding to the mobile context pedigree is shown in Figure 5.

Simulation Experiment
To evaluate the validity of the contextual semantic reasoning model based on the domain ontology presented in this paper, a simulation experiment is conducted. e dataset used to verify the model comes from the open dataset provided by GroupLens.
is dataset contains the users' contextual information and the users' rating of the movie (between 1 and 5 points). e dataset meets the data requirements of this experiment. To facilitate the simulation experiment, this paper selects those users who have released more than 30 ratings from the original dataset, which includes 8,000 ratings of 500 movies made by 100 users in different contexts, and this dataset is regarded as the verification data. From this dataset, 70% of the data are used for training and 30% of the data are used for testing, and the experiment recommends a movie with a predicted rating of 4.4 or above to the user. e validity of the model is verified by comparison with the mean absolute error (MAE) and the root mean square error (RMSE) of a traditional collaborative filtering model, a model based on content filtering, and a contextual semantic reasoning model that does not consider the contextual weight.
e MAE weighs the accuracy of the model by calculating the average of the absolute error between the predicted rating and the actual rating. e smaller the MAE is, the higher the accuracy is. e RMSE weighs the accuracy of the model by calculating the square root of the square of the deviation between the predicted rating and the actual rating and the ratio of the number of users n. e smaller the RMSE is, the higher the accuracy is. e difference between the MAE and the RMSE is that the MAE reflects absolute errors, while the RMSE is more sensitive to outliers and can reflect the degree of outliers with large errors.
If the test set has a total of n user ratings, the actual user rating set is A, and the predicted user rating set is P, then the MAE and RMSE calculation formulas are e MAE comparison results are shown in Figure 6. As seen from Figure 6, the MAE of the model discussed in this paper is significantly lower than that of the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight. It shows that the accuracy of this model is better than that of the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight. Moreover, we can Scientific Programming see more clearly in Table 1, when the percentage of the training set reaches 50%, the accuracy of the model discussed in this paper first becomes stable; that is, this model tends to be stable based on fewer samples and time. e RMSE comparison results are shown in Figure 7. As seen from Figure 7, the RMSE of the model discussed in this paper is significantly lower than that of the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight. is indicates that the number of outliers with large errors in the model constructed in the paper is relatively small. We can see more clearly in Table 2. e same situation occurs whereby that when the percentage of the training set reaches 50%, the accuracy of the model discussed in this paper first becomes stable. is shows that the model constructed in the paper can avoid the increase of outliers with fewer samples.
In addition to the validity of the model, the efficiency of the model is also an important index to judge the quality of the model. e efficiency of the model is verified by comparison with the average running time of the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight. e average running time comparison of the four models is shown in Figure 8. At the same time, to facilitate the observation of a gap between the data, the average running time of the contextual semantic reasoning model based on the domain ontology using 10% of the training set is set as standard 1, and the remaining average running time is standardized to this point.
As seen from Figure 8, the average running time of the model discussed in this paper is significantly lower than that of the model based on content filtering. Compared with the traditional collaborative filtering model, it does not show advantages while the percentage of the training set is less than 50%. However, when the percentage of the training set is greater than 50%, the advantage is relatively obvious. e reason for the above phenomenon is that the main work of both the model based on content filtering and the traditional collaborative filtering model is the calculation of a rating matrix, which undoubtedly consumes more time compared  with the reasoning calculation of the existing reasoning rules based on the contextual semantic reasoning model. In addition, in the experimental dataset, the number of items is much larger than the number of users, so the average running time of the model based on content filtering is longer. e contextual semantic reasoning model that does not consider the contextual weight is a simplified version of the model that is presented in this paper. e influence of the contextual weight on reasoning is not considered in the running process of the model. erefore, the average running time has certain advantages over the model discussed in this paper. However, in the validation experiment of model validity, we know that the validity of the model that does not consider the contextual weight is lower.

Conclusion
In this paper, the user contextual sensitivity in the mobile recommendation process is studied in depth. Based on the specific domain requirements involved in the mobile environment, a domain ontology applicable to the context reasoning model is constructed. In view of the variety of contextual factors in the mobile environment and the difficulty of using them, the paper constructs a context pedigree of the mobile environment through the model framework of the domain ontology based on the "5W + 1H" method. Conditional entropy is used to calculate the influence of each context attribute in the recommendation process. Based on the above research, the construction of a contextual semantic reasoning model based on a domain ontology is completed. Finally, based on the open dataset provided by GroupLens, a simulation experiment is conducted. It is proven that this model is superior to the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight. e GroupLens dataset is a dataset of movie ratings. Although this dataset contains users' contextual information, the users' contextual information in movies is relatively The contextual semantic reasoning model based on domain ontology (CSRM) The traditional collaborative filtering model (TCFM) The model based on content filtering (MBCF) The contextual semantic reasoning model that does not consider the contextual weight (CSCW) Training set percentage    8 Scientific Programming few compared with some fields. erefore, the validity and efficiency of the model need to be validated through a broader dataset. In addition, as we can see from the experiment, with increasing experimental data, the recommendation accuracy of the proposed model gradually increases, but the system running time also increases. How to strike a balance between recommendation accuracy and system running time is also a research direction that needs to be focused on in the future.
Data Availability e data of the paper come from GroupLens. e data are public and do not violate privacy and ethics. e dataset can be downloaded freely from the website https://grouplens. org/datasets/movielens/.

Conflicts of Interest
e authors declare that they have no conflicts of interest regarding the publication of this study.