# Semantic Search Enhanced with Rating Scores
## 3 The Semantic Similarity Method  
The \(SemSim^{e}\) method is an extension of \(SemSim\) proposed in [2; 24], which is based on the information content approach applied to ontologies [15]. According to this approach, concepts of the ontology are associated with weights such that, along the hierarchy, as weights of concepts decrease their information content increase. A _Weighted Reference Ontology_ (_WRO_) is a pair:  
\[WRO=<\!Ont,w\!>\]  
and, in particular:  
* \(Ont=<\!C,H\!\!>\), where \(C\) is a set of \(concepts\), also referred to as \(features\), and \(H\) is the set of pairs of concepts of \(C\) that are related according to the \(ISA\) hierarchy (specialization hierarchy);
* \(w\) is a function, referred to as _weight_, such that, given a concept \(c\) in the ontology, \(w(c)\) is a number in [0,...,1].  
In Figure 1, a \(WRO\) related to the tourism domain is shown, whose weights are defined by using the frequency-based approach.  
Given a \(WRO\) and a concept \(c\in C\), the information content \(ic(c)\) is defined as [25]:  
\[ic(c)=-\text{log}w(c)\]  
The _Resource Space_ represents all the searchable and available digital resources. To define the semantic content of a given resource, a structure gathering a set of concepts from the \(WRO\) is associated with it. This structure will be referred to as _Ontology Feature Vector_ (\(OFV\)) and is represented as follows:  
\[ofv=(c_{1},...,c_{n}),\ \ \ \text{where}\ \ \ c_{i}\in C,\ \ i=1,...,n\]  
Similarly, an \(OFV\) describes a user request. As mentioned in the Introduction, in the following, \(AV\) (_Annotation Vector_), and \(RV\) (_Request Vector_) will denote the semantics of a resource and a user request, respectively.  
In order to search for the resources in the Resource Space, the \(SemSim\) method has been defined. This method evaluates the semantic similarity between an \(AV\) and a \(RV\) by using the _sensim_ function which relies on the _consim_ function. The latter allows the evaluation of the similarity between concepts, say \(c_{i}\), \(c_{j}\), as defined below:  
\[consim(c_{i},c_{j})=\frac{2\times ic(lca(c_{i},c_{j}))}{ic(c_{i})+ic(c_{j})} \tag{1}\]  
where _lca_ (_lowest common ancestor_) is the least abstract concept in the hierarchy subsuming \(c_{i}\) and \(c_{j}\). Given an instance of \(AV\), say \(av\), and an instance of \(RV\), say \(rv\), _sensim_ computes _consim_ for each pair of concepts belonging to the Cartesian product of \(av\) and \(rv\). Indeed, we aim at identifying the set of pairs of concepts from \(av\) and \(rv\) that maximizes the sum of _consim_ according to the Hungarian algorithm for the _maximum weighted matching_ problem in bipartite graphs [20]. In particular, given:  
\[rv=\{c_{1}^{r},...,c_{m}^{r}\}\]  
\[av=\{c_{1}^{a},...,c_{n}^{a}\}\]  
where \(\{c_{1}^{r},...,c_{m}^{r}\}\cup\{c_{1}^{a},...,c_{n}^{a}\}\subseteq C\), let \(S\) be defined as the following Cartesian product:  
\[S=rv\times av\]and let \(\mathcal{P}(rv,av)\) be defined as:  
\[\mathcal{P}(rv,av)=\{P\subset S:\forall(c^{r}_{i},c^{a}_{j}),\ (c^{r}_{h},c^{a}_{k}) \in P,\ \ \ c^{r}_{i}\
eq c^{r}_{h},\ \ \ c^{a}_{j}\
eq c^{a}_{k},\ \ \ |P|=min\{n,m\}\}.\]  
Thus, \(sensim(rv,av)\) is defined as follows:  
\[sensim(rv,av)=\frac{max_{P\in\mathcal{P}(rv,av)}\{\sum_{(c^{r}_{i},c^{a}_{j}) \in P}consim(c^{r}_{i},c^{a}_{j})\}}{max\{n,m\}} \tag{2}\]  
Figure 1: A Weighted Reference Ontology (\(WRO\)) in the tourism domain.