introduction to graph data management...introduction to graph data management with neo4j tobias...
TRANSCRIPT
![Page 2: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/2.jpg)
Whygraphs?
![Page 3: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/3.jpg)
Theworldisagraph–everythingisconnected
• people,places,events
• companies,markets
• countries,history,politics• lifesciences,bioinformatics,clinicaldata
• art,teaching
• technology,networks,machines, applications,users
• software,code,dependencies,architecture,deployments
• criminals,fraudstersandtheirbehavior5
![Page 4: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/4.jpg)
6
Thetopologyofthedataisatleastasimportantas
thedataitself
![Page 5: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/5.jpg)
Humansthinkingraphs
• Weunderstandandlearnby• howsomethingnewissimilartowhatwealreadyknow
• howitdiffers• i.e.byrelatingthings
• inagraph!
7
![Page 6: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/6.jpg)
Whatarepeopleusinggraphdatabasesfor?
![Page 7: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/7.jpg)
UseCases
InternalApplicationsMasterDataManagement
Networkand ITOperations
FraudDetection
Customer-FacingApplicationsReal-TimeRecommendations
Graph-BasedSearch
IdentityandAccessManagement
![Page 8: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/8.jpg)
SocialNetwork
![Page 9: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/9.jpg)
ImpactAnalysis
![Page 10: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/10.jpg)
Logistics&Routing
![Page 11: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/11.jpg)
Recommendations
![Page 12: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/12.jpg)
AccessControl
![Page 13: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/13.jpg)
FraudAnalysis
![Page 14: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/14.jpg)
Modellingtranslationsandcomplexaccessrules
16
EN:house
house
building
EN:building
ES:edificio DE:Gebäude
SE:byggnad
ES:casa
DE:Hause
SE:hus
![Page 15: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/15.jpg)
WhiteboardFriendliness
Easy to design and model, direct representation of the model
![Page 16: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/16.jpg)
Whiteboardfriendliness
![Page 17: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/17.jpg)
Tom Hanks Hugo Weaving
Cloud AtlasThe Matrix
Lana Wachowski
ACTED_IN
ACTED_IN ACTED_IN
DIRECTED
DIRECTED
Whiteboardfriendliness
![Page 18: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/18.jpg)
name: Tom Hanks born: 1956
title: Cloud Atlas released: 2012
title: The Matrix released: 1999
name: Lana Wachowski born: 1965
ACTED_IN roles: Zachry
ACTED_IN roles: Bill Smoke
DIRECTED
DIRECTED
ACTED_IN roles: Agent Smith
name: Hugo Weaving born: 1960
Person
MovieMovie
Person Director
ActorPerson Actor
Whiteboardfriendliness
![Page 19: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/19.jpg)
Whiteboardfriendliness
![Page 20: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/20.jpg)
Introtothepropertygraphmodel
![Page 21: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/21.jpg)
Neo4jFundamentals
• Nodes
• Relationships
• Properties
• Labels
![Page 22: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/22.jpg)
Car
PropertyGraphModelComponents
Nodes• Representtheobjectsinthegraph• Canbelabeled
Person Person
![Page 23: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/23.jpg)
Car
DRIVES
PropertyGraphModelComponents
Nodes• Representtheobjectsinthegraph• Canbelabeled
Relationships• Relatenodesbytypeanddirection
LOVES
LOVES
LIVESWITH
OWNS
Person Person
![Page 24: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/24.jpg)
Car
DRIVES
name:“Dan”born:May29,1970twitter:“@dan”
name:“Ann”born:Dec5,1975
since: Jan10,2011
brand:“Volvo”model:“V70”
PropertyGraphModelComponents
Nodes• Representtheobjectsinthegraph• Canbelabeled
Relationships• Relatenodesbytypeanddirection
Properties• Name-valuepairsthatcangoonnodesandrelationships.
LOVES
LOVES
LIVESWITH
OWNS
Person Person
![Page 25: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/25.jpg)
Summaryofthegraphbuildingblocks
• Nodes-Entitiesandcomplexvaluetypes
• Relationships-Connectentitiesandstructuredomain
• Properties-Entityattributes,relationshipqualities,metadata
• Labels-Groupnodesbyrole
![Page 26: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/26.jpg)
GraphQuerying
![Page 27: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/27.jpg)
WhynotSQL?
• SQLisinefficientinexpressinggraphpatternqueriesInparticularforqueriesthat• arerecursive• canacceptpathsofmultipledifferentlengths
• Graphpatternsaremoreintuitiveanddeclarativethanjoins
• SQLcannothandlepathvalues
29
![Page 28: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/28.jpg)
30
Apatternmatchingquerylanguagemadeforgraphs
• Declarative
• Expressive
• PatternMatching
Cypher
![Page 29: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/29.jpg)
PatterninourGraphModel
LOVES
Dan Ann
NODE NODERelationship
![Page 30: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/30.jpg)
Cypher:ExpressGraphPatterns
(:Personname:"Dan")-[:LOVES]->(:Personname:"Ann")
LOVES
Dan Ann
LABEL PROPERTY
NODE NODE
LABEL PROPERTY
Relationship
![Page 31: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/31.jpg)
Cypher:CREATEGraphPatterns
CREATE(:Personname:"Dan")-[:LOVES]->(:Personname:"Ann")
LOVES
Dan Ann
LABEL PROPERTY
NODE NODE
LABEL PROPERTY
Relationship
![Page 32: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/32.jpg)
Cypher:MATCHGraphPatterns
MATCH(:Personname:"Dan")-[:LOVES]->(whom)RETURNwhom
LOVES
Dan ?
VARIABLE
NODE NODE
LABEL PROPERTY
Relationship
![Page 33: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/33.jpg)
Agraphqueryexample
![Page 34: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/34.jpg)
Asocialrecommendation
![Page 35: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/35.jpg)
MATCH(person:Person)-[:IS_FRIEND_OF]->(friend),(friend)-[:LIKES]->(restaurant),(restaurant)-[:LOCATED_IN]->(loc:Location),(restaurant)-[:SERVES]->(type:Cuisine)WHEREperson.name='Philip'ANDloc.location='NewYork'ANDtype.cuisine='Sushi'RETURNrestaurant.name
Asocialrecommendation
![Page 36: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/36.jpg)
TheSyntax
![Page 37: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/37.jpg)
Nodes
Nodesaredrawnwithparentheses.
()
![Page 38: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/38.jpg)
Relationships
Relationshipsaredrawnasarrows,withadditionaldetailinbrackets.
-->-[:DIRECTED]->
![Page 39: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/39.jpg)
Patterns
Patternsaredrawnbyconnectingnodesandrelationshipswithhyphens,optionallyspecifyingadirectionwith>and<signs. ()-[]-()()-[]->()()<-[]-()
![Page 40: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/40.jpg)
ThecomponentsofaCypherquery
MATCH(m:Movie)RETURNmMATCHandRETURNareCypherkeywords misavariable:Movieisanodelabel
![Page 41: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/41.jpg)
ThecomponentsofaCypherquery
MATCH(p:Person)-[r:ACTED_IN]->(m:Movie)RETURNp,r,mMATCHandRETURNareCypherkeywords p,r,andmarevariables :Movieisanodelabel :ACTED_INisarelationshiptype
![Page 42: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/42.jpg)
ThecomponentsofaCypherquery
MATCHpath=(:Person)-[:ACTED_IN]->(:Movie)RETURNpathMATCHandRETURNareCypherkeywords pathisavariable:Movieisanodelabel :ACTED_INisarelationshiptype
![Page 43: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/43.jpg)
MATCH(m:Movie)RETURNm
GraphversusTabularresults
![Page 44: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/44.jpg)
MATCH(m:Movie)RETURNm.title,m.releasedPropertiesareaccessedwithvariable.property_key
GraphversusTabularresults
![Page 45: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/45.jpg)
Casesensitive Nodelabels
Relationshiptypes
Propertykeys
Caseinsensitive Cypherkeywords
Casesensitivity
![Page 46: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/46.jpg)
Casesensitive :Person
:ACTED_IN
name
Caseinsensitive MaTcH
return
Casesensitivity
![Page 47: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/47.jpg)
Writequeries
![Page 48: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/48.jpg)
TheCREATEClause
CREATE(m:Movietitle:'MysticRiver',released:2003)
RETURNm
![Page 49: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/49.jpg)
TheSETClause
MATCH(m:Movietitle:'MysticRiver')
SETm.tagline='Weburyoursinshere,Dave.Wewashthemclean.'
RETURNm
![Page 50: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/50.jpg)
TheCREATEClause
MATCH(m:Movietitle:'MysticRiver')
MATCH(p:Personname:'KevinBacon')
CREATE(p)-[r:ACTED_INroles:['Sean']]->(m)
RETURNp,r,m
![Page 51: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/51.jpg)
TheMERGEClause
MERGE(p:Personname:'TomHanks')
RETURNp
![Page 52: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/52.jpg)
TheMERGEClause
MERGE(p:Personname:'TomHanks',oscar:true)
RETURNp
![Page 53: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/53.jpg)
TheMERGEClause
MERGE(p:Personname:'TomHanks',oscar:true)
RETURNpThereisnota:Personnodewithname:'TomHanks'andoscar:trueinthegraph,butthereisa:Personnodewithname:'TomHanks'. Whatdoyouthinkwillhappenhere?
![Page 54: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/54.jpg)
TheMERGEClause
MERGE(p:Personname:'TomHanks')
SETp.oscar=true
RETURNp
![Page 55: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/55.jpg)
TheMERGEClause
MERGE(p:Personname:'TomHanks')-[:ACTED_IN]
->(m:Movietitle:'TheTerminal')
RETURNp,m
![Page 56: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/56.jpg)
TheMERGEClause
MERGE(p:Personname:'TomHanks')-[:ACTED_IN]
->(m:Movietitle:'TheTerminal')
RETURNp,m
Thereisnota:Movienodewithtitle:"TheTerminal"inthegraph,butthereisa:Personnodewithname:"TomHanks". Whatdoyouthinkwillhappenhere?
![Page 57: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/57.jpg)
MERGE(p:Personname:'TomHanks')
MERGE(m:Movietitle:'TheTerminal')
MERGE(p)-[r:ACTED_IN]->(m)
RETURNp,r,m
TheMERGEClause
![Page 58: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/58.jpg)
MERGE(p:Personname:'YourName')
ONCREATESETp.created=timestamp(),p.updated=0
ONMATCHSETp.updated=p.updated+1
RETURNp.created,p.updated;
ONCREATEandONMATCH
![Page 59: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/59.jpg)
Indexes
Wecreateindexesto:
• allowfastlookupofnodeswhichmatchlabel-propertypairs.CREATEINDEXON:Label(property)
![Page 60: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/60.jpg)
Whatarethesefastlookups?
Thefollowingpredicatesuseindexes:
• Equality• STARTSWITH
• CONTAINS
• ENDSWITH
• Rangesearches
• (Non-)existencechecks
![Page 61: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/61.jpg)
Howareindexesusedinneo4j?
Indexesareonlyusedtofindthestartingpointsforqueries.
Useindexscanstolookuprowsintablesandjointhemwithrowsfromothertables
Useindexestofindthestartingpointsforaquery.
Relational Graph
![Page 62: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/62.jpg)
GraphModeling
![Page 63: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/63.jpg)
Models
![Page 64: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/64.jpg)
Themodelingworkflow
1.Derivethequestion
2.Obtainthedata
3.Developamodel
4.Ingestthedata
5.Query/Proveourmodel
![Page 65: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/65.jpg)
Developingthemodelandthequery
1.Identifyapplication/end-usergoals2.Figureoutwhatquestionstoaskofthedomain3.Identifyentitiesineachquestion4.Identifyrelationshipsbetweenentitiesineachquestion5.Convertentitiesandrelationshipstopaths
- Thesebecomethebasisofthedatamodel6.Expressquestionsasgraphpatterns
- Thesebecomethebasisforqueries
67
![Page 66: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/66.jpg)
1.Application/End-UserGoals
68
As an employeeI want to know who in the company has similar skills to meSo that we can exchange knowledge
![Page 67: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/67.jpg)
2.QuestionstoaskoftheDomain
69
As an employeeI want to know who in the company has similar skills to meSo that we can exchange knowledge
Whichpeople,whoworkforthesamecompanyasme,havesimilarskillstome?
![Page 68: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/68.jpg)
3.IdentifyEntities
Which people, who work for the same company as me, have similar skills to me?
• Person• Company• Skill
70
![Page 69: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/69.jpg)
4.IdentifyRelationshipsBetweenEntities
Which people, who work for the same company as me, have similar skills to me?
• PersonWORKSFORCompany• PersonHASSKILLSkill
71
![Page 70: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/70.jpg)
5.ConverttoCypherPaths
•Person WORKS FOR Company
•Person HAS SKILL Skill
72
![Page 71: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/71.jpg)
5.ConverttoCypherPaths
•Person WORKS FOR Company
•Person HAS SKILL Skill
72
Relationship
NodeNode Relationship
Node Node
![Page 72: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/72.jpg)
5.ConverttoCypherPaths
•Person WORKS FOR Company
•Person HAS SKILL Skill
• (:Person)-[:WORKS_FOR]->(:Company),• (:Person)-[:HAS_SKILL]->(:Skill)
72
Relationship
NodeNode Relationship
Node Node
![Page 73: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/73.jpg)
5.ConverttoCypherPaths
•Person WORKS FOR Company
•Person HAS SKILL Skill
• (:Person)-[:WORKS_FOR]->(:Company),• (:Person)-[:HAS_SKILL]->(:Skill)
72
Relationship
NodeNode Relationship
Node Node
Label Label
Label Label
Relationship Type
Relationship Type
![Page 74: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/74.jpg)
ConsolidatePattern
(:Person)-[:WORKS_FOR]->(:Company),(:Person)-[:HAS_SKILL]->(:Skill)
(:Company)<-[:WORKS_FOR]-(:Person)-[:HAS_SKILL]->(:Skill)
73
Person SkillCompany
WORKS_FOR HAS_SKILL
![Page 75: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/75.jpg)
CandidateDataModel(:Company)<-[:WORKS_FOR]-(:Person)-[:HAS_SKILL]->(:Skill)
74
name:Neo4j
name:Ian
name:ACME
Person
Company
WO
RKS_
FOR
HAS_
SKILL
name:Jacob
Person
name:Tobias
Person
WORKS_F
OR WORKS_FOR
name:Scala
name:Python
name:C#
SkillSkillSkillSkillHA
S_SK
ILL
HAS_SKILLHAS_SKILL
HAS_SKILL
HAS_SKILLHAS_
SKILL
![Page 76: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/76.jpg)
6.ExpressQuestionasGraphPattern
Which people, who work for the same company as me, have similar skills to me?
75
skill
company
Company
colleagueme
PersonWORK
S_FOR
WORKS_FOR
Skill
HAS_SKILL HAS_SKILL
Person
![Page 77: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/77.jpg)
CypherQuery
Which people, who work for the same company as me, have similar skills to me?
MATCH(company)<-[:WORKS_FOR]-(me:Person)-[:HAS_SKILL]->(skill)
(company)<-[:WORKS_FOR]-(colleague)-[:HAS_SKILL]->(skill)WHEREme.name=$nameRETURNcolleague.nameASname,
count(skill)ASscore,collect(skill.name)ASskillsORDERBYscoreDESC
76
skill
company
Company
colleagueme
PersonWORK
S_FOR
WORKS_FOR
Skill
HAS_SKILL HAS_SKILL
Person
![Page 78: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/78.jpg)
CypherQuery
Which people, who work for the same company as me, have similar skills to me?
MATCH(company)<-[:WORKS_FOR]-(me:Person)-[:HAS_SKILL]->(skill)
(company)<-[:WORKS_FOR]-(colleague)-[:HAS_SKILL]->(skill)
WHEREme.name=$nameRETURNcolleague.nameASname,
count(skill)ASscore,collect(skill.name)ASskillsORDERBYscoreDESC
77
skill
company
Company
colleagueme
PersonWORK
S_FOR
WORKS_FOR
Skill
HAS_SKILL HAS_SKILL
Person
1.Graph pattern
![Page 79: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/79.jpg)
CypherQuery
Which people, who work for the same company as me, have similar skills to me?
MATCH(company)<-[:WORKS_FOR]-(me:Person)-[:HAS_SKILL]->(skill)
(company)<-[:WORKS_FOR]-(colleague)-[:HAS_SKILL]->(skill)WHEREme.name=$name
RETURNcolleague.nameASname,
count(skill)ASscore,collect(skill.name)ASskillsORDERBYscoreDESC
78
skill
company
Company
colleagueme
PersonWORK
S_FOR
WORKS_FOR
Skill
HAS_SKILL HAS_SKILL
Person
1. Graph pattern
2.Filter, using index if available
![Page 80: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/80.jpg)
CypherQuery
Which people, who work for the same company as me, have similar skills to me?
MATCH(company)<-[:WORKS_FOR]-(me:Person)-[:HAS_SKILL]->(skill)
(company)<-[:WORKS_FOR]-(colleague)-[:HAS_SKILL]->(skill)WHEREme.name=$nameRETURNcolleague.nameASname,
count(skill)ASscore,
collect(skill.name)ASskills
ORDERBYscoreDESC
79
skill
company
Company
colleagueme
PersonWORK
S_FOR
WORKS_FOR
Skill
HAS_SKILL HAS_SKILL
Person
1. Graph pattern
2. Filter, using index if available
3.Create projection of result
![Page 81: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/81.jpg)
FirstMatch
80
name:Neo4j
name:Ian
name:ACME
Person
Company
WO
RKS_
FOR
HAS_
SKILL
name:Jacob
Person
name:Tobias
Person
WORKS_F
OR WORKS_FOR
name:Scala
name:Python
name:C#
SkillSkillSkillSkill
HAS_
SKILL
HAS_SKILLHAS_SKILL HAS_SKILL
HAS_SKILLHAS_
SKILL
skill
company
Company
colleagueme
Person
WORKS_
FOR WORKS_FOR
SkillHAS_SKILL
HAS_
SKILL
Person
![Page 82: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/82.jpg)
SecondMatch
81
name:Neo4j
name:Ian
name:ACME
Person
Company
WO
RKS_
FOR
HAS_
SKILL
name:Jacob
Person
name:Tobias
Person
WORKS_F
OR WORKS_FOR
name:Scala
name:Python
name:C#
SkillSkillSkillSkill
HAS_
SKILL
HAS_SKILLHAS_SKILL HAS_SKILL
HAS_SKILLHAS_
SKILL
skill
company
Company
colleagueme
Person
WORKS_
FOR WORKS_FOR
SkillHAS_SKILL
HAS_
SKILL
Person
![Page 83: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/83.jpg)
ThirdMatch
82
name:Neo4j
name:Ian
name:ACME
Person
Company
WO
RKS_
FOR
HAS_
SKILL
name:Jacob
Person
name:Tobias
Person
WORKS_F
OR WORKS_FOR
name:Scala
name:Python
name:C#
SkillSkillSkillSkill
HAS_
SKILL
HAS_SKILLHAS_SKILL HAS_SKILL
HAS_SKILLHAS_
SKILL
skill
company
Company
colleagueme
Person
WORKS_
FOR WORKS_FOR
SkillHAS_SKILL
HAS_
SKILL
Person
![Page 84: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/84.jpg)
ResultoftheQuery
+-------------------------------------+ | name | score | skills | +-------------------------------------+ | "Ian" | 2 | ["Scala","Neo4j"] | | "Jacob" | 1 | ["Neo4j"] | +-------------------------------------+ 2 rows
83
![Page 85: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/85.jpg)
Modelingexercise:Moviegenres
![Page 86: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/86.jpg)
Thequestion:shouldwemodelthemaspropertiesorasnodes?
Addingmoviegenres
vs
![Page 87: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/87.jpg)
MATCH(m:Movietitle:'TheMatrix')SETm.genre=['Action','Sci-Fi']RETURNm
Genresasproperties
![Page 88: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/88.jpg)
MATCH(m:Movietitle:'MysticRiver')SETm.genre=['Action','Mystery']RETURNm
Genresasproperties
![Page 89: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/89.jpg)
Accessingamovie’sgenresisquickandeasy.
MATCH(m:Movietitle:"TheMatrix")RETURNm.genre;
Thegoodsideofproperties
![Page 90: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/90.jpg)
FindingmoviesthatsharegenresispainfulandwehaveadisconnectedpatternintheMATCHclause-asuresignyouhaveamodelingissue.
MATCH(m1:Movie),(m2:Movie)WHEREany(xINm1.genreWHERExINm2.genre)ANDm1<>m2RETURNm1,m2;
Thebadsideofproperties
![Page 91: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/91.jpg)
MATCH(m:Movietitle:"TheMatrix")MERGE(action:Genrename:"Action")MERGE(scifi:Genrename:"Sci-Fi")MERGE(m)-[:IN_GENRE]->(action)MERGE(m)-[:IN_GENRE]->(scifi)
Genresasnodes
![Page 92: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/92.jpg)
MATCH(m:Movietitle:"MysticRiver")MERGE(action:Genrename:"Action")MERGE(mystery:Genrename:"Mystery")MERGE(m)-[:IN_GENRE]->(action)MERGE(m)-[:IN_GENRE]->(mystery)
Genresasnodes
![Page 93: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/93.jpg)
Findingmoviesthatsharegenresisanaturalgraphpattern.
MATCH(m1:Movie)-[:IN_GENRE]->(g:Genre),(m2:Movie)-[:IN_GENRE]->(g)RETURNm1,m2,g
Thegoodsideofnodes
![Page 94: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/94.jpg)
Accessingthegenresofmoviesrequiresabitmoretyping.
MATCH(m:Movietitle:"TheMatrix"),(m)-[:IN_GENRE]->(g:Genre)RETURNg.name;
The(nottoo)badsideofnodes
![Page 95: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/95.jpg)
GenericvsSpecificRelationshiptypes
![Page 96: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/96.jpg)
RelationshipGranularity
![Page 97: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/97.jpg)
SymmetricRelationships
![Page 98: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/98.jpg)
Symmetricrelationships
OR
![Page 99: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/99.jpg)
BidirectionalRelationships
![Page 100: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/100.jpg)
Usesinglerelationshipandignoredirectioninqueries
MATCH(:Personname:'Eric')-[:MARRIED_TO]-(p2)RETURNp2
![Page 101: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/101.jpg)
openCypher
thestandardgraphquerylanguage
100
![Page 102: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/102.jpg)
BecominganindustrystandardforGraphQuerying
• CypheroriginallydesignedbyNeo4j
• Implementedandsupportedby• SAPHANA• Redis• BitnineAgensGraph• Gradoop
• Moresystemscoming• Spark
101
![Page 103: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/103.jpg)
openCypher
• Openlanguagedesignprocess
• Implementationsformultiplesystems
• Compatibilitytestsuite
• Grammarspecification
• Referenceimplementation
• DefiningthenextversionofCypher
https://github.com/openCypher/openCypher http://opencypher.org
102
6/20/2016 https://s3.amazonaws.com/artifacts.opencypher.org/railroad/Cypher.svg
https://s3.amazonaws.com/artifacts.opencypher.org/railroad/Cypher.svg 1/1
QueryOptions CREATE Index
DROP Index
CREATE UniqueConstraint
DROP UniqueConstraint
CREATE NodePropertyExistenceConstraint
DROP NodePropertyExistenceConstraint
CREATE RelationshipPropertyExistenceConstraint
DROP RelationshipPropertyExistenceConstraint
LoadCSV
Start
Match
Unwind
Merge
Create
Set
Delete
Remove
Foreach
With
Return
ALL UNION
BulkImportQuery
;
![Page 104: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/104.jpg)
Formalsemantics
• NadimeFrancis,PaoloGuagliardo,LeonidLibkin
• Formallydefinesa(large)coreofCypher
103
![Page 105: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/105.jpg)
Futureimprovements
![Page 106: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/106.jpg)
RegularPathQueries
• Conjunctivebi-directionalRegularPathQuerieswithData• Plusspecificationofacostfunctionforpaths,whichallowsformoreinterestingnotionsofshortestpath
PATH PATTERN coauth=()-[:WROTE]->(b)<-[:WROTE]-(), (b)<-[sale:SELLS]-() COST min(sale.price)
MATCH (a)-/~coauth* COST x/->(b)ORDER BY x LIMIT 10105
![Page 107: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/107.jpg)
Furtherimprovements
• Supportforqueryingfrommultiplegraphs• Supportforreturninggraphs• Supportfordefiningviews
• IntegrationwithSQL
106
![Page 108: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/108.jpg)
RelationaltoGraph
![Page 109: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/109.jpg)
Relationalissimple...untilitgetscomplicated...
RelationaltoGraph
!108
table1 table2join-table
![Page 110: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/110.jpg)
Youknowrelational...nowconsiderrelationships...
RelationaltoGraph
!109
actors moviesactor_movie
![Page 111: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/111.jpg)
• Entity-TablesbecomeNodes
• ForeignKeysbecomeRelationships
• LinkTablesbecomeRelationships
• RemoveartificialPrimaryKeysandForeignKeys
NormalizedRelationalModeltoGraphModel
![Page 112: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/112.jpg)
• Cannotmodelorstoredataandrelationshipswithoutcomplexity
• Performancedegradeswithnumberandlevelsofrelationships,anddatabasesize
• QuerycomplexitygrowswithneedforJOINs
• Addingnewtypesofdataandrelationshipsrequiresschemaredesign,increasingtimetomarket
RDBMScan’thandlerelationshipswell
![Page 113: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/113.jpg)
ExpressComplexQueriesEasilywithCypher
Findallmanagersandhowmanypeopletheymanage,upto3levelsdown.
MATCH(boss)-[:MANAGES*0..3]->(mgr)WHEREboss.name="JohnDoe"AND(mgr)-[:MANAGES]->()RETURNmgr.nameASManager,size((mgr)-[:MANAGES*1..3]->())ASTotal
Cypher SQL
![Page 114: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/114.jpg)
• Modelyourdatanaturallyasagraphofdataandrelationships• Drivegraphmodelfromdomainanduse-cases
• Userelationshipinformationinreal-timetotransformyourbusiness• Addnewrelationshipsontheflytoadapttoyourchangingrequirements
UnlockingValuefromYourDataRelationships
![Page 115: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/115.jpg)
• Relationshipsarefirstclasscitizen
• Noneedforjoins,justfollowpre-materializedrelationshipsofnodes
• Query&Data-locality–navigateoutfromyourstartingpoints
• Onlyloadwhat’sneeded
• Aggregateandprojectresultsasyougo• Optimizeddiskandmemorymodelforgraphs
HighQueryPerformancewithaNativeGraphDB
![Page 116: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/116.jpg)
Theperformanceadvantageofmaterialisedrelationships
• asamplesocialgraphwith~1,000persons
• average50friendsperperson
• pathExists(a,b)limitedtodepth4
• cacheswarmeduptoeliminatediskI/O
#persons querytime
Relationaldatabase 1,000 2000ms
Neo4j 1,000 2ms
Neo4j 1,000,000 2ms
![Page 117: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/117.jpg)
NativeGraphs
116
![Page 118: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/118.jpg)
Neo4jpreservesrelationships
• Therelationshipsinyourmodelexistasfirst-classentitiesinthedatabase
• First-classentitiesinmemory
• First-classentitiesondisk
117
![Page 119: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/119.jpg)
Index-freeadjacency
Neo4j• Index→Node[O(logN)]
• Node→Properties[O(1)]• Node→Edges(bytype)[O(1)]thisincludesdegreeinformation
• Edgesbytype→Edges[O(1)]
• Edge→Properties[O(1)]• Edge→source/targetNode[O(1)]
118
RelationalDatabases• Everythingisanindex
• (sometimesatablescan)
• typicallyO(logn)• (sometimeshash:O(1))• Stillindirectionthroughindex
![Page 120: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/120.jpg)
Graphsatscale
119
![Page 121: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/121.jpg)
Queriesscalewithdatasetsize
• Index-freeadjacencymeansqueryexecutiontimeneverdependsontotaldatasize
• Queryexecutiononlydependonthenumberofedgesactuallyrelatedtothenodesactuallyfound
• Expectedexecutiontimebasedonaveragedegree
120
![Page 122: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/122.jpg)
Graphsscaleupeasierthanscalingout
• Neo4jtriviallyhandlesseveralbillionnodesandedgesinasinglegraph
• RAMsizethemainfactorforperformance
• BigRAMisnotexpensive• TerabyteRAMisreadilyavailable(evenonAWS)
• RAMsizegrowingfasterthandatasetsizes
121
![Page 123: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/123.jpg)
Neo4jscalesoutqueries
• Replicatedcluster
• Faulttolerance
• Queryprocessingcapacityscaleout
122
![Page 124: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/124.jpg)
Neo4jscalesinreality
• Realcustomers,suchasAlbumprinterhavegraphsinproduction thatarelargerthan• 1billionnodes• 2.5billionedges
• Othercustomershavehad>90%ofthesocialgraphofFacebookreplicatedinNeo4j(beforeFacebookrestrictedtheirdatausepolicies)
123
![Page 125: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/125.jpg)
LearnmoreaboutNeo4j
![Page 126: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/126.jpg)
1. DownloadNeo4j:http://neo4j.com/download/
2. Starttheserver.
3. Itshouldberunningon:http://localhost:7474
4. Log-inwithdefaultcredentialsuser:neo4j password:neo4j
5. Chooseanewpassword
We’regoodtogo!
GettingstartedwithNeo4j
![Page 127: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/127.jpg)
• :playintro-tolearntheNeo4jqueryinterface
• :playmovies-simpleexamplesonasimpledataset
• :playnorthwind-graph-theclassicnorthwindexampleasagraph• :playhttp://guides.neo4j.com/fundamentals/cypher_the_basics.html introductiontoCypher
• :playhttp://guides.neo4j.com/modeling_airportsatutorialongraphdatamodeling
• :playhttp://guides.neo4j.com/reco/fileatutorialonhowtouseNeo4jforrecommendations
TutorialsforlearningNeo4j
126
![Page 128: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/128.jpg)
DeveloperPages
neo4j.com/developer
• IntrotoGraphs
• RDBMStoGraphs
• DataImport&DataModeling
• LanguageGuides&Drivers• Visualization• Neo4jEcosystem
![Page 129: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/129.jpg)
GraphAcademy
neo4j.com/graphacademy
• Online&ClassroomTraining
• UniversityProgram
• Certification
• Webinars• GraphDays,GraphTalks
![Page 130: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/130.jpg)
neo4j.com/graphacademy/neo4j-certification/1hourcertificationexamcovers:
• Cypher
• DataModeling
• Clustering• andmore...
BecomeaNeo4jCertifiedProfessional
![Page 131: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/131.jpg)
neo4j.com/docs/cypher-refcard/current/
CypherReferenceCard
![Page 132: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/132.jpg)
neo4j.com/docs neo4j.com/docs/developer-manual/current neo4j.com/docs/operations-manual/current
DeveloperDocumentation
![Page 133: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/133.jpg)
neo4j.com/developer/kb• FrequentlyAskedQuestionsandAnswers
• CanonicalSource• MaintainedbyourSupportandFieldteam
• Tagged• Versionspecific
KnowledgeBase
![Page 137: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/137.jpg)
github.com/neo4j github.com/neo4j-contrib github.com/neo4j-examples
GitHub
![Page 138: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/138.jpg)
stackoverflow.com/questions/tagged/neo4j
StackOverflow
![Page 140: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/140.jpg)
• Haveaninterestingproject,use-case?• Wecanhelpyoupromoteitwitharticles,talks,webinars
• Wroteatool,library,connector?• We’dlovetomakeitknowninourcommunity
• Havequestionsaboutlicensing&pricing?• Reachoutwithyourquestions,wecanhelpclarify
• WanttoworkonNeo4j?• Wehavemanycooljobs,pleaseapply• Wealsohaveopenresearchtopics
• Emailme• [email protected]
Talktous
![Page 141: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/141.jpg)
Researchtopics
thatweareinterestedincollaboratingon
140
![Page 142: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/142.jpg)
GraphIndexes
• Topology-basedindexes• Pathindexes• Indexingofnodesbasedonrelatednodes
• Howtoensurecomplexindexesareconsistentwhenthedatachanges
• <yourideahere>• anythingthatcanbeusedtospeedupqueries
141
![Page 143: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/143.jpg)
GraphPartitioning
• Howtosplitagraphintomultiplepartitionsinordertohandlelargergraphs
• Automaticpartitioning
• Schema-guidedpartitioning
• <yourideahere>
142
![Page 144: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/144.jpg)
DistributedQueryExecution
• Dividingtheworkofonequeryovermultipleworkers
• Bothinapartitionedenvironment• andinareplicatedenvironment
143
![Page 145: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/145.jpg)
EfficientDataStructures
• Betterwaysofrepresentinggraphsandindexes
• Onpersistentstorage
• Inmemory/cache
144
![Page 146: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/146.jpg)
Semantic/Intentionallocking
• and/orotherwaysofensuringconsistentupdatesinaconcurrentsystem
• Bothwhenthedataispartitioned,• andwhenthedataisreplicated,• aswellasonasinglemachinewithmanythreads
145
![Page 147: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/147.jpg)
GraphMetricsandStatistics
• thatwecancomputeandmaintainuptodatewhilethegraphisbeingupdatedwithlowcostoverhead
• thatcaneitherbeusedtodirectlyansweruserqueries
• ortobetteroptimisequeries
146
![Page 148: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/148.jpg)
Queryoptimisation
• moreefficientwaystoevaluatequeries
• betteralgorithmsforfindingan“optimal”plan
147
![Page 149: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/149.jpg)
GraphQueryLanguages
• EvolutionofCypher• Newwaysofqueryinggraphs
• Languagesandmodelsforexpressingalgorithmsongraphs
• <yourideahere>• anythingthatmakepeoplemoresuccessfulandefficientinmakingsenseofdata
148
![Page 150: Introduction to Graph Data Management...Introduction to Graph Data Management with neo4j Tobias .Lindaaker@neo4j.com @thobe #neo4j 1 Why graphs? The world is a graph – everything](https://reader030.vdocuments.mx/reader030/viewer/2022040410/5ec9ff92d5ccf4161b739bca/html5/thumbnails/150.jpg)
FaultTolerance
• Resilientfaulttolerantsystems
• withaslowoverheadaspossible
149