7. Make two nodes
CREATE (:person {id: 1, name: “Kisung Kim”, birthday: 1980-01-05});
CREATE (:company {id: 1, name: “Bitnine Global”});
Make a relationship between the two nodes
MATCH (p:person {id: 1}), (c:company {id:1})
CREATE (p)-[:workFor {title: “CTO”, since: 2014}]->(c);
Kisung Kim Bitnine Global
workFor
8. Querying
MATCH (p:person {name: “Kisung Kim”})-[:workFor]->(c:company)
RETURN (p), (c)
No Table Definitions and No Joins
Query with variable length relationships
MATCH (p:person {name: “Kisung Kim”})-[:knows*..3]->(f:person)
RETURN (f)
Kisung Kim ?
workFor
Kisung Kim ?
knows
?
knows
?
knows
15. Solution Company Latest Version Features
Neo Technology 3.1
Most famous graph database, Cypher
O(1) access using fixed-size array
Datastax -
Distributed graph system based on
Cassandra
Titan
18. •
–
•
•
Graph
Vertex Edge
Vertex ID Properties Edge ID PropertiesStart Vertex ID End Vertex ID
B-tree
Vertex ID
B-tree
(Start, End)
B-tree
(End, Start)
20. •
Edge
Edge ID PropertiesStart Vertex ID End Vertex ID
B-tree
(Start, End)
B-tree
(End, Start)
Edge ID Properties
B-tree or
Hash index
(Vertex ID)
(Adjacent Vertex ID, Edge ID)
B-tree (Edge ID)
22. • AgensGraph v0.9
(https://github.com/bitnine-oss/agens-graph or http://bitnine.net/downloads/)
– Graph data model and DDL on PostgreSQL 9.6
– Cypher query processing (70% of OpenCypher spec.)
– Integrated query processing (Cypher + SQL)
– Client library (JDBC, ODBC, Python)
– Monitoring and development using Tadpole DB-hub
29. Person
Country:X
Person
:knows*1..2
Message
Given a start Person, find Persons that are their friends and friends of friends that have made
Messages in both of the given Countries, X and Y, within a given period. Only Persons that are
foreign to Countries X and Y are considered, that is Persons whose Location is not Country X or
Country Y.