Neo4j is primarily a database and can be used as such to fetch data. However, a change of perspective is needed to express the data as a graph, as well as to exploit this graph structure by using graph algorithms and formulating the problem as a graph problem.
Building a (knowledge) graph
When beginning to build a graph out of a dataset, the main question to ask is what are the relationships that exist in this data? If we consider the CSV file we studied in the previous section alone, it does not contain a lot of information about relationships since it only has aggregated data, such as the number of followers per user.
To learn more about relationships in the data, we will have to enrich this dataset. This can be done in two ways. Either we can use an external data source as we did in Chapter 3, Empowering Your Business with Pure Cypher, or we can transform the way we see our relational data.
Creating relationships from existing data
Data can come...