Ronie Uliana
Software Architect and journeyman Data Scientist
Fácil e Rápido
NoSQL
Um banco de grafos (redes)
Ótimo para pontual
Ex: "Esse nó está conectado com algo?"
Péssimo para batch
Ex: "Essa rede está toda conectada?"
docker run --publish=7474:7474 --publish=7687:7687 --volume=$PWD/neo4j/data:/data neo4j
http://optimalbi.com/blog/2016/03/15/how-to-install-neo4j-on-aws-linux/
Nota: por padrão, a porta é 7474 e só possui acesso local.
Acerte o arquivo /etc/neo4j/neo4j.config
https://neo4j.com/developer/example-data/
http://ec2-54-242-58-60.compute-1.amazonaws.com:7474
"Movie Database"
user: neo4j
pass:123
(access will be removed after this session)
match (x:Actor) return x limit 10
match (a:Actor)-[:ACTS_IN]->(m:Movie) return a, m limit 30
match (a1:Actor)-[:ACTS_IN]->(m:Movie), (m)<-[:ACTS_IN]-(a2:Actor) where a1.name = 'Buster Keaton' return a1, m, a2 limit 30
match (a1:Actor), (a2:Actor), p = shortestPath((a1)-[*..7]-(a2)) where a1.name = 'Buster Keaton' and a2.name = 'Kevin Bacon' return p limit 30
docker run --publish=7474:7474 --publish=7687:7687 --volume=neo4j/data:/data ruliana/neo4j-spatial
load csv with headers from "https://goo.gl/3mZaGW" as line
return line
limit 10
call spatial.addPointLayerXY("crime-spot", "latitude", "longitude")
load csv with headers from "https://goo.gl/3mZaGW" as line
create (c:Crime {ncic: toInteger(line.ucr_ncic_code),
latitude: toFloat(line.latitude),
longitude: toFloat(line.longitude),
description: line.crimedescr})
with c
call spatial.addNode("crime-spot", c) yield node
return node
By Ronie Uliana