Graph ¡Data ¡Management ¡Systems ¡ for ¡New ¡Applica9on ¡Domains: ¡ Social ¡Networks ¡& ¡the ¡Web ¡of ¡Data ¡ Philippe ¡Cudré-‑Mauroux ¡ Sameh ¡Elnikety ¡ University ¡of ¡Fribourg ¡ MicrosoF ¡Research ¡ Switzerland ¡ USA ¡ Tutorial ¡at ¡VLDB ¡2011 ¡
Welcome ¡to ¡Graphs ¡ Friendship ¡Network ¡ ¡ ¡ Internet ¡Map ¡ [Moody’01] ¡ ¡ ¡ [lumeta.com] ¡ Protein ¡Interac9ons ¡ ¡ ¡ Food ¡Web ¡ [genomebiology.com] ¡ ¡ ¡ [foodwebs.org] ¡ 2 ¡
Graphs: ¡Small ¡and ¡Large ¡ • Small ¡graphs ¡ – Manage ¡a ¡collecQon ¡of ¡small ¡graphs ¡ – BioinformaQcs ¡and ¡cheminformaQcs ¡ – Well ¡studied ¡ • Large ¡graphs ¡ – One ¡large ¡graph, ¡aka ¡“network” ¡ – Social ¡network, ¡and ¡knowledge ¡representaQon ¡ ¡ – Less ¡studied ¡ 3 ¡
Classes ¡of ¡Large ¡Graphs ¡ • Random ¡graphs ¡ – Node ¡degree ¡is ¡constrained ¡ – Less ¡common ¡ • Scale-‑free ¡graphs ¡ – DistribuQon ¡of ¡node ¡degree ¡follows ¡power ¡law ¡ – Most ¡large ¡graphs ¡are ¡scale-‑free ¡ – Small ¡world ¡phenomena ¡& ¡hubs ¡ – Harder ¡to ¡parQQon ¡ 4 ¡
Classes ¡of ¡Large ¡Graphs ¡ 5 ¡
Organic ¡Growth ¡-‑> ¡Scale ¡Free ¡ 6 ¡
Examples ¡of ¡Organic ¡Growth ¡ 7 ¡
GeneraQng ¡a ¡Large ¡Graph ¡ • Random ¡graph ¡ – Fix ¡the ¡number ¡of ¡nodes ¡(no ¡growth) ¡ – Each ¡edge ¡connects ¡two ¡random ¡nodes ¡ • Scale-‑free ¡graph ¡ – Copy ¡model ¡ • Add ¡new ¡node ¡ ¡ – Take ¡percentage ¡of ¡links ¡from ¡another ¡node ¡ – Kronecker ¡graphs ¡ 8 ¡
Kronecker ¡Graph ¡Example ¡ • Epinions ¡(N=76K, ¡E=510K) ¡ • Fifng ¡Qme ¡= ¡2 ¡hours ¡ • Real ¡and ¡Kronecker ¡graphs ¡are ¡close ¡ 9 ¡
Let’s ¡Go ¡Hyper! ¡ • Hyper-‑edge ¡ – A ¡tradiQonal ¡edge ¡is ¡binary ¡ – A ¡hyper ¡edge ¡relates ¡ n ¡nodes ¡ • Order ¡can ¡be ¡important ¡ • Child-‑of ¡edge ¡versus ¡father, ¡mother, ¡child ¡hyper-‑edge ¡ • Hyper-‑node ¡ – A ¡tradiQonal ¡node ¡represents ¡one ¡enQty ¡ – Hyper ¡node ¡represents ¡a ¡set ¡of ¡nodes ¡ • Person ¡node ¡versus ¡family ¡hyper-‑node ¡ 10 ¡
Roadmap ¡ • Intro ¡to ¡Graphs ¡ • Social ¡Networks ¡ – Data ¡Model ¡ – Queries ¡ – Processing ¡ • Web ¡of ¡Data ¡ – Data ¡Model ¡ – Queries ¡ – Processing ¡ • Systems ¡ • Current ¡Research ¡DirecQons ¡ 11 ¡
Social ¡Networks ¡ • Scale ¡ – LinkedIn ¡ • 70 ¡million ¡users ¡ Bob Bob Alice Alice – Facebook ¡ Photo1 • 500 ¡million ¡users ¡ Photo7 • 65 ¡billion ¡photos ¡ Photo8 Photo2 • Queries ¡ Chris Chris David David – Alice’s ¡friends ¡ Hillary Hillary – Photos ¡with ¡friends ¡ Photo3 • Rich ¡graph ¡ Ed Ed France France George George – Types, ¡alributes ¡ Photo4 Photo5 Photo6 12 ¡
Social ¡Networks: ¡Data ¡Model ¡ • Node ¡ Bob Bob Alice Alice Photo1 – ID, ¡type, ¡alributes ¡ Photo7 • Edge ¡ Photo8 Photo2 Chris Chris David David – Connects ¡two ¡nodes ¡ Hillary Hillary Photo3 – DirecQon, ¡type, ¡alributes ¡ Ed Ed France France George George ¡ ¡ App ¡ Manages Photo4 Alice Bob Photo5 Photo6 ¡ ¡ ¡ Manages System ¡ Alice Bob Managed-‑by 13 ¡
Managing ¡Graph ¡Data ¡ • Here ¡we ¡focus ¡on ¡online ¡access ¡ – Rather ¡than ¡offline ¡access ¡ ¡ • Network ¡analyQcs ¡and ¡graph ¡mining ¡ • Queries ¡ – Read ¡ • Updates ¡ – Data ¡update: ¡change ¡node ¡payload ¡ – Structural ¡update: ¡modify ¡nodes ¡and ¡edges ¡ 14 ¡
Updates: ¡API ¡ • add-‑node(node-‑id, ¡payload) ¡ • remove-‑node(node-‑id) ¡ • update-‑node(node-‑id, ¡payload) ¡ • add-‑edge(s-‑node-‑id, ¡d-‑node-‑id) ¡ • remove-‑edge(s-‑node-‑id, ¡d-‑node-‑id) ¡ 15 ¡
Graph ¡Query ¡Languages ¡ • Several ¡languages ¡ • Trade-‑off ¡ – Expressiveness ¡ – ExecuQon ¡ • Regular ¡language ¡reachability ¡ – Used ¡in ¡Horton ¡ SQL ¡ RL ¡ 16 ¡
Regular ¡Language ¡ • Query ¡is ¡a ¡regular ¡expression ¡ – Sequence ¡of ¡node ¡and ¡edge ¡predicates ¡ • Example ¡ – Find ¡Alice’s ¡photos ¡ – Photo, ¡tags, ¡Alice ¡ – Query ¡= ¡ ¡ • Node: ¡type=photo, ¡ ¡ • Edge: ¡ ¡type=tags, ¡ ¡ • Node: ¡type=person, ¡name ¡= ¡Alice ¡ – Result: ¡matching ¡paths ¡ 17 ¡
Query ¡Language ¡Operators ¡ • ProjecQon ¡ – Alice’s ¡photos ¡ – SELECT ¡photo ¡FROM ¡photo, ¡tags, ¡Alice ¡ • OR ¡ – (Photo ¡| ¡video), ¡tags, ¡Alice ¡ • Kleene ¡star ¡ – Alice’s ¡org ¡chart ¡ – Alice, ¡(manages, ¡person)* ¡ 18 ¡
Example: ¡CodeBook ¡-‑ ¡Graph ¡ 19 ¡
Example: ¡CodeBook ¡-‑ ¡Queries ¡ 1. Person , ¡FileOwner>, ¡ File , ¡FileOwner<, ¡ Person ¡ ¡ 2. Person , ¡DiscussionOwner>, ¡ Discussion , ¡DiscussionOwner<, ¡ Person ¡ ¡ 3. Person , ¡WorkItemOwner>, ¡ WorkItem , ¡WorkItemOwner< ¡, ¡ Person ¡ ¡ 4. Person , ¡Manages<, ¡ Person , ¡Manages>, ¡ Person ¡ ¡ 5. Person , ¡WorkItemOwner>, ¡ WorkItem , ¡MenQons>, ¡ File , ¡FileOwner<, ¡ Person ¡ ¡ 6. Person , ¡FileOwner>, ¡ File , ¡MenQons>, ¡ WorkItem , ¡MenQons>, ¡ File , ¡FileOwner<, ¡ Person ¡ • Who ¡are ¡my ¡colleagues? ¡ • Who ¡is ¡calling ¡my ¡code? ¡ • Who ¡introduced ¡a ¡bug ¡in ¡my ¡code? ¡ 20 ¡
Example ¡ExecuQon ¡Engine ¡ • ExecuQng ¡RL ¡query ¡ 1. Build ¡a ¡FSM ¡ 2. OpQmize ¡FSM ¡ 3. Execute ¡FSM ¡using ¡distributed ¡graph ¡traversal ¡ ¡ 21 ¡
Centralized ¡Query ¡ExecuQon ¡ Alice ¡ Tags ¡ Photo ¡ Alice , ¡Tags, ¡ Photo ¡ Traversal ¡ similar ¡ to ¡ Breadth ¡ Bob Alice First ¡ Photo1 Photo7 Photo8 Photo2 Chris David Hillary Answer ¡Paths: ¡ Photo3 Alice , ¡Tags, ¡ Photo1 ¡ Alice , ¡Tags, ¡ Photo8 ¡ Ed France George Photo4 Photo5 Photo6 22 ¡
Distributed ¡Query ¡ExecuQon ¡ Alice , ¡Tags, ¡ Photo , ¡Tags, ¡ Hillary ¡ Par99on ¡1 ¡ Bob Alice Photo1 Photo7 Photo8 Photo2 Chris David Hillary Photo3 Ed France George Photo4 Photo5 Photo6 Par99on ¡2 ¡ 23 ¡
Distributed ¡Query ¡ExecuQon ¡ Alice , ¡Tags, ¡ Photo , ¡Tags, ¡ Hillary ¡ FSM ¡ Par99on ¡1 ¡ Par99on ¡2 ¡ Par99on ¡1 ¡ Step ¡1 ¡ Alice ¡ Bob Alice Alice ¡ Photo1 Photo7 Tags ¡ Photo8 Photo2 Chris David Step ¡2 ¡ Hillary Photo ¡ Photo1 ¡ Photo8 ¡ Photo3 Ed France George Tags ¡ Photo4 Step ¡3 ¡ Photo5 Photo6 Hillary ¡ Hillary ¡ Par99on ¡2 ¡ 24 ¡
Sub-‑graph ¡Matching ¡ – From: ¡ path ¡ Tags Photo Alice – Sequence ¡of ¡predicates ¡ Tags Friend Photo Alice Bob – To: ¡sub-‑graph ¡ – Graph ¡palern ¡ Tags Photo Alice ¡ T Lives-‑in F a r k i ¡ e e n n -‑ d i n Tags ¡ ¡ ¡ ¡ ¡ ¡ ¡. – Sub-‑graph ¡isomorphism ¡ Lives-‑in City Bob 25 ¡
Mappings ¡Are ¡Not ¡Rigid ¡ • Example ¡ – Edge ¡are ¡enQQes ¡ • Types, ¡alributes, ¡ids ¡ – SupporQng ¡edge ¡enQQes ¡ – SupporQng ¡hyper-‑nodes ¡and ¡hyper-‑edges ¡ Manages Alice Bob Alice Manages Bob 26 ¡
Roadmap ¡ • Intro ¡to ¡Graphs ¡ • Social ¡Networks ¡ – Data ¡Model ¡ – Queries ¡ – Processing ¡ • Web ¡of ¡Data ¡[WoD] ¡ – Data ¡Model ¡ – Queries ¡ – Processing ¡ • Systems ¡ • Current ¡Research ¡DirecQons ¡ 27 ¡
Example: ¡Linked ¡open ¡Data[LoD] ¡ • Scale ¡ ¡ – Hundreds ¡of ¡data ¡sets ¡ – 30B+ ¡tuples ¡ • Queries ¡ – SPARQL ¡ • Domains ¡ 28 ¡ hlp://www4.wiwiss.fu-‑berlin.de/lodcloud/state/ ¡
Recommend
More recommend