Book Image

Building web applications with Python and Neo4j

By : Sumit Gupta
Book Image

Building web applications with Python and Neo4j

By: Sumit Gupta

Overview of this book

Table of Contents (14 chapters)
Building Web Applications with Python and Neo4j
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Running queries from the Neo4j browser


In the previous sections, we saw the results of our Cypher queries in the console (the Neo4j console) and JSON (REST) format, but both of these formats do not provide enough visualization. Also, as data grows, it becomes even more difficult to analyze the nodes and their relationships.

How about having a rich user interface for visualizing data in a graph format—a series of connected nodes? It will be awesome…correct?

Neo4j provides a rich graphical and interactive user interface for fetching and visualizing the Neo4j graph data, the Neo4j browser. The Neo4j browser not only provides the data visualization, but, at the same time, it also provides insights into the health of the Neo4j system and its configurations.

Let's perform the following steps for executing a Cypher search query from our Neo4j browser, and then visualize the data:

  1. Assuming that your Neo4j server is running, open any browser such as IE, Firefox, Mozilla, or Safari on the same system on which your Neo4j server is installed, and enter the URL, http://localhost:7474/browser in the browser navigation bar. Now press Enter.

  2. Next, enter the server username and password on the login screen (which we created/changed during the Neo4j installation), and click Submit.

  3. Now, click on the star sign in the panel on the extreme left-hand side, and click Create a node from the provided menu.

  4. Next, enter the following Cypher query to create data in the box provided below the browser's navigation bar (besides $): CREATE (movies:Movie {Name:"Noah", ReleaseYear:"2014"});. Now click on the right arrow sign at the extreme right corner, just below the browser's navigation bar.

  5. Click on Get some data from the panel on the left-hand side, and execute the following Cypher query to retrieve the data from the Neo4j database: "MATCH (n) return n;. You will see the following results:

And we are done! You can also execute the REST APIs by clicking on the REST API or see the relationships by clicking on What is related, and how.

There are many other rich, interactive, and intuitive features of the Neo4j browser. For the complete list of features, execute :play intro in the same window where you executed your Cypher query and it will walk you through the various features of the Neo4j browser.