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

Graph databases and analysis using Neo4j

Graph databases and analysis using Neo4j

This is an introductory level presentation on the topic of graph databases. It covers simple use-cases and basics.

Akash Tandon

January 19, 2019
Tweet

More Decks by Akash Tandon

Other Decks in Programming

Transcript

  1. Graph databases and analysis presents using Neo4j Akash Tandon Data

    Engineering@SocialCops Email: [email protected] Twitter: analyticalmonk
  2. Goal - Learn why graph databases are relevant - Understand

    advantages and challenges related to working with Graph DBs - Introduction to Neo4j graph database, cypher query language and Py2Neo python package
  3. History The Konigsberg problem Solved by Leonhard Euler Laid the

    foundation of graph theory Ref: Wikipedia
  4. Use-cases - Fraud detection - Knowledge graphs - Recommendation systems

    - Investigative journalism (Panama papers) - Social media and network graphs - Analytics - … and so on!
  5. Neo4j - Most popular graph DBMS and market leader -

    Property graph database - Graph storage and processing engine - Open source and great community-support - Visualization tool, browser and integration with multiple languages (Python, Java, etc.)
  6. Cypher - Declarative graph query language - Allows for expressive

    and efficient querying and updating of a property graph - SQL-ish
  7. Cypher MATCH (a:Artist),(b:Album) WHERE a.Name = "Pink Floyd" AND b.Name

    = "Dark side of the moon" CREATE (a)-[r:RELEASED]->(b) RETURN r
  8. Py2Neo - Py2neo is a client library and toolkit for

    working with Neo4j from within Python applications and from the command line. - Github repo: https://github.com/technige/py2neo
  9. Py2Neo >>> from py2neo.data import Node, Relationship >>> a =

    Node("Person", name="Alice") >>> b = Node("Person", name="Bob") >>> ab = Relationship(a, "KNOWS", b) >>> ab (Alice)-[:KNOWS]->(Bob) -
  10. Graph algorithms - Centralities (Pagerank, Betweenness, Closeness) - Community detection

    (Louvain, Label propogation) - Path finding (Shortest path - A*, Dijkstra) - Similarity (Jaccard, Cosine) Neo4j-supported graph algorithms: https://neo4j.com/docs/graph-algorithms/current/introducti on/#introduction-algorithms