Skip to content

HaotianWang86/Neo4j-isomorphic-subgraph-matcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neo4j-isomorphic-subgraph-matcher

Neo4j and Python Interface for matching isomorphism subgraph of data graph

Getting Started

'Neo4j - isomorphic Subgraph matcher' is a U of I Database Management System Design project. These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Neo4j enterprise instance: It's a graph database platform help to input and load datagraph and query graph

  • Neo4j - Neo4j enterprise instance Download
  • Py2neo - Py2neo working with Neo4j from within Python
  • webbrowser - webbrowser connecting web from within Python
  • NetworkX - NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks
  • Pandas - an open source data analysis library

Starting playing the graphical user interface

A step by step series of examples that tell you how to get a development env running

Say what the step will be

1. Download the 'finalGUI.py' to D:\ drive.

2. Following Python packages need to be installed

Run following command in terminal Downloading networkx - A graph package in Python programming language

pip install networkx

Downloading webbrowser - A web browser in Python

python -m webbrowser -t "http://www.python.org"

Downloading pandas - A data analysis tool help to save the graph to local

pip install pandas 

Downloading py2neo - A python package help to edit the Neo4j Graph

pip install py2neo

3. Download the Neo4j Enterprise version.

  • Neo4j - Neo4j enterprise instance Download

4. Open the Neo4j Enterprise version and create an graph port in Neo4j:

create port

5. Run the interface

Issue the following command in the Anaconda command prompt/terminal with correct directorys:

python finalGUI.py

Run the interface in Terminal
After running above command, will jump out a following graphical user interfal (GUI)

A interface screenshot

Also, you can run the code in a Python IDE, such as SPYDER, PYCHARM without input directories.

6. Neo4j port information

You may need to change port information in Neo4j, if you are not using a defaulted port in neo4j
Defaulted Neo4j port: "http://localhost:7474"
Username: neo4j
Password: neo4j

If needed change the defaulted Neo4j port information, username and password:

graph = Graph("http://localhost:7474", user="neo4j", password="neo4j")
change the defaulted Neo4j port information in visualization function:
webbrowser.open("http://localhost:7474")

and
webbrowser.open("http://localhost:7474")

7. Generate the Data graph

Input the desired Data graph by using Cypher querying language in Data graph textbox.
Data graph textbox
load the data graph may takes 2-3 mins, due to interface's responding time is not excellent

8. Visualize the data graph

Click visualize button in data graph textbox, call the neo4j data visualization tool
Visualize a sample data graph

9. Generate the Query graph

Input the desired query graph by using Cypher querying language in Data graph textbox.
Data graph textbox

10. Visualize the query graph

Click visualize button in query graph textbox, call the neo4j data visualization tool
Visualize a sample query graph

11. Isomorphism subgraph Matching

Click matching button in matching textbox, call the VF2 algorithm judge is a isomorphic subgraph or not and calculates all number of matching subgraphs.
a sample matching output

12. Isomorphism subgraph informations

Click subgraph information button in matching textbox, call the VF2 algorithm return all the query subgraph's nodes and the matching data graph's nodes
Parts of information, start from No.5030 isomorphic subgraph to No.5040 isomorphic subgraph
a sample information output

Py2neo Tutorial

py2neo

Authors

  • Haotian Wang - Initial work

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

A isomorphic subgraph matcher for Neo4j

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages