graph of thrones - neo4j + game of thrones

26
Graph of Thrones (GRAPHS)[:ARE]›(EVERYWHERE)

Upload: jhonathan-de-souza-soares

Post on 21-Jan-2018

315 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Graph of Thrones - Neo4j + Game of Thrones

Graph of Thrones

(GRAPHS)[:ARE]›(EVERYWHERE)

Page 2: Graph of Thrones - Neo4j + Game of Thrones

Jhonathan S. Soares

• MVP Microsoft – Visual Studio

• Neo4j Top 50 Certified Developer

• MongoDB Evangelist

• Criador do blog CodigoSimples.net

Page 3: Graph of Thrones - Neo4j + Game of Thrones

DISCLAIMER

• SE VOCÊ JÁ VIU TUDO SOBRE GAME OF THRONES, OK

• SE VOCÊ NÃO VIU TUDO, MAS NÃO SE IMPORTA DE RECEBER ALGUNS SPOILERS, OK

• SE VOCÊ NUNCA VIU, PREPARE-SE PARA SPOLERS

• SE VOCÊ NUNCA VIU E QUER VER E NÃO QUER SPOILERS, VOCÊ

ESTÁ EM PÉSSIMO LUGAR AGORA!

Page 4: Graph of Thrones - Neo4j + Game of Thrones
Page 5: Graph of Thrones - Neo4j + Game of Thrones

Introdução ao Neo4j

• Tipos de NOSQL

• Já somos 255 e crescendo \o/

• Colunar | Wide Column | Column Families

• Hadoop – Hbase – Cassandra – BigTable

• Orientado à Documentos| Document Store

• ElasticSearch – OrientDB – MongoDB - DocumentDB

• Chave Valor | Tuple Store | Key Value

• DynamoDB – Azure Table – Redis - MemcacheDB

• Orientado à Grafos | Graph Databases

• Neo4j – ArangoDB – OrientDB - Titan

Page 6: Graph of Thrones - Neo4j + Game of Thrones

Introdução ao Neo4j

• Dijkstra

• Lei do menor caminho ou caminho com menor peso.

Page 7: Graph of Thrones - Neo4j + Game of Thrones

Introdução ao Neo4j

• Neo4j é feito do que?

• Nós, Labels, Relacionamentos e Propriedades

• Nós são os registros

• Labels são conjunto agrupado de nós

• Relacionamentos são as conexões entre os nós

• Propriedades são definições de um nós ( Direção, Agrupamento etc)

Page 8: Graph of Thrones - Neo4j + Game of Thrones

Instalação e Configuração

• Plataformas suportadas

• Windows

• Linux/Unix

• Mac OSX

• Versões

• Community Edition

• Enterprise Edition

Page 9: Graph of Thrones - Neo4j + Game of Thrones

Introdução à Cypher Query

• Conceitos

• Cypher é uma linguagem declarativa, de inspiração SQL para descrever padrões em gráficos utilizando uma sintaxe ascii-art.

• Ela nos permite selecionar, inserir, atualizar ou excluir dados do gráfico sem a necessidade de descrever exatamente como fazê-lo.

Page 10: Graph of Thrones - Neo4j + Game of Thrones

Introdução à Cypher Query

• Conceitos

• MATCH (p:pessoa{idade: 25}) RETURN p

• MATCH é o nosso comando de seleção

• p:pessoa é o nosso conjunto de dados

• {idade:25} é o nosso where

• return p é quais registros eu quero que retorne

Page 11: Graph of Thrones - Neo4j + Game of Thrones

Introdução à Cypher Query

• Conceitos

• MATCH (p:pessoa{idade: 25}) RETURN p

• SELECT * FROM Pessoa WHERE idade = 25

Page 12: Graph of Thrones - Neo4j + Game of Thrones

Linguagens de programação

• Neo4j se integra nativamente com:

• Java

• C#

• Python

• Ruby

• Javascript

• PHP

• Exemplo com c# : github.com/Readify/Neo4jClient/wiki/cypher-examples

Page 13: Graph of Thrones - Neo4j + Game of Thrones

Aplicações e Usos

• Fraud Detection

• Real-time recommendations

• Social network

• Identity and access management

• Network ant IT operations

• Game of Thrones

• http://gameofthrones.wikia.com/wiki/Game_of_Thrones_Wiki

Page 14: Graph of Thrones - Neo4j + Game of Thrones

Hora do Demo

Page 15: Graph of Thrones - Neo4j + Game of Thrones
Page 16: Graph of Thrones - Neo4j + Game of Thrones
Page 17: Graph of Thrones - Neo4j + Game of Thrones
Page 18: Graph of Thrones - Neo4j + Game of Thrones

Questões pertinentes para o Neo4j

• Quem é o personagem mais prominente?

• Quem é a casa mais populosa?

• Como os starks e os tararyans estão relacionados?

Page 19: Graph of Thrones - Neo4j + Game of Thrones

Um pouco sobre modelagem ...

Page 20: Graph of Thrones - Neo4j + Game of Thrones

Nodes

Page 21: Graph of Thrones - Neo4j + Game of Thrones

Labels

Page 22: Graph of Thrones - Neo4j + Game of Thrones

Properties

Page 23: Graph of Thrones - Neo4j + Game of Thrones

Relationships

Page 24: Graph of Thrones - Neo4j + Game of Thrones

Demo time

• 1º Dataset

• :play https://guides.neo4j.com/got_wwc

• 2º Dataset

• :play http://guides.neo4j.com/got

Page 25: Graph of Thrones - Neo4j + Game of Thrones

Dúvidas?

(graphs)[:ARE]›(everywhere)

Page 26: Graph of Thrones - Neo4j + Game of Thrones

FIM!

http://codigosimples.net