Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Neo4j Foundations

Neo4j Foundations


Juan Guillermo Gómez Torres

November 27, 2020


  1. Neo4j - Foundations

  2. Juan Guillermo Gómez ➢ Co-Leader y Co-Founder of GDG Cali.

    ➢ Tech Lead in WordBox & Founder DevHack ➢ Consultant and advisor on software architecture, cloud computing and software development. ➢ Experience in several languages and platforms. (C, C#, Java, NodeJS, android, GCP, Firebase). ➢ Google Developer Expert (GDE) in Firebase & GCP ➢ BS in System Engineering and a MS in Software Engineering. ➢ @jggomezt

  4. What is a Graph? ❖ Graphs are mathematical structures used

    to model pairwise relations between objects. ❖ A graph in this context is made up of vertices (also called nodes or points) which are connected by edges (also called links or lines). ❖ The order of a graph is its number of vertices |V|. The size of a graph is its number of edges |E|.
  5. What is a Graph Database? ❖ ODMS (Online Database Management

    System) with CRUD operations working on a graph model for use with OLTP systems. ❖ By assembling the simple abstractions of nodes and relationships into connected structures, graph databases enable us to build sophisticated models that map closely to our problem domain. ❖ The biggest value that graphs bring to the development stack is their ability to store relationships and connections as first-class entities. ❖ The graphs are finite state machines and oriented graph.
  6. What is a Graph Database? ❖ Nodes represents an entity

    (a person, place, word, book, category, thing, etc) ❖ Nodes can have labels that are used to define types for nodes. ❖ Nodes can have one or more labels. ❖ Labels can be used to group nodes of the same type.
  7. What is a Graph Database? ❖ Relationship represents how two

    nodes are connected. ❖ A relationship represents the verb between two entities. ❖ Although the relationship is defined as directional, it can be queried in a non-directional manner ❖ For some data models, the direction of the relationship is significant.
  8. What is a Graph Database? ❖ The nodes and relationship

    can have properties
  9. Methodology - Design

  10. Methodology - Design

  11. Methodology - Design

  12. RDBMS vs Graph

  13. RDBMS vs Graph

  14. RDBMS vs Graph

  15. RDBMS vs Graph

  16. SQL Problems

  17. SQL Problems

  18. NoSQL Problems

  19. None
  20. NEO4J

  21. Neo4j Graph Platform The heart of the Neo4j Graph Platform

    is the Neo4j Database. The Neo4j Graph Platform includes out-of-the-box tooling that enables you to access graphs in Neo4j Databases. In addition, Neo4j provides APIs and drivers that enable you to create applications and custom tooling for accessing and visualizing graphs.
  22. Neo4j Graph Platform

  23. Neo4j Graph Platform

  24. Neo4j Graph Platform

  25. Neo4j Graph Platform

  26. Neo4j Graph Platform ❖ GRAPH ENGINE ❖ LANGUAGE AND DRIVER

  27. Neo4j Graph Platform Architecture

  28. Neo4j Development Environment

  29. Neo4j Development Environment

  30. Neo4j Development Environment

  31. Cypher ❖ Cypher is a declarative query language that allows

    for expressive and efficient querying and updating of graph data. Cypher is a relatively simple and very powerful language. Complex database queries can easily be expressed through Cypher, allowing you to focus on your domain instead of getting lost in the syntax of database access. ❖ Cypher is designed to be a human-friendly query language, suitable for both developers and other professionals. The guiding goal is to make the simple things easy, and the complex things possible.
  32. Cypher - Create ❖ CREATE ❖ CREATE RELATIONSHIP CREATE (player:PLAYER{name:”Juan”})

    RETURN player CREATE (player:PLAYER{name:”Juan”}) CREATE (team:TEAM{name:”America”}) MERGE (player) - [rel:PLAYS_IN] -> (team) RETURN player, rel, team
  33. Querying Nodes MATCH (variable) RETURN variable MATCH (variable:Label) RETURN variable

    ❖ All nodes in the graph ➢ MATCH (n) RETURN n ❖ ➢ MATCH (user:USER) WHERE user.id = “123345” RETURN user
  34. Neo4j Graph Data Science Library

  35. ❖ Graph data science uses the relationships and network structures

    in your data to help data scientists address complex questions about system dynamics and group behavior. ❖ Businesses use these insights to make valuable predictions, such as pinpointing interactions that indicate fraud, identifying similar entities or individuals, finding the most influential elements in patient or customer journeys, and how to ameliorate the spread of IT or phone outages. ❖ The Neo4j Graph Data Science™ Library makes addressing these questions feasible. Data scientists benefit from a customized, flexible data structure for global computations and a repository of powerful, robust algorithms to quickly compute results over tens of billions of nodes. ❖ Graph algorithms provide unsupervised machine learning methods and heuristics that learn and describe the topology of your graph. The GDS™ Library includes hardened graph algorithms with enterprise features, like deterministic seeding for consistent results and reproducible machine learning workflows. Harness the Predictive Power of Relationships
  36. Harness the Predictive Power of Relationships

  37. Harness the Predictive Power of Relationships

  38. Harness the Predictive Power of Relationships

  39. Recommender System MATCH (genre:Genre{name:"Comedy"})<-[:IN_GENRE]-(movie:Movie)<-[rating:RATED]-(user:User) RETURN movie, avg(rating.rating) AS score ORDER

    BY score DESC MATCH (genre:Genre{name:"Comedy"})<-[:IN_GENRE]-(movie:Movie)<-[rating:RATED]-(user:User) MATCH (movie)-[:HAS_IMDB_RATING]->(imdbRating:ImdbRating) RETURN movie, avg(rating.rating)+avg(imdbRating.rating) AS score ORDER BY score MATCH (:User {id: "1"})-[r:RATED]->(m)-[:IN_GENRE]->(g) WHERE toInteger(r.rating) = 5.0 RETURN g.name AS genre, count(m) AS score ORDER BY score DESC MATCH (m1:Movie{name:"Iron Man"})-[:IN_GENRE]->(g)<-[:IN_GENRE]-(m2) RETURN m2 AS recommendation, count(g) AS score ORDER BY score
  40. LINKS • https://neo4j.com/developer/guide-data-modeling/ • https://neo4j.com/developer/graph-platform/ • https://neo4j.com/developer/cypher-basics-i/ • https://neo4j.com/graph-data-science-library/

  41. https://www.facebook.com/escueladevhack / Escuela de Hackers www.devhack.co https://github.com/escueladevhac k