This folder contains the following:
- A demo of using web_crawler.py to find links between articles and store them in a Neo4j database.
- 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 *
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/.