SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
Costruiamo un motore di raccomandazione con Neo4J
Workshop 25/01/2018
Marco Liberati
@dej611
Piero Savastano
@_pieroit_
#Aperitech graph
-[:LOAD]->
● Graph database (written in Java)
● Schema-less
● Cypher query language
○ ASCII art as query
○ Pattern matching
(user :USER { name: “Marco” })
Cypher Node
Variabile
Label
Property
Value
-[action:TAGGED {when: 130… }] ->
Cypher Link/Relationship
Variabile
Label
Property
Value
MATCH (u:User)-[r:JOINED]->(m:Meetup)
Cypher Query
PATTERN MATCHING:
Descrivi uno o piu percorsi del grafo
in ASCII art.
Tutti i percorsi che rispettano il
criterio di forma (e non solo…)
verranno presi da Neo4J a questo
punto
MATCH (u:User)-[r:JOINED]->(m:Meetup)
WHERE u.name = “Marco”
Cypher Query
Applica delle
condizioni alle
variabili
dichiarate sopra
PATTERN MATCHING:
Descrivi uno o piu percorsi del grafo
in ASCII art.
Tutti i percorsi che rispettano il
criterio di forma (e non solo…)
verranno presi da Neo4J a questo
punto
MATCH (u:User)-[r:JOINED]->(m:Meetup)
WHERE u.name = “Marco”
RETURN u, r, m;
Cypher Query
Applica delle
condizioni alle
variabili
dichiarate sopra
Con return si
descrive cosa
mettere su
ogni riga dei
risultati
PATTERN MATCHING:
Descrivi uno o piu percorsi del grafo
in ASCII art.
Tutti i percorsi che rispettano il
criterio di forma (e non solo…)
verranno presi da Neo4J a questo
punto
Cypher cheatsheet
https://neo4j.com/docs/cypher-refcard/current/
#Aperitech graph
Data Model:
Graph traversal
(u:User)-[r:JOINED]->(m:Meetup)
Get all users Get all meetups
Get all users Get all meetups
Get all meetups and their tags
Get all meetups and their tags
Get relations for a specific user
Get relations for a specific user
Get users joining a meetup
after 1 November 2017
Get users joining a meetup
after 1 November 2017
CALL db.[procedura]
CALL apoc.json.load ….
Per vedere tutte quelle disponibili:
CALL dbms.procedures();
User functions / Procedures
MATCH (u:User)-[r:JOINED]->(m:Meetup)
WITH u, collect( m ) as meetups
Cypher Query 2
WITH permette di fermarsi e
calcolare valori aggregati.
Oppure coniugare più query
MATCH (u:User)-[r:JOINED]->(m:Meetup)
WITH u, collect( m ) as meetups
RETURN u, meetups
Cypher Query 2
WITH permette di fermarsi e
calcolare valori aggregati.
Oppure coniugare più query
RETURN può accedere
alla nuova variabile
meetups. Non può però
accedere sopra il WITH
(i.e. “r”)
Get graph schema
Get the shortest path between two nodes
Get the shortest path between two nodes
Show top 5 Meetups by popularity
Show top 5 Meetups by popularity
Show top 10 users by partecipation
Show top 10 users by partecipation
Show top 10 users by interests
Show top 10 users by interests
What meetup should we suggest to Eros?
What meetup should we suggest to Eros?
Eros
What meetup should we suggest to Eros based on
topics he likes?
What meetup should we suggest to Eros based on
topics he likes?
Grazie :)

Más contenido relacionado

Similar a Marco Liberati - Graph Analytics in the AperiTech Community

Py a6 python-database
Py a6 python-databasePy a6 python-database
Py a6 python-database
Majong DevJfu
 
Php mysql e cms
Php mysql e cmsPhp mysql e cms
Php mysql e cms
orestJump
 
Studio e realizzazione di Web Services in Ambienti di Sviluppo Integrati
Studio e realizzazione di Web Services in Ambienti di Sviluppo IntegratiStudio e realizzazione di Web Services in Ambienti di Sviluppo Integrati
Studio e realizzazione di Web Services in Ambienti di Sviluppo Integrati
Giusy E Marco Tutone-Calandra
 

Similar a Marco Liberati - Graph Analytics in the AperiTech Community (20)

Database NO-SQL: Anything else ?
Database NO-SQL: Anything else ?Database NO-SQL: Anything else ?
Database NO-SQL: Anything else ?
 
GWT vs CSS3
GWT vs CSS3GWT vs CSS3
GWT vs CSS3
 
Introduzione a Ember.js
Introduzione a Ember.jsIntroduzione a Ember.js
Introduzione a Ember.js
 
Reactive programming con RxJS
Reactive programming con RxJSReactive programming con RxJS
Reactive programming con RxJS
 
Py a6 python-database
Py a6 python-databasePy a6 python-database
Py a6 python-database
 
Introduzione a node.js
Introduzione a node.jsIntroduzione a node.js
Introduzione a node.js
 
Introduzione a Node.js
Introduzione a Node.jsIntroduzione a Node.js
Introduzione a Node.js
 
HTML5 Italy: Mai più CSS, fogli di stile moderni con LESS - Salvatore Romeo
HTML5 Italy: Mai più CSS, fogli di stile moderni con LESS - Salvatore RomeoHTML5 Italy: Mai più CSS, fogli di stile moderni con LESS - Salvatore Romeo
HTML5 Italy: Mai più CSS, fogli di stile moderni con LESS - Salvatore Romeo
 
Sviluppo web con Ruby on Rails
Sviluppo web con Ruby on RailsSviluppo web con Ruby on Rails
Sviluppo web con Ruby on Rails
 
Php mysql e cms
Php mysql e cmsPhp mysql e cms
Php mysql e cms
 
Office & VBA - Giorni 4 e 5
Office & VBA - Giorni 4 e 5Office & VBA - Giorni 4 e 5
Office & VBA - Giorni 4 e 5
 
Machine Yelping
Machine YelpingMachine Yelping
Machine Yelping
 
MongoDB User Group Padova - Overviews iniziale su MongoDB
MongoDB User Group Padova - Overviews iniziale su MongoDBMongoDB User Group Padova - Overviews iniziale su MongoDB
MongoDB User Group Padova - Overviews iniziale su MongoDB
 
Telegraph Cq Italian
Telegraph Cq ItalianTelegraph Cq Italian
Telegraph Cq Italian
 
Lezione Guidata Ruby On Rails Show
Lezione Guidata Ruby On Rails ShowLezione Guidata Ruby On Rails Show
Lezione Guidata Ruby On Rails Show
 
I Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utentiI Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utenti
 
Drupal dashboard for dummies with d3
Drupal dashboard for dummies with d3Drupal dashboard for dummies with d3
Drupal dashboard for dummies with d3
 
Studio e realizzazione di Web Services in Ambienti di Sviluppo Integrati
Studio e realizzazione di Web Services in Ambienti di Sviluppo IntegratiStudio e realizzazione di Web Services in Ambienti di Sviluppo Integrati
Studio e realizzazione di Web Services in Ambienti di Sviluppo Integrati
 
Entity Framework 4 vs NHibernate 3
Entity Framework 4 vs NHibernate 3Entity Framework 4 vs NHibernate 3
Entity Framework 4 vs NHibernate 3
 
Office & VBA - Giorno 6
Office & VBA - Giorno 6Office & VBA - Giorno 6
Office & VBA - Giorno 6
 

Más de Codemotion

Más de Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Marco Liberati - Graph Analytics in the AperiTech Community