0% found this document useful (0 votes)
12 views

PR 6 No SQL

The document introduces Neo4j graph databases, covering basics like nodes, edges, properties, and Cypher query language. It also discusses use cases for graph databases in areas like social networks and fraud detection, and provides instructions for installing and running Neo4j on Windows.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

PR 6 No SQL

The document introduces Neo4j graph databases, covering basics like nodes, edges, properties, and Cypher query language. It also discusses use cases for graph databases in areas like social networks and fraud detection, and provides instructions for installing and running Neo4j on Windows.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

Practical No: 6
Aim: Introduction to Neo4j Graph Databases
Objective
To introduce students to Neo4j Graph Databases by covering the basics, emphasizing the
property graph model and graph theory fundamentals. It explores use cases in areas like social
networks and fraud detection while guiding students through the installation process of Neo4j
for hands-on experience.

Prerequisite Theory

Basics of graph databases

Graph databases are a type of NoSQL database that uses graph structures with nodes, edges,
and properties to represent and store data. They are particularly well-suited for scenarios where
relationships between entities are important and need to be efficiently queried.

- Node: Represents an entity in the graph.

- Edge: Represents a relationship between two nodes.

- Property: Key-value pairs associated with nodes and edges, providing additional
information.

- Graph databases often use the Cypher query language for data manipulation and retrieval.
Cypher is designed to be expressive and intuitive for querying graph data.

- Graph databases excel at traversing relationships between nodes. You can easily follow
edges to navigate through the graph and discover connections between nodes.

- Graph databases are designed to efficiently handle queries involving relationships, making
them well-suited for applications that involve complex and interconnected data.

Examples of Graph Databases:

A Y Dadabhai Technical Institute, Kosamba Page 1


Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

- Neo4j: A popular open-source graph database.

- Amazon Neptune: A managed graph database service by AWS.

- Microsoft Azure Cosmos DB: Supports graph data models along with other NoSQL
models.

Use Cases:

- Graph databases are suitable for scenarios where relationships are as important as the data
itself, such as social networks, fraud detection, recommendation engines, network analysis, and
knowledge graphs.

1. Social Networks:
- Modeling users as nodes and relationships (friendship, following) as edges allows for
efficient representation and traversal of social networks, enabling features like friend
recommendations.

2. Recommendation Engines:

- Nodes representing users and items (products, content) with edges capturing
interactionshelp build personalized recommendation systems by analyzing the graph structure.

3. Fraud Detection:

- Identifying unusual patterns and connections in financial transactions or user activities by


traversing the graph can efficiently detect fraud and security breaches.

4. Knowledge Graphs:

- Modeling information as nodes and relationships facilitates the creation of knowledge


graphs, aiding in organizing and navigating interconnected data for insights and discovery.

5. Biological and Medical Research:

- Graph databases are employed to represent and analyze relationships between biological
entities (genes, proteins) in genomics research, drug discovery, and systems biology.

6. IT Operations and Dependency Mapping:

- Representing IT components and their dependencies as nodes and edges helps visualizeand
manage complex IT infrastructures, optimizing operations and troubleshooting.

Installing Neo4j on Windows

Follow these instructions to install Neo4j on your server:

1. Install Java:

- If OpenJDK 11 or Oracle Java 11 is not already installed, obtain and install it on your
system.

A Y Dadabhai Technical Institute, Kosamba Page 2


Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

- Set the `JAVA_HOME` environment variable to the installation path of your JDK.

2. Download Neo4j:

- Visit the Neo4j Download Center and download the latest release.
- https://neo4j.com/deployment-center/

- Always download Neo4j from the Neo4j Download Center.

- Verify the integrity by checking the SHA hash. Click on SHA-256 below your downloaded
file on the Download Center and compare it with the calculated SHA-256 hash using platform-
specific commands.

- Right-click the downloaded ZIP file and select "Extract All."

- Choose a permanent location for the extracted files, for example, D:\neo4j\ (referred to as
NEO4J_HOME).

3. Run Neo4j:

- To run Neo4j as a console application, use: `<NEO4J_HOME>\bin\neo4j console`.

A Y Dadabhai Technical Institute, Kosamba Page 3


Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

- To install Neo4j as a service, use: `<NEO4J_HOME>\bin\neo4j install-service`.

A Y Dadabhai Technical Institute, Kosamba Page 4


Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

Start neo4j with command neo4j start

4. Access Neo4j Browser:

- Visit http://localhost:7474 in your web browser.

- Connect using the username 'neo4j' with the default password 'neo4j'.

- You will be prompted to change the password.

- Stop the server by typing Ctrl-C in the console.

A Y Dadabhai Technical Institute, Kosamba Page 5


Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

Practical related Questions

Multiple Choice Questions (MCQs):

1. What are the fundamental components of graph


databases?
c) Tables and fields
a) Rows and columns
d) Documents and collections
b) Nodes, edges, and properties

Answer:

2. Which query language is commonly used for data manipulation and retrieval in graph databases?

a) SQL c) MongoDB Query Language


b) Cypher d) GraphQL
Answer:

3. In a graph database, what does a "node" represent?

a) A document c) A table
b) An entity in the graph d) A row

Answer:

4. What is the purpose of the Cypher query language in graph databases?

a) To perform statistical analysis c) To query traditional relational databases


d) To handle file I/O operations
b) To manipulate graph data

Answer:

5. Graph databases excel at traversing relationships


between:
c) Nodes
a) Columns
d) Documents
b) Tables

Answer:

6. Which of the following is a popular open-source graph database?


a) jMongoDB c) Amazon Neptune

b) Neo4 d) Microsoft Azure Cosmos DB

Answer:

A Y Dadabhai Technical Institute, Kosamba Page 6


Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

7. In which scenario would a graph database be most suitable?

a) Storing static tabular data c) Analyzing complex and interconnected relationships


b) Managing textual documents d)Performing numerical calculations

Answer:

8. What type of database is Amazon Neptune?

a) Document database c) Relational database

b) Graph database d) Key-value store

Answer:

9. What is one of the use cases mentioned for graph


databases?
c) Fraud detection
a) Image recognition
d) Time series analysis
b) Sentiment analysis

Answer:

10. How is the installation location of Neo4j referred to in the instructions?

a) N4J_HOME c) JAVA_HOME
b) NEO4J_DIR d) NEO4J_HOME
Answer:

11. To access Neo4j Browser, you should visit:

a) http://localhost:8080 c) http://127.0.0.1:8000

b) http://localhost:7474 d) http://neo4j-browser.com

Answer:

12. What command is used to start Neo4j as a console application?

a) neo4j console c) start-neo4j


b) neo4j start-console d) init-neo4j
Answer:

A Y Dadabhai Technical Institute, Kosamba Page 7


Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

A Y Dadabhai Technical Institute, Kosamba Page 8


Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

Match the Following:

1. Node a) A managed graph database service by AWS.


2. Cypher b) Represents a relationship between two nodes.
3. Amazon c ) Query language for graph databases.
Neptune d) An entity in the graph.
4. Edge e) Represents users and items in a
5. Neo4j recommendation system.

Answer:

True/False:

1. Graph databases are particularly well-suited for scenarios where relationships between
entities are notimportant.

2. The Cypher query language is specifically designed for querying relational databases.

3. Nodes in a graph database represent entities, while edges represent properties.

4. Amazon Neptune is an example of a document database.

5. Graph databases are not efficient in handling queries involving relationships.

6. To install Neo4j as a service, the command is `<NEO4J_HOME>\bin\neo4j run-service`.

A Y Dadabhai Technical Institute, Kosamba Page 9


Introduction to NoSQL (4360704) ENROLLMENT NO: 216010307044

Assessment Rubrics

Needs
Criteria Excellent (10) Good (7) Satisfactory
Improvement Marks
(5)
(3)
Has a
Understandingof Demonstrates a Shows a strong satisfactory Struggles with
profound understanding of
Basics of Graph understanding basic conceptsof
understanding of the basics of
Databases of the basics of graph databases
the basics of graph databases
graph databases
graph databases

Demonstrates a Lacks
Comprehensionof Exhibits a deep Shows a basic
good understanding
Graph Theory comprehension comprehension
comprehensionof of graph theory
Fundamentals of graph theory of graph theory
graph theory fundamentals
fundamentals fundamentals
fundamentals
Effectively Attempts to
Application of Adequately Struggles to
applies graph apply graph
Graph Databases applies graph apply graph
databases in databases but
in Use Cases databases in some databases in
various use with
use cases use cases
cases significant
issues
Unable to install
Successful Installs Neo4j Installs Neo4j Installs Neo4j Neo4j or
Installation of successfully with with minor with major encounters
Neo4j no issues issues issues critical
installation
issues
Average Marks

Signature with date

A Y Dadabhai Technical Institute, Kosamba Page 9

You might also like