# Towards a Semantics-Based Recommendation System for Cultural Heritage Collections
## 3 Developing a Recommendation System for Cultural Heritage Collections
### System Architecture and Recommendation Algorithms
Steps 1.1 and 1.2 (described in detail below) reformat the graph and create a graph projection that the Neo4j algorithms can be applied to, step 1.3 measures the centrality of subjects and keywords nodes, and then step 1.4 produces weights for subject/keyword relationships of object nodes based on the results of step 1.3. These settings are configured only once and are applied to each search activity. 2. Node and property settings When importing data from the RDF dataset into Neo4j, the subjects associated with each object take the form of a value array, with each element in the array corresponding to a different subject. In order to be able to use Neo4j's algorithms (which exploit nodes or single-value node attributes rather than value-array attributes), we used the following Cypher statement to extract each subject from the value arrays, convert it into a separate node, and connect it with a subject relationship to the object it is associated with. We also assigned a uri property to each such node, which takes as a value either the URI of the subject or its textual description. In this way, we achieved a uniform representation of all subjects so that they are all treated in the same way by the Neo4j algorithms. With the following Cypher statement, we added the \"Topic\" label to all nodes representing a subject or a keyword. We did this to differentiate from all other nodes that have a generic \"Resource\" label; this was essential for the recommendation algorithms. Figure 5: Recommendation system workflow. \begin{tabular}{l} \hline \hline MATCH (:AscdcProvidedCHO)-[:keywords|subject]-(a:Resource) \\ SET a:Topic \\ \hline \hline \end{tabular}   
We also added a node property called \"viewed\" to every Topic node with the default value of 0. This is used to count the times a user views an object related to a specific subject or keyword and is also used as a weight by the recommendation algorithms. \begin{tabular}{l} \hline \hline MATCH (a: Topic) \\ SET a:viewed = 0 \\ \hline \hline \end{tabular}   
Graph projection for subject/keyword centrality measurement  
Graph projection is a materialised view over the stored graph, which is stored in the computer memory, allowing one to run algorithms over the graph (or a portion of it) quickly and efficiently [39]. We created graph projections containing only nodes with the label Topic (representing subjects or keywords) or AscdcProvidedCHO (representing objects of the collection), using the following Cypher statement. \begin{tabular}{l} \hline \hline CALL gds.graph.project.cypher( \\ 'projection', \\ 'MATCH (m) WHERE n:AscdcProvidedCHO OR n:Topic \\ RETURN id(n) AS id', \\ 'MATCH (n:AscdcProvidedCHO)-[:rsubject|keywords]->(m:Topic) \\ RETURN id(n) AS source, id(m) AS target', \\ [validateRelationships: false]) \\ \hline \end{tabular}   
Centrality of subject/keyword: Degree Centrality  
The centrality of all Topic nodes is measured before the Search Module starts. Centrality algorithms are used to determine the importance of nodes in a network according to the number, weight, and other attributes of their relationships with other nodes [40]. Here, the centrality of a Topic node is computed based on the number of objects the Topic node is connected to, and it is used to rank objects in the search results of the Search Module. At the beginning of a search, users are likely to view objects from the top of the list of search results. For this reason, we configured the search module to prioritie objects that are associated with many subjects or keywords. In this way, we broadened the range of recommendations given to the user in the Recommendation Module and enhanced their diversity. Among the centrality algorithms supported by Neo4j, four algorithms satisfy the needs of this procedure: Page Rank, Article Rank, Eigenvector Centrality, and Degree Centrality. We decided to use Degree Centrality because it is the only algorithm that also meets the requirements of centrality computation in the Search Module, so as to keep the algorithms consistent within the entire system.