Download - Neo4j - Graph Database
Neo4j - NoSQL Graph DatabaseMubashar Iqbal | SSE
Confiz Limited
Session Agenda
● What is Graph Database ?● What is Neo4j ?● Cypher● Graph DB Model
Graph Database
A graph database is not about charts, diagrams or vector artwork, it is related with storing data that is structured as a graph.
remember linked lists, trees?
What is Graph Database?
● NoSQL Database● Collection of nodes, edges and properties to represent
and store data. ● Provides index-free adjacency● Properties expressed as key/value pairs● High Performance● Complex Relationships
What is Neo4j?
● Open Source● NoSQL Graph Database● ACID transaction compliance● Runtime Failover● Cluster support● Compact storage● Memory caching for graph● Active Community
Cypher - Query Language
● Cypher is Neo4j’s graph query language.● Match patterns of nodes and relationships in the graph
Example:MATCH (actor:Person)-[:ACTED_IN]->(movie:Movie)WHERE movie.title =~ "T.*"RETURN movie.title as title, collect(actor.name) as castORDER BY title ASC LIMIT 10;
From SQL To Cypher
SQL Cypher
SELECT p.*
FROM products as p;
MATCH (p:Product)RETURN p;
SELECT p.ProductName, p.UnitPriceFROM products as pORDER BY p.UnitPrice DESCLIMIT 10;
MATCH (p:Product)RETURN p.productName, p.unitPriceORDER BY p.unitPrice DESCLIMIT 10;
SELECT p.ProductName, p.UnitPrice
FROM products as p
WHERE p.ProductName IN
('Chocolate',Coffee);
MATCH (p:Product)WHERE p.productName IN ['Chocolate',Coffee]RETURN p.productName, p.unitPrice;
Graph DB Model● Nodes● Labels● Relationships
Questions?
Important LinksReferenceshttp://neo4j.com/developer/get-started/http://www.slideshare.net/neo4j/data-modeling-with-neo4j
Video Tutorialshttps://www.youtube.com/watch?v=7Fsfa5DP9sEhttps://www.youtube.com/watch?v=bqvDSioHYq8
Neo4j for phphttp://neo4j.com/developer/php/