let me graph that for you
play

Let Me Graph That For You @ian S robinson - PowerPoint PPT Presentation

Let Me Graph That For You @ian S robinson ian@neotechnology.com @neo4j complexity = f(size, variable structure, connectedness) @neo4j Graphs Are Everywhere @neo4j Graph


  1. Let ¡Me ¡Graph ¡That ¡For ¡You ¡ @ian S robinson ¡ ian@neotechnology.com ¡ ¡ @neo4j ¡

  2. complexity = f(size, variable structure, connectedness) ¡ @neo4j ¡

  3. Graphs ¡Are ¡Everywhere ¡ @neo4j ¡

  4. Graph ¡Databases ¡ • Store ¡ data ¡ • Manage ¡ • Query ¡ @neo4j ¡

  5. Neo4j ¡is ¡a ¡Graph ¡Database ¡ @neo4j ¡

  6. Labeled ¡Property ¡Graph ¡ @neo4j ¡

  7. Making ¡ConnecIons ¡ @neo4j ¡

  8. Triadic ¡Closure ¡– ¡Closing ¡Triangles ¡ @neo4j ¡

  9. Triadic ¡Closure ¡– ¡Closing ¡Triangles ¡ @neo4j ¡

  10. Triadic ¡Closure ¡– ¡Closing ¡Triangles ¡ @neo4j ¡

  11. Recommending ¡New ¡ConnecIons ¡ @neo4j ¡

  12. Immediate ¡Friendships ¡ @neo4j ¡

  13. Means ¡and ¡MoIve ¡ @neo4j ¡

  14. RecommendaIon ¡ @neo4j ¡

  15. Recommend ¡New ¡ConnecIons ¡ MATCH (user:User{name:'Terry'}) -[:FRIEND*2]- (other:User) WHERE NOT (user)-[:FRIEND]-(other) RETURN other.name AS name, COUNT(other) AS score ORDER BY score DESC @neo4j ¡

  16. Find ¡Terry ¡ MATCH ( MATCH (user:User user:User{name:'Terry name:'Terry'}) '}) -[:FRIEND*2]- (other:User) WHERE NOT (user)-[:FRIEND]-(other) RETURN other.name AS name, COUNT(other) AS score ORDER BY score DESC @neo4j ¡

  17. Find ¡Terry’s ¡Friends’ ¡Friends ¡ MATCH (user:User{name:'Terry'}) -[:FRIEND*2]- -[:FRIEND*2]- ( (other:User other:User) WHERE NOT (user)-[:FRIEND]-(other) RETURN other.name AS name, COUNT(other) AS score ORDER BY score DESC @neo4j ¡

  18. Find ¡Terry’s ¡Friends’ ¡Friends ¡ MATCH ( MATCH (user:User user:User{name:'Terry name:'Terry'}) '}) -[:FRIEND*2]- -[:FRIEND*2]- ( (other:User other:User) WHERE NOT (user)-[:FRIEND]-(other) RETURN other.name AS name, COUNT(other) AS score ORDER BY score DESC @neo4j ¡

  19. …Who ¡Terry ¡Doesn’t ¡Know ¡ MATCH (user:User{name:'Terry'}) -[:FRIEND*2]- (other:User) WHERE NOT (user)-[:FRIEND]-(other) WHERE NOT (user)-[:FRIEND]-(other) RETURN other.name AS name, COUNT(other) AS score ORDER BY score DESC @neo4j ¡

  20. Count ¡Matches ¡Per ¡Person ¡ MATCH (user:User{name:'Terry'}) -[:FRIEND*2]- (other:User) WHERE NOT (user)-[:FRIEND]-(other) RETURN other.name AS name, COUNT(other) AS score COUNT(other) AS score ORDER BY score DESC @neo4j ¡

  21. Return ¡The ¡Results ¡ MATCH (user:User{name:'Terry'}) -[:FRIEND*2]- (other:User) WHERE NOT (user)-[:FRIEND]-(other) RETURN RETURN other.name other.name AS name, AS name, COUNT(other) AS score COUNT(other) AS score ORDER BY score DESC ORDER BY score DESC @neo4j ¡

  22. Taking ¡Account ¡of ¡Friendship ¡Strength ¡ MATCH (user:User{name:'Terry'}) -[ -[rels:FRIEND rels:FRIEND*2]- *2]- (other:User) WHERE ALL(r IN rels WHERE ALL(r IN rels WHERE WHERE r.strength r.strength > 1) > 1) AND NOT (user)-[:FRIEND]-(other) RETURN other.name AS name, COUNT(other) AS score ORDER BY score DESC @neo4j ¡

  23. Nowhere ¡To ¡Hide ¡ @neo4j ¡

  24. First-­‑Party ¡Fraud ¡ • Fraudsters ¡apply ¡for ¡credit ¡ – No ¡intenIon ¡of ¡repaying ¡ • Appear ¡normal ¡unIl ¡they ¡“burst ¡out” ¡ – Clear ¡out ¡accounts ¡ • Fraud ¡ring ¡ – Share ¡bits ¡of ¡idenIty ¡(NI, ¡address, ¡telephone) ¡ – Coordinated ¡“burst ¡out” ¡ @neo4j ¡

  25. Fraud ¡Ring ¡ @neo4j ¡

  26. Query ¡ • Create ¡new ¡applicant ¡ ¡ • Connect ¡applicant ¡to ¡idenIty ¡info ¡ – Reuse ¡exisIng ¡idenIfy ¡info ¡where ¡possible ¡ Then ¡ • Select ¡applicant’s ¡idenIty ¡info ¡ • Crawl ¡surrounding ¡graph ¡ – Look ¡for ¡expansive ¡clusters ¡of ¡account ¡holders ¡ @neo4j ¡

  27. Path ¡CalculaIons ¡ @neo4j ¡

  28. Problem ¡ • Increase ¡in ¡parcel ¡traffic ¡ – Amazon, ¡eBay ¡ – Current ¡infrastructure ¡can’t ¡cope ¡ • Calculate ¡opImal ¡route ¡ – Under ¡40ms ¡ – Routes ¡vary ¡over ¡Ime ¡ • Numbers: ¡ – 2000-­‑3000 ¡parcels ¡per ¡second ¡ – 25 ¡naIonal ¡parcel ¡centres, ¡2 ¡million ¡postcodes, ¡30 ¡ million ¡address ¡ @neo4j ¡

  29. Period ¡1 ¡ @neo4j ¡

  30. Period ¡2 ¡ @neo4j ¡

  31. Period ¡3 ¡ @neo4j ¡

  32. The ¡Full ¡Graph ¡ @neo4j ¡

  33. @neo4j ¡

  34. Steps ¡1 ¡and ¡2 ¡ @neo4j ¡

  35. Step ¡3 ¡ @neo4j ¡

  36. Paths ¡ MATCH path=(from{name:'X'}) -[:CONNECTED_TO*1..4]-> (to{name:'Y'}) RETURN path AS shortestPath, reduce(weight=0, r in relationships(path) | weight + r.weight) AS total ORDER BY total ASC LIMIT 1 @neo4j ¡

  37. Match ¡Variable-­‑Length ¡Path ¡ MATCH path=(from{name:'X'}) -[:CONNECTED_TO*1..4]-> (to{name:'Y'}) RETURN path AS shortestPath, reduce(weight=0, r in relationships(path) | weight + r.weight) AS total ORDER BY total ASC LIMIT 1 @neo4j ¡

  38. Calculate ¡Path ¡Weight ¡ MATCH path=(from{name:'X'}) -[:CONNECTED_TO*1..4]-> (to{name:'Y'}) RETURN path AS shortestPath, reduce(weight=0, r in relationships(path) | weight + r.weight) AS total ORDER BY total ASC LIMIT 1 @neo4j ¡

  39. Return ¡Shortest ¡Weighted ¡Path ¡ MATCH path=(from{name:'X'}) -[:CONNECTED_TO*1..4]-> (to{name:'Y'}) RETURN path AS shortestPath, reduce(weight=0, r in relationships(path) | weight + r.weight) AS total ORDER BY total ASC LIMIT 1 @neo4j ¡

  40. Full ¡Query ¡ MATCH (s:Location {name:{startLocation}}), (e:Location {name:{endLocation}}) MATCH upLeg = (s)<-[:DELIVERY_ROUTE*1..2]-(db1) WHERE all(r in relationships(upLeg) WHERE r.start_date <= {intervalStart} AND r.end_date >= {intervalEnd}) WITH e, upLeg, db1 MATCH downLeg = (db2)-[:DELIVERY_ROUTE*1..2]->(e) WHERE all(r in relationships(downLeg) WHERE r.start_date <= {intervalStart} AND r.end_date >= {intervalEnd}) WITH db1, db2, upLeg, downLeg MATCH topRoute = (db1)<-[:CONNECTED_TO]-()-[:CONNECTED_TO*1..3]-(db2) WHERE all(r in relationships(topRoute) WHERE r.start_date <= {intervalStart} AND r.end_date >= {intervalEnd}) WITH upLeg, downLeg, topRoute, reduce(weight=0, r in relationships(topRoute) | weight+r.cost) AS score ORDER BY score ASC LIMIT 1 RETURN (nodes(upLeg) + tail(nodes(topRoute)) + tail(nodes(downLeg))) AS route @neo4j ¡

  41. neo4j.com/online_course ¡ @neo4j ¡

  42. graphdatabases.com ¡ of Neo Technology Compliments Thank ¡you ¡ @ian S robinson ¡ #neo4j ¡ ¡ ¡ Graph h Databases Ian Robinson, Jim Webber & Emil Eifrem @neo4j ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend