Sie sind auf Seite 1von 19

What is a Graph?

TRAFFIC

LIGHTS

Graph is Connected ROAD


What is a Neo4j?
Most Popular Graph Database *
Developed by Neo Technologies
Implemented in Java
Open Source
Neo4j is the heart of Cisco HMP: used for governance
and single source of truth and a one-stop shop for all of
Ciscos hierarchies.

Uses Neo4j for network topology analysis for big telco


service providers

Uses Neo4j to manage the digital assets inside of its


next generation in-flight entertainment system.
Property Graph Data Model
Ann Loves Dan

Ann Loves Dan


Ann Loves Dan

LOVES

RELATIONSHIP
NODE NODE
Relationships are
directional
Ann Loves Dan

LOVES

LOVES
RELATIONSHIPS
NODE NODE
Detailed Property Graph
name: Ann LOVES
name: Dan
born: May 29, 1970
twitter: @ann LOVES born: Dec
5, 1975
LIVES WITH

since: DRIVES
since: Jan 10, 2011
Jan 10, 2011

brand: Volvo
model: V70
Labelled Property Graph
:Person :Person

:Vehicle
How to write queries?

CYPHER
A Query Language designed for
connectedness
Creating a Node
CREATE (n:Person { name:Ann} ) RETURN n

LABEL PROPERTY

NODE
Creating a Node
CREATE (n:Person { name:Dan} ) RETURN n

LABEL PROPERTY

NODE
Finding a node
MATCH (n:Person { name:Dan} ) RETURN n

LABEL PROPERTY

NODE
Creating a Relationship

LOVES

RELATIONSHI
NODE NODE
P

MATCH (a:Person { name:Ann} ), (b:Person { name:Dan} )


CREATE (a) - [r:LOVES] -> (b) RETURN
r,a,b
Steps
Open the terminal and start neo4j
sudo service neo4j start
Open the browser and enter the following URL
http://localhost:7474
Click on the icon on the left hand side.
Click on Basic Queries -> Query Template and execute them.
Also play around with the Movie Graph in Example Graphs
Thank You

Das könnte Ihnen auch gefallen