SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph DatabasesMax De Marzi
 
Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use CasesMax De Marzi
 
Neo4j GraphDay Seattle- Sept19- neo4j basic training
Neo4j GraphDay Seattle- Sept19- neo4j basic trainingNeo4j GraphDay Seattle- Sept19- neo4j basic training
Neo4j GraphDay Seattle- Sept19- neo4j basic trainingNeo4j
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4jjexp
 
Workshop - Neo4j Graph Data Science
Workshop - Neo4j Graph Data ScienceWorkshop - Neo4j Graph Data Science
Workshop - Neo4j Graph Data ScienceNeo4j
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph DatabasesDataStax
 
The Graph Database Universe: Neo4j Overview
The Graph Database Universe: Neo4j OverviewThe Graph Database Universe: Neo4j Overview
The Graph Database Universe: Neo4j OverviewNeo4j
 
Neo4J : Introduction to Graph Database
Neo4J : Introduction to Graph DatabaseNeo4J : Introduction to Graph Database
Neo4J : Introduction to Graph DatabaseMindfire Solutions
 
NoSQL Graph Databases - Why, When and Where
NoSQL Graph Databases - Why, When and WhereNoSQL Graph Databases - Why, When and Where
NoSQL Graph Databases - Why, When and WhereEugene Hanikblum
 
Optimizing Your Supply Chain with the Neo4j Graph
Optimizing Your Supply Chain with the Neo4j GraphOptimizing Your Supply Chain with the Neo4j Graph
Optimizing Your Supply Chain with the Neo4j GraphNeo4j
 
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4jAdobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4jNeo4j
 
The Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfNeo4j
 
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data ScienceScaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data ScienceNeo4j
 
Knowledge Graphs - The Power of Graph-Based Search
Knowledge Graphs - The Power of Graph-Based SearchKnowledge Graphs - The Power of Graph-Based Search
Knowledge Graphs - The Power of Graph-Based SearchNeo4j
 
Network and IT Operations
Network and IT OperationsNetwork and IT Operations
Network and IT OperationsNeo4j
 
Neo4j Graph Use Cases, Bruno Ungermann, Neo4j
Neo4j Graph Use Cases, Bruno Ungermann, Neo4jNeo4j Graph Use Cases, Bruno Ungermann, Neo4j
Neo4j Graph Use Cases, Bruno Ungermann, Neo4jNeo4j
 

Was ist angesagt? (20)

Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
 
Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
 
Neo4j GraphDay Seattle- Sept19- neo4j basic training
Neo4j GraphDay Seattle- Sept19- neo4j basic trainingNeo4j GraphDay Seattle- Sept19- neo4j basic training
Neo4j GraphDay Seattle- Sept19- neo4j basic training
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
 
Workshop - Neo4j Graph Data Science
Workshop - Neo4j Graph Data ScienceWorkshop - Neo4j Graph Data Science
Workshop - Neo4j Graph Data Science
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
 
Graph database
Graph database Graph database
Graph database
 
Graph based data models
Graph based data modelsGraph based data models
Graph based data models
 
Graphdatabases
GraphdatabasesGraphdatabases
Graphdatabases
 
The Graph Database Universe: Neo4j Overview
The Graph Database Universe: Neo4j OverviewThe Graph Database Universe: Neo4j Overview
The Graph Database Universe: Neo4j Overview
 
Neo4J : Introduction to Graph Database
Neo4J : Introduction to Graph DatabaseNeo4J : Introduction to Graph Database
Neo4J : Introduction to Graph Database
 
NoSQL Graph Databases - Why, When and Where
NoSQL Graph Databases - Why, When and WhereNoSQL Graph Databases - Why, When and Where
NoSQL Graph Databases - Why, When and Where
 
Optimizing Your Supply Chain with the Neo4j Graph
Optimizing Your Supply Chain with the Neo4j GraphOptimizing Your Supply Chain with the Neo4j Graph
Optimizing Your Supply Chain with the Neo4j Graph
 
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4jAdobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4j
 
Graph databases
Graph databasesGraph databases
Graph databases
 
The Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdf
 
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data ScienceScaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
 
Knowledge Graphs - The Power of Graph-Based Search
Knowledge Graphs - The Power of Graph-Based SearchKnowledge Graphs - The Power of Graph-Based Search
Knowledge Graphs - The Power of Graph-Based Search
 
Network and IT Operations
Network and IT OperationsNetwork and IT Operations
Network and IT Operations
 
Neo4j Graph Use Cases, Bruno Ungermann, Neo4j
Neo4j Graph Use Cases, Bruno Ungermann, Neo4jNeo4j Graph Use Cases, Bruno Ungermann, Neo4j
Neo4j Graph Use Cases, Bruno Ungermann, Neo4j
 

Andere mochten auch

COSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4jCOSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4jEric 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 Neo4jEric Lee
 
Neo4j: JDBC Connection Case Using LibreOffice
Neo4j: JDBC Connection Case Using LibreOfficeNeo4j: JDBC Connection Case Using LibreOffice
Neo4j: JDBC Connection Case Using LibreOfficeEric Lee
 
R3 Corda Simple Tutorial
R3 Corda Simple TutorialR3 Corda Simple Tutorial
R3 Corda Simple TutorialEric Lee
 
Google MAP API
Google MAP APIGoogle MAP API
Google MAP APIEric Lee
 

Andere mochten auch (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
 

Ähnlich wie Introduction to Graph Database

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 PHPJeremy 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 LanguageNeo4j
 
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 quicklNeo4j
 
Playlist Recommendations @ Spotify
Playlist Recommendations @ SpotifyPlaylist Recommendations @ Spotify
Playlist Recommendations @ SpotifyNikhil 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 Neo4jNeo4j
 
seevl: Data-driven music discovery
seevl: Data-driven music discoveryseevl: Data-driven music discovery
seevl: Data-driven music discoveryAlexandre 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
 
Drupal case study: ABC Dig Music
Drupal case study: ABC Dig MusicDrupal case study: ABC Dig Music
Drupal case study: ABC Dig MusicDavid Peterson
 
Schema Design
Schema DesignSchema Design
Schema DesignMongoDB
 
Elasticsearch at EyeEm
Elasticsearch at EyeEmElasticsearch at EyeEm
Elasticsearch at EyeEmLars 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 2012Amazon Web Services
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large GraphsNishant Gandhi
 
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
 
Who's afraid of graphs
Who's afraid of graphsWho's afraid of graphs
Who's afraid of graphsSirKetchup
 
Schema design mongo_boston
Schema design mongo_bostonSchema design mongo_boston
Schema design mongo_bostonMongoDB
 

Ähnlich wie 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
 
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?
 
Who's afraid of graphs
Who's afraid of graphsWho's afraid of graphs
Who's 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
 

Kürzlich hochgeladen

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Kürzlich hochgeladen (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.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