# Towards a Semantics-Based Recommendation System for Cultural Heritage Collections
## 3 Developing a Recommendation System for Cultural Heritage Collections
### System Architecture and Recommendation Algorithms
Degree Centrality computes the sum of incoming or outgoing (or both) relationships of a node. The following Cypher statement computes the number of relationships coming out of Topic nodes in the graph projection created in step 1.2. The algorithm is implemented in \"write\" mode; this results in the creation of a \"centrality\" property in every Topic node, with the centrality score assigned as its value. \begin{tabular}{l} \hline \hline CALL gds.degree.write( \\ 'projection', \\ '\(\mathrm{\{\{writeProperty:}}}\)', \\ \(\mathrm{\{\{writeProperty:}}}\)'\(\mathrm{\{\{centrality\}}}\)', \(\mathrm{\{orientation:}}\)\"\(\mathrm{\{\{REVERSE}}}\)\"]) \\ \hline \hline \end{tabular}   
Subject/keyword weight preparation  
To promote objects associated with high-centrality subjects/keywords, the centrality score yielded from the previous step is set as the initial relationship weight. The centralityscores for this dataset vary from 0 to 357. To make the system easily adaptable to other datasets or to changes in the same dataset, we decided to normalise these scores before assigning them as weights. To do this, we used the Rescaling (min-max normalisation) method [41] to rescale the centrality score range in [0, 1] using the formula below (where \(x\) represents the original centrality score of a Topic node, \(min(x)\) and \(max(x)\) represent the minimum and maximum, respectively, centrality scores among all Topic nodes, and \(x^{\prime}\) represents the normalised score). \[x=\frac{x-min(x)}{max(x)-min(x)} \tag{1}\]  
We used the following Cypher statement to execute Degree Centrality in \"stats\" mode in order to retrieve the maximum and minimum centrality scores and then normalise the centrality scores as described above. \begin{tabular}{l} \hline \hline CALL gds.degree.stats( \\  'projection', \\  [orientation;\"REVERSE\"]) \\ YIELD centralityDistribution \\ WITH centralityDistribution.min AS min, centralityDistribution.max AS max \\ MATCH (a:Topic) \\ WHERE exists (a.centrality) \\ SET a.centrality = (a.centrality - min)/(max - min) \\ \hline \hline \end{tabular}   
After the normalisation, we assigned the centrality value of each Topic node as the weight of every relationship connecting the Topic node with an object. The reason for doing so is that the algorithms we used in the Recommendation Module do not take into account the property values of nodes. In order to save computation memory and avoid confusion with projections in the following steps, we deleted the projection. Figure 6 presents the topics with the top centrality values and their centrality scores, the topic [Photographic portrait]\" being the one associated with the most items. \begin{tabular}{l} \hline \hline MATCH (a:Topic) \\ WHERE exists (a.centrality) \\ WITH a \\ MATCH (a)-[r:subject! keywords]-(:AscdcProvidedCHO) \\ SET r.weight = a.centrality \\ \hline \hline \end{tabular}   
CALL gds.graph.drop ('projection')Search Module  
After the system is configured as described above, users are invited to interact with it. As an example, we assume that the user selects subjects/keywords T1 and T2 and excludes T3. In the Search Module, step 2.1 searches for subjects/keywords T1 and T2 and adds weight to their relationships to object nodes in order to promote these objects in the list of results the user will receive, while step 2.2 excludes objects with T3 and prepares graph projection for the following action. Step 2.3 measures the centrality of object nodes based on the relationship weights assigned in steps 1.4 and 2.1 and then returns the list of search results to the user. Weight added to the selected subjects/keywords  
When the user selects subjects/keywords, the system adds additional weight to the relationships connecting objects to the corresponding Topic nodes. The value of the additional weight is set as the maximum number of topics an object can be associated with, which is 10 in the example dataset. The reason for using this number is described below.