concept Cypher query in category graphs

appears as: Cypher query, Cypher queries, The Cypher query
Neo4j in Action

This is an excerpt from Manning's book Neo4j in Action.

Changing the RDBMS query to support this scenario would be a non-trivial task, but the Cypher query that worked with the initial model will work just as well with the extended one, because it is indifferent to how you get from a User to a Permission.

You’ve now used Cypher to find movie recommendations for a user based on friends’ ratings, but excluding the movies the user already watched. The solution to the same problem using Java APIs in chapter 4 resulted in over 40 lines of code. This time you did it in a 5-line Cypher query. The Cypher query is also much more readable and potentially understandable for anyone who understands the application domain, even if they don’t have any programming skills.

Cypher is natively supported by Neo4j Shell, so you don’t need any special commands; just type the Cypher query in the console and press Enter. The results are returned in tabular format, very similar to the output of SQL queries run against a relational database. Figure 6.3 illustrates the output of a Cypher query that finds all movies that a particular user has seen.

The Web Admin Console embeds a fully functional Cypher execution engine running inside the browser (using some JavaScript wizardry). You can type your Cypher query in the text field at the top of the page, and as you press Enter, you’ll see the result in the browser window. Figure 6.5 illustrates a Cypher query executing in the Web Admin Console.

Figure 6.5. Executing a Cypher query inside the Web Admin Console