Share
Embed
Transcript
34 slides
-
Welcome to NEO4J - Week 1 of 3 - Intro
to Graphs Grab a drink/snack and say hi to your neighbour! Wifi: neo4j / GraphConnectLondon If you’ve got a laptop download neo4j from neo4j.com/download -
Neo4j Graph databases & neo4j - have heard the terms,
but don't really know what they're about. Learn about use cases of Neo4j, how is working with it, architecture, etc. The potential of neo4j Graph database How to create some Graphs with Neo4j Databases and how they can be used. Neo4J Graph Database and Document Databases Neo4 in practice How to use graph databases practically. About graph databases, how and where are they used in industries (use cases, real life scenarios etc.), how are they different from other types of databases, and how to create them. Applications of graph databases and how to structure them New skills and using graph databases in practice Visualisation More about databases and translating that into visual data (aka graphs) Data viz Your expectations -
What is a database? database ˈdeɪtəbeɪs/ noun a structured set
of data held in a computer, especially one that is accessible in various ways. Ex:"a database covering nine million workers" An example of a database is where A-Level results are stored before they are printed out and published to students. -
Evolution of Databases • Unit Records and Punch Cards •
File Systems • Hierarchical DBMS • Network DBMS • Relational Databases • Object Oriented Databases • NoSQL Source: http://avant.org/project/history-of-databases/ -
What’s a graph database? Simply put, a graph consists of
nodes connected by relationships. Graph databases store data as graph structures (nodes and relationships) -
CAR Property Graph Model Components Nodes • Represent the objects
in the graph • Can be labeled PERSON PERSON -
CAR DRIVES Property Graph Model Components Nodes • Represent the
objects in the graph • Can be labeled Relationships • Relate nodes by type and direction LOVES LOVES LIVES WITH OW NS PERSON PERSON -
CAR DRIVES name: “Dan” born: May 29, 1970 twitter: “@dan”
name: “Ann” born: Dec 5, 1975 since: Jan 10, 2011 brand: “Volvo” model: “V70” Property Graph Model Components Nodes • Represent the objects in the graph • Can be labeled Relationships • Relate nodes by type and direction Properties • Name-value pairs that can go on nodes and relationships. LOVES LOVES LIVES WITH OW NS PERSON PERSON -
Graphs are all around us Can you identify nodes and
relationships in the room? -
Summary of the graph building blocks • Nodes - Entities
and complex value types • Relationships - Connect entities and structure domain • Properties - Entity attributes, relationship qualities, metadata • Labels - Group nodes by role -
Cypher: Graph Query Language MATCH (:Person { name:"Dan"} ) -[:LOVES]->
(:Person { name:"Ann"} ) LOVES Dan Ann LABEL PROPERTY NODE NODE LABEL PROPERTY -
Nodes () or (n) • Surrounded with parentheses • Use
an alias n to refer to our node later in the query -
Nodes () or (n) • Surrounded with parentheses • Use
an alias n to refer to our node later in the query (n:Label) • Specify a Label, starting with a colon : • Used to group nodes by roles or types (similar to tags) -
Nodes () or (n) • Surrounded with parentheses • Use
an alias n to refer to our node later in the query (n:Label) • Specify a Label, starting with a colon : • Used to group nodes by roles or types (similar to tags) (n:Label {prop: 'value'}) • Nodes can have properties -
--> or -[r:TYPE]-> • Wrapped with hyphens & square brackets
• A relationship type starts with a colon : Relationships -
--> or -[r:TYPE]-> • Wrapped with hyphens & square brackets
• A relationship type starts with a colon : < > Specify the direction of the relationship -[:KNOWS {since: 2010}]-> • Relationships can have properties too! Relationships -
• Find Alice who knows Bob • In other words:
• find Person named 'Alice' • who KNOWS • a Person named 'Bob' (p1:Person {name:'Alice'})-[:KNOWS]->(p2:Person {name:'Bob') Patterns -
Once you download, For setup you will be asked to
give a default location. Click start! You are good to go. Goto Browser type http://localhost:7474 Enter default password: neo4j Instructions -
Type :play movies into the query bar: Play along with
the movies graph -
Type :play movies into the query bar: Play along with
the movies graph -
Sample Queries to try out // Find the Matrix MATCH
(movie:Movie {title:"The Matrix"}) RETURN movie // Find the people who acted in any movie and return their name and // the role they played in the movie MATCH (actor:Person)-[rel:ACTED_IN]->(movie:Movie) RETURN rel.roles, actor.name -
How Customers Use Neo4j Network & Data Center Master Data
Management Social Recommendations Identity & Access Search & Discovery GEO -
Neo4j ✓Graph databases & neo4j - have heard the terms,
but don't really know what they're about. ✓Learn about use cases of Neo4j, how is working with it, architecture, etc. The potential of neo4j ✓Graph database ✓How to create some Graphs with Neo4j ✓Databases and how they can be used. Neo4J Graph Database and Document Databases Neo4 in practice How to use graph databases practically. ✓About graph databases, how and where are they used in industries (use cases, real life scenarios etc.), how are they different from other types of databases, and how to create them. Applications of graph databases and how to structure them New skills and using graph databases in practice Visualisation ✓More about databases and translating that into visual data (aka graphs) Data viz Your expectations -
Thank you :) Contact us: @markhneedham @praveenasekhar Feedback here ->
bit.ly/wwc-neo4j Join neo4j.com/slack - we’ll be using it next week -
Resources • Online Training - https://neo4j.com/online_training/graphdatabases • Graph Databases Book
- http://graphdatabases.com/ • Meetup group - https://www.meetup.com/graphdb-london/ • Slack channel - http://neo4j.com/slack • Stack Overflow - http://stackoverflow.com/tags/neo4j