SlideShare a Scribd company logo
Introduction to 

Graph Database
!

Eric C.Y. LEE

eric@nus.edu.sg

eric@eric.lv

National University of Singapore
February, 2014
Outline
•

Relational Database v.s. Graph Database

•

Design the Database in Graph Architecture

•

Basic Usage of Neo4j

•

Cypher Query Language

•

Business application

!2
Relational Database
•

Based on table schema.
•

Field -> Record -> Table -> Database

•

Query by SQL syntax.

•

Open source and commercial products available.
•

MySQL, Oracle, PostgreSQL, MS-SQL Server.

•

LAMP: Linux+Apache+MySQL+PHP
!3
Graph Database
•

Schema-less, based on graph theory.

•

Only two types of data inside the graph database.
•

Node and relationship (edge) .

•

One of the NoSQL database management systems, query by
several query languages, depend on database products.

•

Widely use in social network system and large scale website
architecture.

!4

Figure Credit: Wikipedia
Modelling a K-pop Database

All materials for database construction, 

we can find in these wikipedia pages.

!5
The information I want to
provide.
•

Team member profiles
•

•

Group, Name, Birth Place,Birth Year, Birth Month

Released albums
•

Title, Released Year, Number of Sales

!6
K-Pop Profiles in Table View
Group
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
KARA
KARA
KARA
KARA

Name
Taeyeon
Jessica
Sunny
Tiffany
Hyoyeon
Yuri
Sooyoung
Yoona
Seohyun
Gyuri
Seungyeon
Hara
Jiyoung

Birth Place
Korea
U.S.A.
U.S.A.
U.S.A.
Korea
Korea
Korea
Korea
Korea
Korea
Korea
Korea
Korea
!7

Birth Year
1989
1989
1989
1989
1989
1989
1990
1990
1991
1988
1988
1991
1994

Birth Month
March
April
May
August
September
December
February
May
June
May
July
January
January
Any finding?
K-Pop Albums in Table View
Group

Title

Released Year

Number of sales

SNSD

Girls’ Generation

2007

284994

SNSD

Oh

2010

406662

SNSD

The Boys

2011

449616

SNSD

I GOT A BOY

2013

293302

KARA

BLOOMING

2007

50000

KARA

REVOLUTION

2009

80000

KARA

STEP

2011

100662

KARA

FULL BLOOM

2013

46199

!8

Any finding?
Group
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
KARA
KARA
KARA
KARA

SNSD
KARA

Name
Taeyeon
Jessica
Sunny
Tiffany
Hyoyeon
Yuri
Sooyoung
Yoona
Seohyun
Gyuri
Seungyeon
Hara
Jiyoung

Birth Place
Korea
U.S.A.
U.S.A.
U.S.A.
Korea
Korea
Korea
Korea
Korea
Korea
Korea
Korea
Korea

U.S.A
Korea
!9

Birth Year
1989
1989
1989
1989
1989
1989
1990
1990
1991
1988
1988
1991
1994

1988
1989
1990
1991
1994

Birth Month
March
April
May
August
September
December
February
May
June
May
July
January
January
January
February
March
April September
May December
June
July
August
Group

Title

Released Year

Number of sales

SNSD

Girls’ Generation

2007

284994

SNSD

Oh

2010

406662

SNSD

The Boys

2011

449616

SNSD

I GOT A BOY

2013

293302

KARA

BLOOMING

2007

50000

KARA

REVOLUTION

2009

80000

KARA

STEP

2011

100662

KARA

FULL BLOOM

2013

46199

2007
2009
2010
2011
2013

SNSD
KARA
!10
Graph Modelling

!11
Neo4j
1. Download latest version 2.0.1 from www.neo4j.org
2. Cross-platform, Java 1.7 is required.
3. Extract the compressed package, execute main
program.
4. Web console: http://localhost:7474
2
1

3

!12

4
Default Web Console
Query Statement Input

Query Result Area
Web Admin Interface
•

URL localhost:7474/webadmin/

!14
Allow Remote Connection
•

Modify configuration file. 

(/neo4j-root/conf/neo4j-server.properties)

•

Uncomment #org.neo4j.server.webserver.address=0.0.0.0

!15
Cypher
•

Basic statement: MATCH, CREATE, WHERE,
RETURN

•

Inspired by “ASCII Art”.




MATCH (singer)-[:BIRTH_PLACE]->(country) 

RETURN singer, country;

singer

BIRTH PLACE

country

(singer)-[:BIRTH_PLACE]->(country)
!16
Cypher of Example
•

Create the Nodes
•

Singer

CREATE (n:Singer {name:”Taeyeon”})

CREATE (n:Singer {name:”Jessica”})

CREATE (n:Singer {name:”Sunny”})

CREATE (n:Singer {name:”Tiffany”})

CREATE (n:Singer {name:”Hyoyeon”})

CREATE (n:Singer {name:”Yuri”})

CREATE (n:Singer {name:”Sooyoung”})

CREATE (n:Singer {name:”Yoona”})

CREATE (n:Singer {name:”Seohyun”})

CREATE (n:Singer {name:”Gyuri”})

CREATE (n:Singer {name:”Seungyeon”})

CREATE (n:Singer {name:”Hara”})

CREATE (n:Singer {name:”Jiyoung”})


!17

•

Group

CREATE (n:Group {name:”SNSD”})

CREATE (n:Group {name:”KARA”})

•

Year

CREATE (n:Year {year:”1988”})

CREATE (n:Year {year:”1989”})

CREATE (n:Year {year:”1990”})

CREATE (n:Year {year:”1991”})

CREATE (n:Year {year:”1994”})

CREATE (n:Year {year:”2007”})

CREATE (n:Year {year:”2009”})

CREATE (n:Year {year:”2010”})

CREATE (n:Year {year:”2011”})

CREATE (n:Year {year:”2013”})
Cypher of Example
•

Create the Nodes
•

Album


•

CREATE (n:Album {name:”Girl’s Generation”,
sales: “284994”})

CREATE (n:Album {name:”Oh”, sales:”406662”})

CREATE (n:Album {name:”The boys”,
sales:”449616”})

CREATE (n:Album {name:”I got a boy”,
sales:”293302”})

CREATE (n:Album
{name:”Blooming”,sales:”50000”})

CREATE (n:Album
{name:”Revolution”,sales:”80000”})

CREATE (n:Album {name:”STEP”,sales:”100662”})

CREATE (n:Album {name:”Full
Bloom”,sales:”46199”})




!18

Country

CREATE (n:Country {name:”U.S.A.”})

CREATE (n:Country {name:”Korea”})

•

Month

CREATE (n:Month {month:”January”})

CREATE (n:Month {month:”February”})

CREATE (n:Month {month:”March”})

CREATE (n:Month {month:”April”})

CREATE (n:Month {month:”May”})

CREATE (n:Month {month:”June”})

CREATE (n:Month {month:”July”})

CREATE (n:Month {month:”August”})

CREATE (n:Month {month:”September”})

CREATE (n:Month {month:”December”})
Cypher of Example
•

Create Relationships
•

Group and Members [:HAS_MEMBER]

MATCH (snsd:Group{name:”SNSD”}), (taeyeon:Singer{name:”Taeyeon”}),
(jessica:Singer{name:”Jessica”}),(sunny:Singer{name:”Sunny”}),
(tiffany:Singer{name:”Tiffany”}),(hyoyeon:Singer{name:”Hyoyeon”}),
(yuri:Singer{name:”Yuri”}),(sooyoung:Singer{name:”Sooyoung”}),
(yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”})

CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(taeyeon)

CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(jessica)

CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(tiffany)

CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(sunny)

CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(hyoyeon)

CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(yuri)

CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(sooyoung)

CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(yoona)

CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(seohyun)
!19
Cypher of Example
•

Create Relationships
•

Group and Members [:HAS_MEMBER]

MATCH (kara:Group{name:”KARA”}),
(gyuri:Singer{name:”Gyuri”}),
(seungyeon:Singer{name:”Seungyeon”}),
(hara:Singer{name:”Hara”}),
(jiyoung:Singer{name:”Jiyoung”})

CREATE UNIQUE (kara)-[:HAS_MEMBER]->(gyuri)

CREATE UNIQUE (kara)-[:HAS_MEMBER]->(seungyeon)

CREATE UNIQUE (kara)-[:HAS_MEMBER]->(hara)

CREATE UNIQUE (kara)-[:HAS_MEMBER]->(jiyoung)

!20
Cypher of Example
•

Create Relationships
Albums and Released Year [:RELEASED_YEAR]

MATCH (y2007:Year{year:”2007”}), 

(y2009:Year{year:”2009”}),(y2010:Year{year:”2010”}),(y2011:Year{year:”2011”}),
(y2012:Year{year:”2012”}),(y2013:Year{year:”2013”}),

(album1:Album{name:”Girl’s Generation”}),

(album2:Album{name:”Oh”}),

(album3:Album{name:”The boys”}),

(album4:Album{name:”I got a boy”}),

(album5:Album{name:”Blooming”}),

(album6:Album{name:”Revolution”}),

(album7:Album{name:”STEP”}),

(album8:Album{name:”Full Bloom”})

CREATE UNIQUE (album1)-[:RELEASED_YEAR]->(y2007)

CREATE UNIQUE (album2)-[:RELEASED_YEAR]->(y2010)

CREATE UNIQUE (album3)-[:RELEASED_YEAR]->(y2011)

CREATE UNIQUE (album4)-[:RELEASED_YEAR]->(y2013)

CREATE UNIQUE (album5)-[:RELEASED_YEAR]->(y2007)

CREATE UNIQUE (album6)-[:RELEASED_YEAR]->(y2009)

CREATE UNIQUE (album7)-[:RELEASED_YEAR]->(y2011)

CREATE UNIQUE (album8)-[:RELEASED_YEAR]->(y2013)


•




!21
Cypher of Example
•

Create Relationships
•

Group and Albums [:HAS_ALBUM]

MATCH (kara:Group{name:”KARA”}), 

(snsd:Group{name:”SNSD”}),

(album1:Album{name:”Girl’s Generation”}),

(album2:Album{name:”Oh”}),

(album3:Album{name:”The boys”}),

(album4:Album{name:”I got a boy”}),

(album5:Album{name:”Blooming”}),

(album6:Album{name:”Revolution”}),

(album7:Album{name:”STEP”}),

(album8:Album{name:”Full Bloom”})

CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album1)

CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album2)

CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album3)

CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album4)

CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album5)

CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album6)

CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album7)

CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album8)


!22
Cypher of Example
•

Create Relationships
Singer and Country [:BIRTH_PLACE]

MATCH (korea:Country{name:”Korea”}), 

(gyuri:Singer{name:”Gyuri”}),

(seungyeon:Singer{name:”Seungyeon”}),

(hara:Singer{name:”Hara”}),

(jiyoung:Singer{name:”Jiyoung”}),(taeyeon:Singer{name:”Taeyeon”}),
(hyoyeon:Singer{name:”Hyoyeon”}),(yuri:Singer{name:”Yuri”}),(sooyoung:Singer{name:”Sooyoung”}),
(yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”})


•



CREATE UNIQUE (gyuri)-[:BIRTH_PLACE]->(korea)

CREATE UNIQUE (seungyeon)-[:BIRTH_PLACE]->(korea)

CREATE UNIQUE (hara)-[:BIRTH_PLACE]->(korea)

CREATE UNIQUE (jiyoung)-[:BIRTH_PLACE]->(korea)

CREATE UNIQUE (taeyeon)-[:BIRTH_PLACE]->(korea)

CREATE UNIQUE (hyoyeon)-[:BIRTH_PLACE]->(korea)

CREATE UNIQUE (yuri)-[:BIRTH_PLACE]->(korea)

CREATE UNIQUE (sooyoung)-[:BIRTH_PLACE]->(korea)

CREATE UNIQUE (yoona)-[:BIRTH_PLACE]->(korea)

CREATE UNIQUE (seohyun)-[:BIRTH_PLACE]->(korea)

!23
Cypher of Example
•

Create Relationships
Singer and Country [:BIRTH_PLACE]

MATCH (usa:Country{name:”USA”}), 

(jessica:Singer{name:”Jessica”}),

(tiffany:Singer{name:”Tiffany”}),

(sunny:Singer{name:”Sunny”})


•



CREATE UNIQUE (jessica)-[:BIRTH_PLACE]->(usa)

CREATE UNIQUE (tiffany)-[:BIRTH_PLACE]->(usa)

CREATE UNIQUE (sunny)-[:BIRTH_PLACE]->(usa)

!24
Cypher of Example
•

Create Relationships
Singer and Birth Year [:BIRTH_YEAR]

MATCH (y1988:Year{Year:”1988”}),(y1989:Year{Year:”1989”}),(y1990:Year{Year:”1990”}), (y1991:Year{Year:”1991”}),
(y1994:Year{Year:”1994”}),

(gyuri:Singer{name:”Gyuri”}),(seungyeon:Singer{name:”Seungyeon”}),(taeyeon:Singer{name:”Taeyeon”}),
(jessica:Singer{name:”Jessica”}),(sunny:Singer{name:”Sunny”}),(tiffany:Singer{name:”Tiffany”}),
(yuri:Singer{name:”Yuri”}),(hyoyeon:Singer{name:”Hyoyeon”}),(sooyoung:Singer{name:”Sooyoung”}),
(yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”}),(hara:Singer{name:”Hara”}),
(jiyoung:Singer{name:”Jiyoung”})


•






CREATE UNIQUE (gyuri)-[:BIRTH_YEAR]->(y1988)

CREATE UNIQUE (seungyeon)-[:BIRTH_YEAR]->(y1988)

CREATE UNIQUE (taeyeon)-[:BIRTH_YEAR]->(y1989)

CREATE UNIQUE (jessica)-[:BIRTH_YEAR]->(y1989)

CREATE UNIQUE (sunny)-[:BIRTH_YEAR]->(y1989)

CREATE UNIQUE (tiffany)-[:BIRTH_YEAR]->(y1989)

CREATE UNIQUE (hyoyeon)-[:BIRTH_YEAR]->(y1989)

CREATE UNIQUE (yuri)-[:BIRTH_YEAR]->(y1989)

CREATE UNIQUE (sooyoung)-[:BIRTH_YEAR]->(y1990)

CREATE UNIQUE (yoona)-[:BIRTH_YEAR]->(y1990)

CREATE UNIQUE (seohyun)-[:BIRTH_YEAR]->(y1991)

CREATE UNIQUE (hara)-[:BIRTH_YEAR]->(y1991)

CREATE UNIQUE (jiyoung)-[:BIRTH_YEAR]->(y1994)


!25
Cypher of Example
•

Create Relationships
Singer and Birth Month [:BIRTH_MONTH]

MATCH (jan:Month{Month:”January”}),(feb:Month{Month:”February”}),(mar:Month{Month:”March”}),
(apr:Month{Month:”April”}), (may:Month{Month:”May”}),(jun:Month{Month:”June”}),(jul:Month{Month:”July”}),
(aug:Month{Month:”August”}),(sep:Month{Month:”September”}),(dec:Month{Month:”December”}),

(gyuri:Singer{name:”Gyuri”}),(seungyeon:Singer{name:”Seungyeon”}),(taeyeon:Singer{name:”Taeyeon”}),
(jessica:Singer{name:”Jessica”}),(sunny:Singer{name:”Sunny”}),(tiffany:Singer{name:”Tiffany”}),
(yuri:Singer{name:”Yuri”}),(hyoyeon:Singer{name:”Hyoyeon”}),(sooyoung:Singer{name:”Sooyoung”}),
(yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”}),(hara:Singer{name:”Hara”}),
(jiyoung:Singer{name:”Jiyoung”})


•






CREATE UNIQUE (hara)-[:BIRTH_MONTH]->(jan)

CREATE UNIQUE (jiyoung)-[:BIRTH_MONTH]->(jan)

CREATE UNIQUE (sooyoung)-[:BIRTH_MONTH]->(feb)

CREATE UNIQUE (taeyeon)-[:BIRTH_MONTH]->(mar)

CREATE UNIQUE (jessica)-[:BIRTH_MONTH]->(apr)

CREATE UNIQUE (sunny)-[:BIRTH_MONTH]->(may)

CREATE UNIQUE (yoona)-[:BIRTH_MONTH]->(may)

CREATE UNIQUE (gyuri)-[:BIRTH_MONTH]->(may)

CREATE UNIQUE (seohyun)-[:BIRTH_MONTH]->(jun)

CREATE UNIQUE (seungyeon)-[:BIRTH_MONTH]->(jul)

CREATE UNIQUE (tiffany)-[:BIRTH_MONTH]->(aug)

CREATE UNIQUE (hyoyeon)-[:BIRTH_MONTH]->(sep)

CREATE UNIQUE (yuri)-[:BIRTH_MONTH]->(dec)

!26
Query Cases
Who is the member of Girl’s Generation(SNSD)?


•




MATCH (snsd{name:”SNSD”})-[:HAS_MEMBER]->(member)

RETURN member;	

Who is the youngest member of KARA?


•




MATCH (kara{name:”KARA”})-[:HAS_MEMBER]->(member),
(member)-[:BIRTH_YEAR]->(year)

RETURN member, ORDER BY (year.year) LIMIT 1 ;

!27
Query Cases
Who is not born in Korea? Who and where.


•




MATCH (singer)-[:BIRTH_PLACE]->(country) 

WHERE NOT country.name="Korea" 

RETURN singer, country;	

Which album is the top selling of SNSD? Show the
album name and number.


•




MATCH (Group{name:”SNSD”})-[:HAS_ALBUM]->(albums)

WITH albums ORDER BY albums.sales DESC

RETURN albums LIMIT 1;
!28
Business Application
GENDER_IS
Customer:A
Male

BOUGHT_ALBUM

Customer:B

GENDER_IS

BOUGHT_ALBUM

Integrate a subset graph of customer 

purchase history to the existed K-pop
database.

!29
Potential Orders?
Customer:B bought SNSD and KARA’s album, we can promote albums of
T-ARA to him?


•




Both SNSD and KARA are female K-pop groups, T-ARA is female K-pop
group too.
Give Customer:A price discount, push him buy the album “I GOT A BOY”.


•




SNSD has 4 albums. According to the graph, Customer:A bought the 3
albums from us. He didn’t buy “I GOT A BOY”.
Ask male customer buy female K-pop groups’ album is much easier.


•



The database shows most of female K-pop group album buyers are male.

!30
[:HAS_STUDENT]

Person

Name:”TAN TIN WEE”

Occupation: “Professor”

[:HAS_MODULE]
Person

Name:”Eric Lee”

Occupation: “Student”

[:HAS_TA]
[:HAS_TA]

[:SAY]

Person

Name:”Christine Eng”

Occupation: “Student”

[:HAS_STUDENT]

Module

ID:”LSM3241”

Name:”Bioinformatics and
Biocomputing”

[:HAS_TA]
Person

Name:”Hu Yongli”

Occupation: “Student”

Sentence

Sentence:”Thank you!”
!31

More Related Content

What's hot

An Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4jAn Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4j
Debanjan Mahata
 
Graph database
Graph database Graph database
Graph database
Shruti Arya
 
Intro to Neo4j and Graph Databases
Intro to Neo4j and Graph DatabasesIntro to Neo4j and Graph Databases
Intro to Neo4j and Graph Databases
Neo4j
 
An overview of Neo4j Internals
An overview of Neo4j InternalsAn overview of Neo4j Internals
An overview of Neo4j InternalsTobias Lindaaker
 
Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
Max De Marzi
 
Introduction to PySpark
Introduction to PySparkIntroduction to PySpark
Introduction to PySpark
Russell Jurney
 
Graph databases
Graph databasesGraph databases
Graph databases
Vinoth Kannan
 
Neo4j 4.1 overview
Neo4j 4.1 overviewNeo4j 4.1 overview
Neo4j 4.1 overview
Neo4j
 
Introduction to Neo4j and .Net
Introduction to Neo4j and .NetIntroduction to Neo4j and .Net
Introduction to Neo4j and .Net
Neo4j
 
Gremlin's Graph Traversal Machinery
Gremlin's Graph Traversal MachineryGremlin's Graph Traversal Machinery
Gremlin's Graph Traversal Machinery
Marko Rodriguez
 
Introduction to RDF & SPARQL
Introduction to RDF & SPARQLIntroduction to RDF & SPARQL
Introduction to RDF & SPARQLOpen Data Support
 
Intro to Neo4j presentation
Intro to Neo4j presentationIntro to Neo4j presentation
Intro to Neo4j presentation
jexp
 
Neo4J : Introduction to Graph Database
Neo4J : Introduction to Graph DatabaseNeo4J : Introduction to Graph Database
Neo4J : Introduction to Graph Database
Mindfire Solutions
 
Introduction: Relational to Graphs
Introduction: Relational to GraphsIntroduction: Relational to Graphs
Introduction: Relational to Graphs
Neo4j
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
Neo4j
 
NoSql
NoSqlNoSql
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
Neo4j
 
Encrypting and Protecting Your Data in Neo4j(Jeff_Tallman).pptx
Encrypting and Protecting Your Data in Neo4j(Jeff_Tallman).pptxEncrypting and Protecting Your Data in Neo4j(Jeff_Tallman).pptx
Encrypting and Protecting Your Data in Neo4j(Jeff_Tallman).pptx
Neo4j
 
Apache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLabApache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLab
CloudxLab
 
Introducing Neo4j
Introducing Neo4jIntroducing Neo4j
Introducing Neo4j
Neo4j
 

What's hot (20)

An Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4jAn Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4j
 
Graph database
Graph database Graph database
Graph database
 
Intro to Neo4j and Graph Databases
Intro to Neo4j and Graph DatabasesIntro to Neo4j and Graph Databases
Intro to Neo4j and Graph Databases
 
An overview of Neo4j Internals
An overview of Neo4j InternalsAn overview of Neo4j Internals
An overview of Neo4j Internals
 
Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
 
Introduction to PySpark
Introduction to PySparkIntroduction to PySpark
Introduction to PySpark
 
Graph databases
Graph databasesGraph databases
Graph databases
 
Neo4j 4.1 overview
Neo4j 4.1 overviewNeo4j 4.1 overview
Neo4j 4.1 overview
 
Introduction to Neo4j and .Net
Introduction to Neo4j and .NetIntroduction to Neo4j and .Net
Introduction to Neo4j and .Net
 
Gremlin's Graph Traversal Machinery
Gremlin's Graph Traversal MachineryGremlin's Graph Traversal Machinery
Gremlin's Graph Traversal Machinery
 
Introduction to RDF & SPARQL
Introduction to RDF & SPARQLIntroduction to RDF & SPARQL
Introduction to RDF & SPARQL
 
Intro to Neo4j presentation
Intro to Neo4j presentationIntro to Neo4j presentation
Intro to Neo4j presentation
 
Neo4J : Introduction to Graph Database
Neo4J : Introduction to Graph DatabaseNeo4J : Introduction to Graph Database
Neo4J : Introduction to Graph Database
 
Introduction: Relational to Graphs
Introduction: Relational to GraphsIntroduction: Relational to Graphs
Introduction: Relational to Graphs
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
 
NoSql
NoSqlNoSql
NoSql
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
 
Encrypting and Protecting Your Data in Neo4j(Jeff_Tallman).pptx
Encrypting and Protecting Your Data in Neo4j(Jeff_Tallman).pptxEncrypting and Protecting Your Data in Neo4j(Jeff_Tallman).pptx
Encrypting and Protecting Your Data in Neo4j(Jeff_Tallman).pptx
 
Apache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLabApache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLab
 
Introducing Neo4j
Introducing Neo4jIntroducing Neo4j
Introducing Neo4j
 

Viewers also liked

COSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4jCOSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4j
Eric Lee
 
Introduction to 3rd sequencing
Introduction to 3rd sequencing Introduction to 3rd sequencing
Introduction to 3rd sequencing Eric Lee
 
SNP Detection for Massively Parallel Whole-genome Sequencing
SNP Detection for Massively Parallel Whole-genome SequencingSNP Detection for Massively Parallel Whole-genome Sequencing
SNP Detection for Massively Parallel Whole-genome SequencingEric Lee
 
Python and Neo4j
Python and Neo4jPython and Neo4j
Python and Neo4j
Eric Lee
 
Neo4j: JDBC Connection Case Using LibreOffice
Neo4j: JDBC Connection Case Using LibreOfficeNeo4j: JDBC Connection Case Using LibreOffice
Neo4j: JDBC Connection Case Using LibreOffice
Eric Lee
 
R3 Corda Simple Tutorial
R3 Corda Simple TutorialR3 Corda Simple Tutorial
R3 Corda Simple Tutorial
Eric Lee
 
Google MAP API
Google MAP APIGoogle MAP API
Google MAP APIEric Lee
 

Viewers also liked (7)

COSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4jCOSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4j
 
Introduction to 3rd sequencing
Introduction to 3rd sequencing Introduction to 3rd sequencing
Introduction to 3rd sequencing
 
SNP Detection for Massively Parallel Whole-genome Sequencing
SNP Detection for Massively Parallel Whole-genome SequencingSNP Detection for Massively Parallel Whole-genome Sequencing
SNP Detection for Massively Parallel Whole-genome Sequencing
 
Python and Neo4j
Python and Neo4jPython and Neo4j
Python and Neo4j
 
Neo4j: JDBC Connection Case Using LibreOffice
Neo4j: JDBC Connection Case Using LibreOfficeNeo4j: JDBC Connection Case Using LibreOffice
Neo4j: JDBC Connection Case Using LibreOffice
 
R3 Corda Simple Tutorial
R3 Corda Simple TutorialR3 Corda Simple Tutorial
R3 Corda Simple Tutorial
 
Google MAP API
Google MAP APIGoogle MAP API
Google MAP API
 

Similar to Introduction to Graph Database

Intro to Neo4j 2.0
Intro to Neo4j 2.0Intro to Neo4j 2.0
Intro to Neo4j 2.0
Peter Neubauer
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
Jeremy Kendall
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query Language
Neo4j
 
Combine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklCombine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quickl
Neo4j
 
Playlist Recommendations @ Spotify
Playlist Recommendations @ SpotifyPlaylist Recommendations @ Spotify
Playlist Recommendations @ Spotify
Nikhil Tibrewal
 
Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...
Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...
Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...
Paul Leclercq
 
Introduction to Graphs with Neo4j
Introduction to Graphs with Neo4jIntroduction to Graphs with Neo4j
Introduction to Graphs with Neo4j
Neo4j
 
seevl: Data-driven music discovery
seevl: Data-driven music discoveryseevl: Data-driven music discovery
seevl: Data-driven music discovery
Alexandre Passant
 
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH) Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
David Fombella Pombal
 
GraphDB
GraphDBGraphDB
Drupal case study: ABC Dig Music
Drupal case study: ABC Dig MusicDrupal case study: ABC Dig Music
Drupal case study: ABC Dig Music
David Peterson
 
Neo4 jv2 english
Neo4 jv2 englishNeo4 jv2 english
Neo4 jv2 english
Thiago Oliveira
 
Schema Design
Schema DesignSchema Design
Schema Design
MongoDB
 
Elasticsearch at EyeEm
Elasticsearch at EyeEmElasticsearch at EyeEm
Elasticsearch at EyeEm
Lars Fronius
 
SVC101 Building Search into Your App - AWS re: Invent 2012
SVC101 Building Search into Your App - AWS re: Invent 2012SVC101 Building Search into Your App - AWS re: Invent 2012
SVC101 Building Search into Your App - AWS re: Invent 2012
Amazon Web Services
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
Nishant Gandhi
 
Who's afraid of graphs
Who's afraid of graphsWho's afraid of graphs
Who's afraid of graphs
SirKetchup
 
NoSQL Tel Aviv Meetup #2: Who Is Afraid of Graphs?
NoSQL Tel Aviv Meetup #2: Who Is Afraid of Graphs?NoSQL Tel Aviv Meetup #2: Who Is Afraid of Graphs?
NoSQL Tel Aviv Meetup #2: Who Is Afraid of Graphs?
NoSQL TLV
 
Graph of Thrones - Neo4j + Game of Thrones
Graph of Thrones - Neo4j + Game of Thrones Graph of Thrones - Neo4j + Game of Thrones
Graph of Thrones - Neo4j + Game of Thrones
Jhonathan de Souza Soares
 
Schema design mongo_boston
Schema design mongo_bostonSchema design mongo_boston
Schema design mongo_bostonMongoDB
 

Similar to Introduction to Graph Database (20)

Intro to Neo4j 2.0
Intro to Neo4j 2.0Intro to Neo4j 2.0
Intro to Neo4j 2.0
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query Language
 
Combine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklCombine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quickl
 
Playlist Recommendations @ Spotify
Playlist Recommendations @ SpotifyPlaylist Recommendations @ Spotify
Playlist Recommendations @ Spotify
 
Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...
Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...
Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...
 
Introduction to Graphs with Neo4j
Introduction to Graphs with Neo4jIntroduction to Graphs with Neo4j
Introduction to Graphs with Neo4j
 
seevl: Data-driven music discovery
seevl: Data-driven music discoveryseevl: Data-driven music discovery
seevl: Data-driven music discovery
 
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH) Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
 
GraphDB
GraphDBGraphDB
GraphDB
 
Drupal case study: ABC Dig Music
Drupal case study: ABC Dig MusicDrupal case study: ABC Dig Music
Drupal case study: ABC Dig Music
 
Neo4 jv2 english
Neo4 jv2 englishNeo4 jv2 english
Neo4 jv2 english
 
Schema Design
Schema DesignSchema Design
Schema Design
 
Elasticsearch at EyeEm
Elasticsearch at EyeEmElasticsearch at EyeEm
Elasticsearch at EyeEm
 
SVC101 Building Search into Your App - AWS re: Invent 2012
SVC101 Building Search into Your App - AWS re: Invent 2012SVC101 Building Search into Your App - AWS re: Invent 2012
SVC101 Building Search into Your App - AWS re: Invent 2012
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
 
Who's afraid of graphs
Who's afraid of graphsWho's afraid of graphs
Who's afraid of graphs
 
NoSQL Tel Aviv Meetup #2: Who Is Afraid of Graphs?
NoSQL Tel Aviv Meetup #2: Who Is Afraid of Graphs?NoSQL Tel Aviv Meetup #2: Who Is Afraid of Graphs?
NoSQL Tel Aviv Meetup #2: Who Is Afraid of Graphs?
 
Graph of Thrones - Neo4j + Game of Thrones
Graph of Thrones - Neo4j + Game of Thrones Graph of Thrones - Neo4j + Game of Thrones
Graph of Thrones - Neo4j + Game of Thrones
 
Schema design mongo_boston
Schema design mongo_bostonSchema design mongo_boston
Schema design mongo_boston
 

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 

Introduction to Graph Database

  • 1. Introduction to 
 Graph Database ! Eric C.Y. LEE
 eric@nus.edu.sg
 eric@eric.lv
 National University of Singapore February, 2014
  • 2. Outline • Relational Database v.s. Graph Database • Design the Database in Graph Architecture • Basic Usage of Neo4j • Cypher Query Language • Business application !2
  • 3. Relational Database • Based on table schema. • Field -> Record -> Table -> Database • Query by SQL syntax. • Open source and commercial products available. • MySQL, Oracle, PostgreSQL, MS-SQL Server. • LAMP: Linux+Apache+MySQL+PHP !3
  • 4. Graph Database • Schema-less, based on graph theory. • Only two types of data inside the graph database. • Node and relationship (edge) . • One of the NoSQL database management systems, query by several query languages, depend on database products. • Widely use in social network system and large scale website architecture. !4 Figure Credit: Wikipedia
  • 5. Modelling a K-pop Database All materials for database construction, 
 we can find in these wikipedia pages. !5
  • 6. The information I want to provide. • Team member profiles • • Group, Name, Birth Place,Birth Year, Birth Month Released albums • Title, Released Year, Number of Sales !6
  • 7. K-Pop Profiles in Table View Group SNSD SNSD SNSD SNSD SNSD SNSD SNSD SNSD SNSD KARA KARA KARA KARA Name Taeyeon Jessica Sunny Tiffany Hyoyeon Yuri Sooyoung Yoona Seohyun Gyuri Seungyeon Hara Jiyoung Birth Place Korea U.S.A. U.S.A. U.S.A. Korea Korea Korea Korea Korea Korea Korea Korea Korea !7 Birth Year 1989 1989 1989 1989 1989 1989 1990 1990 1991 1988 1988 1991 1994 Birth Month March April May August September December February May June May July January January Any finding?
  • 8. K-Pop Albums in Table View Group Title Released Year Number of sales SNSD Girls’ Generation 2007 284994 SNSD Oh 2010 406662 SNSD The Boys 2011 449616 SNSD I GOT A BOY 2013 293302 KARA BLOOMING 2007 50000 KARA REVOLUTION 2009 80000 KARA STEP 2011 100662 KARA FULL BLOOM 2013 46199 !8 Any finding?
  • 10. Group Title Released Year Number of sales SNSD Girls’ Generation 2007 284994 SNSD Oh 2010 406662 SNSD The Boys 2011 449616 SNSD I GOT A BOY 2013 293302 KARA BLOOMING 2007 50000 KARA REVOLUTION 2009 80000 KARA STEP 2011 100662 KARA FULL BLOOM 2013 46199 2007 2009 2010 2011 2013 SNSD KARA !10
  • 12. Neo4j 1. Download latest version 2.0.1 from www.neo4j.org 2. Cross-platform, Java 1.7 is required. 3. Extract the compressed package, execute main program. 4. Web console: http://localhost:7474 2 1 3 !12 4
  • 13. Default Web Console Query Statement Input Query Result Area
  • 14. Web Admin Interface • URL localhost:7474/webadmin/ !14
  • 15. Allow Remote Connection • Modify configuration file. 
 (/neo4j-root/conf/neo4j-server.properties) • Uncomment #org.neo4j.server.webserver.address=0.0.0.0 !15
  • 16. Cypher • Basic statement: MATCH, CREATE, WHERE, RETURN • Inspired by “ASCII Art”.
 
 MATCH (singer)-[:BIRTH_PLACE]->(country) 
 RETURN singer, country; singer BIRTH PLACE country (singer)-[:BIRTH_PLACE]->(country) !16
  • 17. Cypher of Example • Create the Nodes • Singer
 CREATE (n:Singer {name:”Taeyeon”})
 CREATE (n:Singer {name:”Jessica”})
 CREATE (n:Singer {name:”Sunny”})
 CREATE (n:Singer {name:”Tiffany”})
 CREATE (n:Singer {name:”Hyoyeon”})
 CREATE (n:Singer {name:”Yuri”})
 CREATE (n:Singer {name:”Sooyoung”})
 CREATE (n:Singer {name:”Yoona”})
 CREATE (n:Singer {name:”Seohyun”})
 CREATE (n:Singer {name:”Gyuri”})
 CREATE (n:Singer {name:”Seungyeon”})
 CREATE (n:Singer {name:”Hara”})
 CREATE (n:Singer {name:”Jiyoung”})
 !17 • Group
 CREATE (n:Group {name:”SNSD”})
 CREATE (n:Group {name:”KARA”}) • Year
 CREATE (n:Year {year:”1988”})
 CREATE (n:Year {year:”1989”})
 CREATE (n:Year {year:”1990”})
 CREATE (n:Year {year:”1991”})
 CREATE (n:Year {year:”1994”})
 CREATE (n:Year {year:”2007”})
 CREATE (n:Year {year:”2009”})
 CREATE (n:Year {year:”2010”})
 CREATE (n:Year {year:”2011”})
 CREATE (n:Year {year:”2013”})
  • 18. Cypher of Example • Create the Nodes • Album
 • CREATE (n:Album {name:”Girl’s Generation”, sales: “284994”})
 CREATE (n:Album {name:”Oh”, sales:”406662”})
 CREATE (n:Album {name:”The boys”, sales:”449616”})
 CREATE (n:Album {name:”I got a boy”, sales:”293302”})
 CREATE (n:Album {name:”Blooming”,sales:”50000”})
 CREATE (n:Album {name:”Revolution”,sales:”80000”})
 CREATE (n:Album {name:”STEP”,sales:”100662”})
 CREATE (n:Album {name:”Full Bloom”,sales:”46199”})
 
 !18 Country
 CREATE (n:Country {name:”U.S.A.”})
 CREATE (n:Country {name:”Korea”}) • Month
 CREATE (n:Month {month:”January”})
 CREATE (n:Month {month:”February”})
 CREATE (n:Month {month:”March”})
 CREATE (n:Month {month:”April”})
 CREATE (n:Month {month:”May”})
 CREATE (n:Month {month:”June”})
 CREATE (n:Month {month:”July”})
 CREATE (n:Month {month:”August”})
 CREATE (n:Month {month:”September”})
 CREATE (n:Month {month:”December”})
  • 19. Cypher of Example • Create Relationships • Group and Members [:HAS_MEMBER]
 MATCH (snsd:Group{name:”SNSD”}), (taeyeon:Singer{name:”Taeyeon”}), (jessica:Singer{name:”Jessica”}),(sunny:Singer{name:”Sunny”}), (tiffany:Singer{name:”Tiffany”}),(hyoyeon:Singer{name:”Hyoyeon”}), (yuri:Singer{name:”Yuri”}),(sooyoung:Singer{name:”Sooyoung”}), (yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”})
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(taeyeon)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(jessica)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(tiffany)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(sunny)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(hyoyeon)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(yuri)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(sooyoung)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(yoona)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(seohyun) !19
  • 20. Cypher of Example • Create Relationships • Group and Members [:HAS_MEMBER]
 MATCH (kara:Group{name:”KARA”}), (gyuri:Singer{name:”Gyuri”}), (seungyeon:Singer{name:”Seungyeon”}), (hara:Singer{name:”Hara”}), (jiyoung:Singer{name:”Jiyoung”})
 CREATE UNIQUE (kara)-[:HAS_MEMBER]->(gyuri)
 CREATE UNIQUE (kara)-[:HAS_MEMBER]->(seungyeon)
 CREATE UNIQUE (kara)-[:HAS_MEMBER]->(hara)
 CREATE UNIQUE (kara)-[:HAS_MEMBER]->(jiyoung)
 !20
  • 21. Cypher of Example • Create Relationships Albums and Released Year [:RELEASED_YEAR]
 MATCH (y2007:Year{year:”2007”}), 
 (y2009:Year{year:”2009”}),(y2010:Year{year:”2010”}),(y2011:Year{year:”2011”}), (y2012:Year{year:”2012”}),(y2013:Year{year:”2013”}),
 (album1:Album{name:”Girl’s Generation”}),
 (album2:Album{name:”Oh”}),
 (album3:Album{name:”The boys”}),
 (album4:Album{name:”I got a boy”}),
 (album5:Album{name:”Blooming”}),
 (album6:Album{name:”Revolution”}),
 (album7:Album{name:”STEP”}),
 (album8:Album{name:”Full Bloom”})
 CREATE UNIQUE (album1)-[:RELEASED_YEAR]->(y2007)
 CREATE UNIQUE (album2)-[:RELEASED_YEAR]->(y2010)
 CREATE UNIQUE (album3)-[:RELEASED_YEAR]->(y2011)
 CREATE UNIQUE (album4)-[:RELEASED_YEAR]->(y2013)
 CREATE UNIQUE (album5)-[:RELEASED_YEAR]->(y2007)
 CREATE UNIQUE (album6)-[:RELEASED_YEAR]->(y2009)
 CREATE UNIQUE (album7)-[:RELEASED_YEAR]->(y2011)
 CREATE UNIQUE (album8)-[:RELEASED_YEAR]->(y2013)
 • 
 !21
  • 22. Cypher of Example • Create Relationships • Group and Albums [:HAS_ALBUM]
 MATCH (kara:Group{name:”KARA”}), 
 (snsd:Group{name:”SNSD”}),
 (album1:Album{name:”Girl’s Generation”}),
 (album2:Album{name:”Oh”}),
 (album3:Album{name:”The boys”}),
 (album4:Album{name:”I got a boy”}),
 (album5:Album{name:”Blooming”}),
 (album6:Album{name:”Revolution”}),
 (album7:Album{name:”STEP”}),
 (album8:Album{name:”Full Bloom”})
 CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album1)
 CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album2)
 CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album3)
 CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album4)
 CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album5)
 CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album6)
 CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album7)
 CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album8)
 !22
  • 23. Cypher of Example • Create Relationships Singer and Country [:BIRTH_PLACE]
 MATCH (korea:Country{name:”Korea”}), 
 (gyuri:Singer{name:”Gyuri”}),
 (seungyeon:Singer{name:”Seungyeon”}),
 (hara:Singer{name:”Hara”}),
 (jiyoung:Singer{name:”Jiyoung”}),(taeyeon:Singer{name:”Taeyeon”}), (hyoyeon:Singer{name:”Hyoyeon”}),(yuri:Singer{name:”Yuri”}),(sooyoung:Singer{name:”Sooyoung”}), (yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”})
 • 
 CREATE UNIQUE (gyuri)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (seungyeon)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (hara)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (jiyoung)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (taeyeon)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (hyoyeon)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (yuri)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (sooyoung)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (yoona)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (seohyun)-[:BIRTH_PLACE]->(korea) !23
  • 24. Cypher of Example • Create Relationships Singer and Country [:BIRTH_PLACE]
 MATCH (usa:Country{name:”USA”}), 
 (jessica:Singer{name:”Jessica”}),
 (tiffany:Singer{name:”Tiffany”}),
 (sunny:Singer{name:”Sunny”})
 • 
 CREATE UNIQUE (jessica)-[:BIRTH_PLACE]->(usa)
 CREATE UNIQUE (tiffany)-[:BIRTH_PLACE]->(usa)
 CREATE UNIQUE (sunny)-[:BIRTH_PLACE]->(usa)
 !24
  • 25. Cypher of Example • Create Relationships Singer and Birth Year [:BIRTH_YEAR]
 MATCH (y1988:Year{Year:”1988”}),(y1989:Year{Year:”1989”}),(y1990:Year{Year:”1990”}), (y1991:Year{Year:”1991”}), (y1994:Year{Year:”1994”}),
 (gyuri:Singer{name:”Gyuri”}),(seungyeon:Singer{name:”Seungyeon”}),(taeyeon:Singer{name:”Taeyeon”}), (jessica:Singer{name:”Jessica”}),(sunny:Singer{name:”Sunny”}),(tiffany:Singer{name:”Tiffany”}), (yuri:Singer{name:”Yuri”}),(hyoyeon:Singer{name:”Hyoyeon”}),(sooyoung:Singer{name:”Sooyoung”}), (yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”}),(hara:Singer{name:”Hara”}), (jiyoung:Singer{name:”Jiyoung”})
 • 
 
 CREATE UNIQUE (gyuri)-[:BIRTH_YEAR]->(y1988)
 CREATE UNIQUE (seungyeon)-[:BIRTH_YEAR]->(y1988)
 CREATE UNIQUE (taeyeon)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (jessica)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (sunny)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (tiffany)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (hyoyeon)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (yuri)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (sooyoung)-[:BIRTH_YEAR]->(y1990)
 CREATE UNIQUE (yoona)-[:BIRTH_YEAR]->(y1990)
 CREATE UNIQUE (seohyun)-[:BIRTH_YEAR]->(y1991)
 CREATE UNIQUE (hara)-[:BIRTH_YEAR]->(y1991)
 CREATE UNIQUE (jiyoung)-[:BIRTH_YEAR]->(y1994)
 !25
  • 26. Cypher of Example • Create Relationships Singer and Birth Month [:BIRTH_MONTH]
 MATCH (jan:Month{Month:”January”}),(feb:Month{Month:”February”}),(mar:Month{Month:”March”}), (apr:Month{Month:”April”}), (may:Month{Month:”May”}),(jun:Month{Month:”June”}),(jul:Month{Month:”July”}), (aug:Month{Month:”August”}),(sep:Month{Month:”September”}),(dec:Month{Month:”December”}),
 (gyuri:Singer{name:”Gyuri”}),(seungyeon:Singer{name:”Seungyeon”}),(taeyeon:Singer{name:”Taeyeon”}), (jessica:Singer{name:”Jessica”}),(sunny:Singer{name:”Sunny”}),(tiffany:Singer{name:”Tiffany”}), (yuri:Singer{name:”Yuri”}),(hyoyeon:Singer{name:”Hyoyeon”}),(sooyoung:Singer{name:”Sooyoung”}), (yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”}),(hara:Singer{name:”Hara”}), (jiyoung:Singer{name:”Jiyoung”})
 • 
 
 CREATE UNIQUE (hara)-[:BIRTH_MONTH]->(jan)
 CREATE UNIQUE (jiyoung)-[:BIRTH_MONTH]->(jan)
 CREATE UNIQUE (sooyoung)-[:BIRTH_MONTH]->(feb)
 CREATE UNIQUE (taeyeon)-[:BIRTH_MONTH]->(mar)
 CREATE UNIQUE (jessica)-[:BIRTH_MONTH]->(apr)
 CREATE UNIQUE (sunny)-[:BIRTH_MONTH]->(may)
 CREATE UNIQUE (yoona)-[:BIRTH_MONTH]->(may)
 CREATE UNIQUE (gyuri)-[:BIRTH_MONTH]->(may)
 CREATE UNIQUE (seohyun)-[:BIRTH_MONTH]->(jun)
 CREATE UNIQUE (seungyeon)-[:BIRTH_MONTH]->(jul)
 CREATE UNIQUE (tiffany)-[:BIRTH_MONTH]->(aug)
 CREATE UNIQUE (hyoyeon)-[:BIRTH_MONTH]->(sep)
 CREATE UNIQUE (yuri)-[:BIRTH_MONTH]->(dec) !26
  • 27. Query Cases Who is the member of Girl’s Generation(SNSD)?
 • 
 MATCH (snsd{name:”SNSD”})-[:HAS_MEMBER]->(member)
 RETURN member; Who is the youngest member of KARA?
 • 
 MATCH (kara{name:”KARA”})-[:HAS_MEMBER]->(member), (member)-[:BIRTH_YEAR]->(year)
 RETURN member, ORDER BY (year.year) LIMIT 1 ; !27
  • 28. Query Cases Who is not born in Korea? Who and where.
 • 
 MATCH (singer)-[:BIRTH_PLACE]->(country) 
 WHERE NOT country.name="Korea" 
 RETURN singer, country; Which album is the top selling of SNSD? Show the album name and number.
 • 
 MATCH (Group{name:”SNSD”})-[:HAS_ALBUM]->(albums)
 WITH albums ORDER BY albums.sales DESC
 RETURN albums LIMIT 1; !28
  • 29. Business Application GENDER_IS Customer:A Male BOUGHT_ALBUM Customer:B GENDER_IS BOUGHT_ALBUM Integrate a subset graph of customer 
 purchase history to the existed K-pop database. !29
  • 30. Potential Orders? Customer:B bought SNSD and KARA’s album, we can promote albums of T-ARA to him?
 • 
 Both SNSD and KARA are female K-pop groups, T-ARA is female K-pop group too. Give Customer:A price discount, push him buy the album “I GOT A BOY”.
 • 
 SNSD has 4 albums. According to the graph, Customer:A bought the 3 albums from us. He didn’t buy “I GOT A BOY”. Ask male customer buy female K-pop groups’ album is much easier.
 • 
 The database shows most of female K-pop group album buyers are male. !30
  • 31. [:HAS_STUDENT] Person
 Name:”TAN TIN WEE”
 Occupation: “Professor” [:HAS_MODULE] Person
 Name:”Eric Lee”
 Occupation: “Student” [:HAS_TA] [:HAS_TA] [:SAY] Person
 Name:”Christine Eng”
 Occupation: “Student” [:HAS_STUDENT] Module
 ID:”LSM3241”
 Name:”Bioinformatics and Biocomputing” [:HAS_TA] Person
 Name:”Hu Yongli”
 Occupation: “Student” Sentence
 Sentence:”Thank you!” !31