PRACTICAL 9
PRACTICAL 9
AIM:
Introduction to Neo4j graph database and Gephi tool.
What is a Graph Database?
A graph database is a database that uses graph structures for semantic queries with nodes, edges, and properties to represent and store data. A key concept of the system is the graph. The graph relates the data items in the store to a collection of nodes and edges, the edges representing the relationships between the nodes. The relationships allow data in the store to be linked together directly and, in many cases, retrieved with one operation. Graph databases hold the relationships between data as a priority.
What is Neo4j?
Neo4j is an open-source, NoSQL, native graph database that provides an ACID-compliant transactional backend for your applications. Neo4j is referred to as a native graph database because it efficiently implements the property graph model down to the storage level. This means that the data is stored exactly as you whiteboard it, and the database uses pointers to navigate and traverse the graph. In contrast to graph processing or in-memory libraries, Neo4j also provides full database characteristics, including ACID transaction compliance, cluster support, and runtime failover - making it suitable to use graphs for data in production scenarios.
NEO4J :-
You can download Neo4j according to your system requirement from here. Although here I am going to use online Neo4j Sandbox for demo purpose.
1. First of all sign up for the No4j sandbox.
2. After successful login, you will be asked to create or launch a existing project. Here I am going to use pre built "Fraud Detection" project.
3. The selected project will then be initialized to you.
4. Click open with browser to open Neo4j Browser.
5.Your browser screen looks like this:
6. Click database icon on top left corner to explore your graph database.
7. You can write your cypher query in query editor at the top.
8. Let's use Cypher to generate a small social graph.
- Creating node
CREATE (accountHolder1:AccountHolder {
FirstName: "Meghanshi",
LastName: "Prajapati",
UniqueId: "MeghanshiPrajapati" })
CREATE (accountHolder2:AccountHolder {
FirstName: "17IT087",
LastName: "17IT087",
UniqueId: "17IT087" })
- Creating another node and adding relationship.
CREATE (accountHolder1:AccountHolder {
FirstName: "Meghanshi",
LastName: "Prajapati",
UniqueId: "MeghanshiPrajapati" })
CREATE (accountHolder2:AccountHolder {
FirstName: "17IT087",
LastName: "17IT087",
UniqueId: "17IT087" })
CREATE (address1:Address {
Street: "123 ABC",
City: "Ahmedabad",
State: "Gujarat",
ZipCode: "380015" })
CREATE (accountHolder1)-[:HAS_ADDRESS]->(address1),
(accountHolder2)-[:HAS_ADDRESS]->(address1)
- Adding more Attributes(nodes) and relationship
- GEXF
- GraphML
- Pajek NET
- GDF
- GML
- Tulip TLP
- CSV
- Compressed Zip
- Select the 'import spreadsheet' option and import your dataset file.
- Here, we uploaded the 'mall_customer.csv' file, after that click next.
- Click finish to load the dataset file.
- Here, we can observe the number of edges and nodes.
- Below figure shows the number of nodes.
- Below figure shows the number of edges
- Click on the overview button to visualize the dataset
- Introduction
- Run
- Choice
- ForceAtlas
- Fruchterman-Reingold
- YifanHu Multilevel
- OpenOrd
- ForceAtlas 2
- Circular Layout
- Radial Axis Layout
- Geographic map
- Node overlapping
- Geometric transform
Comments
Post a Comment