Skip to content

Latest commit

 

History

History

neo4j_demo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This folder contains the following:

  1. A demo of using web_crawler.py to find links between articles and store them in a Neo4j database.
  2. A simple Web page that pulls the stored data and visualize it using neovis.js.

demo.py shows an example like this:

graph = WikipediaLinksGraph("bolt://localhost:7687", "neo4j", "wiki")
graph.add_path("Foobar", "Philosophy")
graph.close()

You have to change WikipediaLinksGraph's arguments according to your local Neo4j database credentials. After running the script, you can run queries on Neo4j Desktop and visualize the data.

For example, a Cypher query to show all articles linking "Foobar" to "Philosophy" can be written as follows:

MATCH p = (a)-[*]->(c)
WHERE a.title = 'Foobar' AND c.title = 'Philosophy'
RETURN *

Visualization of links between two Wikipedia articles

You can also visualize the result by running a local server on this folder (using python -m http.server for example) and navigating to http://localhost:8000/.

Visualization of Wikipedia links using the neovis.js library