-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
neo4j.html
354 lines (304 loc) · 18.8 KB
/
neo4j.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Neo4j</title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/Favicon-1.png" rel="icon">
<link href="assets/img/Favicon-1.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/aos/aos.css" rel="stylesheet">
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
<link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet">
<!-- Creating a python code section-->
<link rel="stylesheet" href="assets/css/prism.css">
<script src="assets/js/prism.js"></script>
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
<!-- To set the icon, visit https://fontawesome.com/account-->
<script src="https://kit.fontawesome.com/5d25c1efd3.js" crossorigin="anonymous"></script>
<!-- end of icon-->
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<style>
/* Add some basic styling for code */
pre {
background-color: #f4f4f4;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
font-family: monospace;
white-space: pre-wrap;
}
</style>
<!-- =======================================================
* Template Name: iPortfolio
* Updated: Sep 18 2023 with Bootstrap v5.3.2
* Template URL: https://bootstrapmade.com/iportfolio-bootstrap-portfolio-websites-template/
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
======================================================== -->
</head>
<body>
<!-- ======= Mobile nav toggle button ======= -->
<i class="bi bi-list mobile-nav-toggle d-xl-none"></i>
<!-- ======= Header ======= -->
<header id="header">
<div class="d-flex flex-column">
<div class="profile">
<img src="assets/img/myphoto.jpeg" alt="" class="img-fluid rounded-circle">
<h1 class="text-light"><a href="index.html">Arun</a></h1>
<div class="social-links mt-3 text-center">
<a href="https://www.linkedin.com/in/arunp77/" target="_blank" class="linkedin"><i class="bx bxl-linkedin"></i></a>
<a href="https://github.com/arunp77" target="_blank" class="github"><i class="bx bxl-github"></i></a>
<a href="https://twitter.com/arunp77_" target="_blank" class="twitter"><i class="bx bxl-twitter"></i></a>
<a href="https://www.instagram.com/arunp77/" target="_blank" class="instagram"><i class="bx bxl-instagram"></i></a>
<a href="https://arunp77.medium.com/" target="_blank" class="medium"><i class="bx bxl-medium"></i></a>
</div>
</div>
<nav id="navbar" class="nav-menu navbar">
<ul>
<li><a href="index.html#hero" class="nav-link scrollto active"><i class="bx bx-home"></i> <span>Home</span></a></li>
<li><a href="index.html#about" class="nav-link scrollto"><i class="bx bx-user"></i> <span>About</span></a></li>
<li><a href="index.html#resume" class="nav-link scrollto"><i class="bx bx-file-blank"></i> <span>Resume</span></a></li>
<li><a href="index.html#portfolio" class="nav-link scrollto"><i class="bx bx-book-content"></i> <span>Portfolio</span></a></li>
<li><a href="index.html#skills-and-tools" class="nav-link scrollto"><i class="bx bx-wrench"></i> <span>Skills and Tools</span></a></li>
<li><a href="index.html#language" class="nav-link scrollto"><i class="bi bi-menu-up"></i> <span>Languages</span></a></li>
<li><a href="index.html#awards" class="nav-link scrollto"><i class="bi bi-award-fill"></i> <span>Awards</span></a></li>
<li><a href="index.html#professionalcourses" class="nav-link scrollto"><i class="bx bx-book-alt"></i> <span>Professional Certification</span></a></li>
<li><a href="index.html#publications" class="nav-link scrollto"><i class="bx bx-news"></i> <span>Publications</span></a></li>
<li><a href="index.html#extra-curricular" class="nav-link scrollto"><i class="bx bx-rocket"></i> <span>Extra-Curricular Activities</span></a></li>
<!-- <li><a href="#contact" class="nav-link scrollto"><i class="bx bx-envelope"></i> <span>Contact</span></a></li> -->
</ul>
</nav><!-- .nav-menu -->
</div>
</header><!-- End Header -->
<main id="main">
<!-- ======= Breadcrumbs ======= -->
<section id="breadcrumbs" class="breadcrumbs">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<h2>Data Engineering</h2>
<ol>
<li><a href="Data-engineering.html" class="clickable-box">Content section</a></li>
<li><a href="index.html#portfolio" class="clickable-box">Portfolio section</a></li>
</ol>
</div>
</div>
</section><!-- End Breadcrumbs -->
<!------ right dropdown menue ------->
<div class="right-side-list">
<div class="dropdown">
<button class="dropbtn"><strong>Shortcuts:</strong></button>
<div class="dropdown-content">
<ul>
<li><a href="cloud-compute.html"><i class="fas fa-cloud"></i> Cloud</a></li>
<li><a href="AWS-GCP.html"><i class="fas fa-cloud"></i> AWS-GCP</a></li>
<li><a href="amazon-s3.html"><i class="fas fa-cloud"></i> AWS S3</a></li>
<li><a href="ec2-confi.html"><i class="fas fa-server"></i> EC2</a></li>
<li><a href="Docker-Container.html"><i class="fab fa-docker" style="color: rgb(29, 27, 27);"></i> Docker</a></li>
<li><a href="Jupyter-nifi.html"><i class="fab fa-python" style="color: rgb(34, 32, 32);"></i> Jupyter-nifi</a></li>
<li><a href="snowflake-task-stream.html"><i class="fas fa-snowflake"></i> Snowflake</a></li>
<li><a href="data-model.html"><i class="fas fa-database"></i> Data modeling</a></li>
<li><a href="sql-basics.html"><i class="fas fa-table"></i> QL</a></li>
<li><a href="sql-basic-details.html"><i class="fas fa-database"></i> SQL</a></li>
<li><a href="Bigquerry-sql.html"><i class="fas fa-database"></i> Bigquerry</a></li>
<li><a href="scd.html"><i class="fas fa-archive"></i> SCD</a></li>
<li><a href="sql-project.html"><i class="fas fa-database"></i> SQL project</a></li>
<!-- Add more subsections as needed -->
</ul>
</div>
</div>
</div>
<!-- ======= Portfolio Details Section ======= -->
<section id="portfolio-details" class="portfolio-details">
<div class="container">
<div class="row gy-4">
<h1>Neo4j & Graph theory</h1>
<div class="col-lg-8">
<div class="portfolio-details-slider swiper">
<div class="swiper-wrapper align-items-center">
<figure>
<img src="assets/img/data-engineering/neo4j.png" alt="" style="max-width: 80%; max-height: auto;">
<figcaption></figcaption>
</figure>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
<div class="col-lg-4 grey-box">
<div class="section-title">
<h3>Content</h3>
<ol>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#reference">Reference</a></li>
</ol>
</div>
</div>
</div>
<section>
<h3 id="introduction">Introduction</h3>
We'll explore graph-oriented databases using Neo4j as a prominent example in the present page. Graph databases are a type of NoSQL database designed to handle data with complex relationships more efficiently than traditional relational databases.
This discussion will delve into the organizational structure of data within such databases and
uncover the advantages derived from graph theory.
<h4>Intoduction to graph theory</h4>
Graph theory, a branch of mathematics, focuses on examining the relationships between various entities. To simplify the concept of a graph, it can be defined as a collection of nodes, some of which may be connected by edges.
Here are the key points in Graph theory:
<ul>
<li><strong>Nodes: </strong>Represent entities in the system.</li>
<li><strong>Edges: </strong>Define relationships between nodes, often with properties describing the connection.</li>
<li><strong>Properties: </strong>Key-value pairs associated with nodes and edges.</li>
</ul>
The key characteristics of the grapg theory is as follows:
<ul>
<li><strong>Flexibility: </strong>Graph databases are schema-less, allowing for dynamic and evolving data structures.</li>
<li><strong>Performance: </strong>Well-suited for relationship-heavy data, providing fast query performance for complex queries.</li>
</ul>
<h4>Common Graph Database Models</h4>
<ul>
<li><strong>Property Graph Model: </strong>Nodes and edges can have properties. Commonly used by databases like Neo4j.</li>
<pre class="language-sql"><code>
(Person)-[:FRIENDS_WITH {since: 2010}]->(Person)
</code></pre>
<li><strong>Resource Description Framework (RDF): </strong>Represents information in the form of subject-predicate-object triples. Used in databases like Virtuoso and Stardog.</li>
</ul>
<!-------------------->
<h3>Neo4j</h3>
Neo4J is a graph database management system developed in Java. Its first version dates from 2000. Neo4J is undoubtedly one of the most popular GDBMS. We could also quote Orientdb, Arangodb.
<figure>
<img src="assets/img/data-engineering/Neo4j-logo_color.png" alt="" style="max-width: 40%; max-height: auto;">
<figcaption></figcaption>
</figure>
Neo4J is interesting for its ease of use, in particular via its graphical interface and the language to be used to require data : CYPHER.
<!-------------------->
<h3>Cypher Query Language</h3>
Cypher is a declarative query language designed specifically for querying graph databases. It is primarily associated with Neo4j, one of the leading graph database management systems. Cypher is designed to express patterns and relationships
in the graph data model efficiently. Here are some key features and concepts of Cypher:
<ol>
<li><strong>Pattern Matching: </strong>Cypher uses a pattern-matching syntax to describe the structure of the graph you want to query.
<pre class="language-sql"><code>
MATCH (p:Person)-[:FRIENDS_WITH]->(friend)
RETURN p.name, friend.name
</code></pre>
In this example, it's matching a pattern where a <code>Person</code> node is connected to another <code>Person</code> node with a <code>FRIENDS_WITH</code> relationship.
</li>
<li><strong>Nodes and Relationships</strong>Nodes are represented by parentheses <code>( )</code>, and relationships by square brackets <code>[ ]</code>. You can assign labels and properties to nodes and specify relationship types and properties.</li>
<li><strong>Filtering and Conditions</strong> You can filter query results using conditions in the WHERE clause.
<pre class="language-sql"><code>
MATCH (p:Person)
WHERE p.age > 25
RETURN p.name
</code></pre>
</li>
<li><strong>Return Clause</strong> The <code>RETURN</code> clause specifies what data should be returned in the result set.
<pre class="language-sql"><code>
MATCH (p:Person)-[:FRIENDS_WITH]->(friend)
RETURN p.name, friend.name
</code></pre>
</li>
<li><strong>CREATE and SET Clauses: </strong>Used for creating nodes and relationships or updating properties.
<pre class="language-sql"><code>
CREATE (p:Person {name: 'John'})
CREATE (friend)-[:FRIENDS_WITH {since: 2010}]->(p)
</code></pre></li>
<li><strong>MERGE Clause: </strong> Creates or matches a pattern, ensuring that it's unique in the graph.
<pre class="language-sql"><code>MERGE (p:Person {name: 'Alice'})</code></pre></li>
<li><strong>DELETE Clause: </strong> Removes nodes, relationships, or properties from the graph.
<pre class="language-sql"><code>
MATCH (p:Person)
WHERE p.name = 'John'
DELETE p
</code></pre></li>
<li><strong>Aggregation Functions: </strong>Cypher supports aggregation functions like <code>COUNT</code>, <code>SUM</code>, <code>AVG</code>, etc., for summarizing data.
<pre class="language-sql"><code>
MATCH (p:Person)-[:FRIENDS_WITH]->()
RETURN p.name, COUNT(*) AS friendsCount
</code></pre></li>
<li><strong>ORDER BY and LIMIT: </strong> Used for sorting and limiting the result set.
<pre class="language-sql"><code>
MATCH (p:Person)
RETURN p.name
ORDER BY p.age DESC
LIMIT 5
</code></pre></li>
</ol>
Cypher is designed to be expressive and intuitive for querying graph data, making it a powerful tool for developers and data scientists working with graph databases. It enables efficient retrieval and manipulation of interconnected data in a graph.
<!-------------------->
<h5>Example:</h5>
<ul>
<li><strong>Social Networks: </strong> Nodes represent individuals, and edges represent connections or friendships between them. Graph theory can help analyze the structure of social networks and identify influential individuals.</li>
<li><strong>Transportation Networks: </strong>Nodes can represent cities or locations, and edges represent roads, railways, or flight routes connecting them. Graph theory assists in optimizing transportation routes and understanding network connectivity.</li>
<li><strong>Web Pages and Hyperlinks: </strong>Web pages can be represented as nodes, and hyperlinks between pages as edges. Graph theory is applied to analyze the structure of the World Wide Web, identify important pages, and improve search algorithms.</li>
<li><strong>Recommendation Systems: </strong>Nodes can represent users, and edges represent preferences or interactions between them. Graph theory helps build recommendation systems by identifying patterns in user preferences and suggesting relevant items.</li>
<li><strong>Biological Networks: </strong>Nodes may represent proteins, genes, or other biological entities, and edges represent interactions or relationships between them. Graph theory is used in bioinformatics to study biological networks.</li>
<li><strong>Circuit Design: </strong>Components of an electronic circuit can be represented as nodes, and connections between components as edges. Graph theory aids in designing and analyzing electronic circuits.</li>
<li><strong>Epidemiology: </strong>Nodes can represent individuals, and edges represent the potential for disease transmission. Graph theory is applied to model and analyze the spread of diseases in populations.</li>
<li><strong>Knowledge Graphs: </strong>Nodes represent concepts, and edges represent relationships between concepts. Graph theory is used to build knowledge graphs, facilitating semantic understanding and information retrieval.</li>
</ul>
</section>
<!-------Reference ------->
<section id="reference">
<h2>References</h2>
<ul>
<li><a href="https://neo4j.com/developer/get-started/" target="_blank">Getting Started with Neo4j</a></li>
<li><a href="https://www.mongodb.com/docs/manual/reference/method/" target="_blank">MongoDB documentation</a>.</li>
</ul>
</section>
<hr>
<div style="background-color: #f0f0f0; padding: 15px; border-radius: 5px;">
<h3>Some other interesting things to know:</h3>
<ul style="list-style-type: disc; margin-left: 30px;">
<li>Visit my website on <a href="sql-project.html">For Data, Big Data, Data-modeling, Datawarehouse, SQL, cloud-compute.</a></li>
<li>Visit my website on <a href="Data-engineering.html">Data engineering</a></li>
</ul>
</div>
<p></p>
<div class="navigation">
<a href="index.html#portfolio" class="clickable-box">
<span class="arrow-left">Portfolio section</span>
</a>
<a href="Data-engineering.html" class="clickable-box">
<span class="arrow-right">Content</span>
</a>
</div>
</div>
</div>
</section><!-- End Portfolio Details Section -->
</main><!-- End #main --
<!-- ======= Footer ======= -->
<footer id="footer">
<div class="container">
<div class="copyright">
© Copyright <strong><span>Arun</span></strong>
</div>
</div>
</footer><!-- End Footer -->
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/purecounter/purecounter_vanilla.js"></script>
<script src="assets/vendor/aos/aos.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
<script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="assets/vendor/swiper/swiper-bundle.min.js"></script>
<script src="assets/vendor/typed.js/typed.umd.js"></script>
<script src="assets/vendor/waypoints/noframework.waypoints.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>