RedisConf18 - Lower Latency Graph Queries in Cypher with Redis Graph
A walk in graph databases v1.0
1. A Walk in Graph Databases
Pierre De Wilde
4 May 2012
Global Brain Institute
VUB - ECCO Group
2. The Law of the Hammer
If the only tool you have is a hammer,
everything looks like a nail.
Abraham Maslow - The Psychology of Science - 1966
3. The Law of the Relational Database
If the only tool you have is a relational database,
everything looks like a table.
A Walk in Graph Databases - 2012
4. doesn't
One size fits all
Scalability issue
Scale up
Scale out
Index-intensive issue
Find data
Join data
5. NoSQL ?! No SQL ? Not only SQL !
Scalability solutions
Key-value stores
Column databases
Document databases
Index-intensive solution
Graph databases
11. One graph doesn't fit all
Marko A. Rodriguez and Peter Neubauer - Constructions from Dots and Lines - 2010
12. Property graph
A property graph is a directed, labeled, attributed, multi graph.
13. Anatomy of a vertex
A vertex is composed of
- an unique identifier (id)
- a collection of properties
- a set of incoming edges (inE)
- a set of outgoing edges (outE)
14. Anatomy of an edge
An edge is composed of
- an unique identifier (id)
- an outgoing vertex (outV)
- a label
- an incoming vertex (inV)
- a collection of properties
15. Map of walk
Warm up
Property Graph
Graph Database
Walk with Gremlin
Graph Manipulation
Graph Traversal
Stretching
Linked Data
Global Graph
18. Some graph database vendors
Neo4j from Neo Technology
http://neo4j.org/
OrientDB from Orient Technologies
http://www.orientdb.org/
Dex from Sparsity-Technologies
http://www.sparsity-technologies.com/dex
InfiniteGraph from Objectivity, Inc.
http://www.infinitegraph.com/
19. Map of walk
Warm up
Property Graph
Graph Database
Walk with Gremlin
Graph Manipulation
Graph Traversal
Stretching
Linked Data
Global Graph
20. TinkerPop
Open source project in the graph space
22. Gremlin
$ gremlin.sh
,,,/
(o o)
-----oOOo-(_)-oOOo-----
gremlin>
Gremlin is a graph traversal language
23. Map of walk
Warm up
Property Graph
Graph Database
Walk with Gremlin
Graph Manipulation
Graph Traversal
Stretching
Linked Data
Global Graph
24. Connect to a graph database
gremlin> g = new TinkerGraph(name)
gremlin> g = new Neo4jGraph(name)
gremlin> g = new OrientGraph(name)
gremlin> g = new DexGraph(name)
gremlin> g = new IGGraph(name)
60. Linked Data and Gremlin
+ +
gremlin> g = new SparqlRepositorySailGraph("http://dbpedia.org/sparql")
gremlin> v = g.v(' http://dbpedia.org/resource/Global_brain')
==>v[http://dbpedia.org/resource/Global_brain]
gremlin> v.out('http://www.w3.org/2000/01/rdf-schema#comment').has('lang',
'en').value
==>The Global Brain is a metaphor for the worldwide intelligent network...
gremlin> v.inE('http://dbpedia.org/ontology/knownFor').outV
==>v[http://dbpedia.org/resource/Francis_Heylighen]
gremlin> v.inE('http://dbpedia.org/ontology/knownFor').outV.outE('http://
dbpedia.org/ontology/knownFor').inV
==>v[http://dbpedia.org/resource/Self-organization]
==>v[http://dbpedia.org/resource/Memetics]
==>v[http://dbpedia.org/resource/Global_brain]
61. Map of walk
Warm up
Property Graph
Graph Database
Walk with Gremlin
Graph Manipulation
Graph Traversal
Stretching
Linked Data
Global Graph
63. Global Graph
Internet => net of computers
Word Wide Web => web of documents
Giant Global Graph => graph of metadata
I called this graph the Semantic Web, but maybe it should have been Giant Global Graph.
Tim Berners-Lee - timbl's blog - 2007
65. http://tinkerpop.com
Logos created by Ketrina Yim for TinkerPop geeks
Images created by Flickr Creative Commons Artists
Graphs created by Memotive Concept Mapping tool