-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
86 lines (84 loc) · 6.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html><html lang="en"><head><title>Neo4j</title><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="src/shower/themes/ribbon/styles/screen-16x10.css"><link rel="stylesheet" href="bower_components/highlightjs/styles/default.css"><link rel="stylesheet" href="bower_components/highlightjs-cypher/css/cypher-highlighting.css"><style>.centered {
padding-top: 20%;
text-align: center;
}
#cover h2 {
margin:30px 0 0;
color:#FFF;
text-align:center;
font-size:70px;
}
#cover p {
margin:10px 0 0;
text-align:center;
color:#FFF;
font-style:italic;
font-size:20px;
}
#cover:before {
content: "";
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
display: block;
background-image: url("src/images/screen0.png");
background-size: cover;
-webkit-filter: brightness(35%) hue-rotate(6deg) grayscale(50%);
}</style></head><body class="shower list"><header class="caption"><h1>Neo4j</h1><p>The World's Leading Graph Database</p></header><section id="cover" class="slide"><h2>Neo4j Introduction</h2><p>by Mateusz Jaworski<br>February 2016</p></section><section class="slide"><h2>Why graph database?</h2><ul><li>nodes and relations are first class citizens</li><li>constant time for neighbour lookups</li></ul></section><section class="slide"><h2>Why graph database?</h2><ul><li>give me all neighbours of A in N hops</li><li>give me all paths from A to B</li><li>give me the shortest path from A to B</li><li>is there a node D on path between A and B</li></ul></section><section class="slide"><h2>Neo4j features</h2><ol><li>1.0 released in February 2010</li><li>licensing<ul><li>community (GPLv3, 1 node)</li><li>enterprise (clustering, backup, monitoring, free for open source projects)</li><li>government</li></ul></li><li>cypher query language (via HTTP)</li></ol></section><section id="ranking" class="slide"><img src="src/images/ranking.png"><p class="note">source: <a href="http://db-engines.com/en/ranking">http://db-engines.com/en/ranking</a></p><style>#ranking .note {
margin-right: 9em;
font-size: 0.5em;
float: right;
}
#ranking .note a {
text-decoration: none;
color: inherit;
}
#ranking img{
height: 500px;
display: block;
margin-top: -40px;
margin-left: auto;
margin-right: auto;
}
</style></section><section class="slide"><h2>Neo4j features</h2><ol><li>properties - on nodes and edges (primitives or array of primitives)</li><li>labels - on nodes and edges</li><li>indexes - on node properties</li><li>constraints - on nodes or relations</li><li>ACID transactions</li></ol></section><section class="slide"><h2>ACID</h2><ol><li>Neo4j claims to be ACID compliant</li><li>but... ACID in distributed database?</li><li>but... CAP theorem? (consistency, availability, partition tolerance)</li><li>ACID transactions (READ_COMMITTED by default)</li></ol><p class="note"><a href="http://neo4j.com/docs/stable/transactions.html">more: transaction management</a></p></section><section class="slide"><h2>Built-in algorithms</h2><ol><li>shortest paths</li><li>all paths</li><li>all simple paths (no repeated nodes)</li><li>Dijkstra (shortest path with weights)</li><li>A* (shortest path with heuristic)</li></ol></section><section class="slide"><h2>Cypher</h2><pre><code class="cypher">MATCH (user)-[:friend]->(follower)
WHERE user.name IN ['Joe', 'John']
AND follower.name =~ 'S.*'
RETURN user.name, follower.name
</code></pre></section><section class="slide"><h2>Cypher</h2><pre><code class="cypher">MATCH (a)--(b)
MATCH (a)-[:friend]->(b)-->(c)
MATCH (a:A { name:'alice' })-[:friend {x:y}]-(b:B)
MATCH (a)-[:friend*1..3]->(b)
</code></pre></section><section class="slide"><h2>Cypher</h2><pre><code class="cypher">MATCH (alice { name: 'Alice' }), (others)
WHERE others.name IN ['A', 'B'] AND (alice)<--(others)
RETURN others
MATCH (bob { name: 'Bob' })-->(others)
RETURN bob, count(*) as count, avg(others.value)
ORDER BY count ASC LIMIT 10
</code></pre></section><section class="slide"><h2 class="centered">Live demo</h2></section><section class="slide"><h2>Shell commands</h2><ol><li>:play start</li><li>:server connect</li><li>:clear</li><li>:history</li><li>:style [reset]</li><li>:config maxRows:100</li></ol></section><section class="slide"><h2>Graph zooming tweak</h2><pre id="tweak"><code class="javascript">(function ($) {
var isAlt = false;
function altCheck(e) {
if (e.which === 18) {
isAlt = (e.type === 'keydown');
}
}
function wheelCheck(e) {
if (!isAlt) return;
e.preventDefault();
var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
var el = $('svg > g');
var transform = el.attr('transform');
transform = (transform.indexOf('translate') > -1) ? 'scale(1.0)' : transform;
var scale = new Number(transform.slice(6, transform.length - 1)) + 0.1 * delta;
el.attr('transform', `scale(${scale})`);
return false;
}
document.addEventListener("mousewheel", wheelCheck, false);
$(document).keydown(altCheck).keyup(altCheck);
}(jQuery));</code></pre><style>#tweak {
font-size: 9px;
}
</style></section><section class="slide"><h2>Alternatives</h2><ol><li>OrientDB <a href="http://orientdb.com/">http://orientdb.com/</a></li><li>ArangoDB <a href="https://www.arangodb.com/">https://www.arangodb.com/</a></li><li>Titan <a href="http://thinkaurelius.github.io/titan/">http://thinkaurelius.github.io/titan/</a></li><li>Virtuoso <a href="http://virtuoso.openlinksw.com/">http://virtuoso.openlinksw.com/</a></li></ol></section><section class="slide"><h2 class="centered">Questions?</h2></section><section class="slide"><h2 class="centered">Thanks!</h2></section><p class="badge"><a href="https://github.com/purplecode/lightning-talk-neo4j">Fork me on GitHub</a></p><div class="progress"></div><script src="src/shower/shower.min.js"></script><script src="bower_components/highlightjs/highlight.pack.min.js"></script><script src="bower_components/highlightjs-cypher/javascripts/cypher.js"></script><script>hljs.registerLanguage('cypher', cypher)
hljs.initHighlightingOnLoad();</script></body></html>