Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Do I need a Graph Database?
Juan F. Sequeda, Ph.D
Co-Foun...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
• Last	
  year,	
  a	
  talk	
  at	
  Data	
  Day
– Clien...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
What	
  type	
  of	
  graphs	
  are	
  we	
  talking	
  a...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Property	
  Graphs	
  vs	
  RDF	
  Graphs
4
:Bob :Alice
f...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexible
9
:US_Constitution_1992/
section/123
“Excessive	...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Data	
  and	
  Metadata	
  are	
  One
10
:US_Constitution...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility	
  in	
  RDBMS
11
id attr1 attr2 attr3 attr4 ...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Query	
  Federation
VirtualizeRelational	
  Data	
  as	
 ...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Graphs	
  are	
  a	
  Common	
  denominator	
  
14
<const...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Integration
15
:US_Constitution_1992/
section/123
“Excess...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Integrate	
  Data	
  using	
  Graphs
16
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Query	
  Federation
Virtually Integrate	
  Data	
  using	...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Semantics
19
:US_Constitution_1992/
section/123
“Excessiv...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
:Bob :Alice
foaf:knows
“Bob	
  
Smith”
foaf:name
“Alice	
...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
id1 id2
knowskey value
name Bob	
  
Smith
key value
name ...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Traversal,	
  Navigation,	
  Reachability
24
:US_Constitu...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
• Gruff
• Linkurious
• D3
• Tom	
  Sawyer
• Keylines
• …
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Flexibility
Data	
  
Integration
Semantics Provenance
“Gr...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
Takeaway:	
  Tipping	
  Point
28
Relational	
  
Database
...
Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com
THANK	
  YOU
Juan	
  Sequeda,	
  Ph.D
Co-­‐Founder	
  – C...
Upcoming SlideShare
Loading in …5
×

Do I need a Graph Database?

1,409 views

Published on

Presentation at Data/Graph Day Texas Conference.
Austin, Texas
January 14, 2017

This talk grew out Juan Sequeda's office hours following the Seattle Graph Meetup. Some of the questions posed were: How do I recognize problem best solved with a graph solution? How do I determine the best type of graph to solve the problem? How do I manage the data where both graph and relational operations will be performed? Juan did such a great job of explaining the options, we asked him to develop his responses into a formal talk.

Published in: Software
  • Be the first to comment

Do I need a Graph Database?

  1. 1. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Do I need a Graph Database? Juan F. Sequeda, Ph.D Co-Founder Capsenta 1Data/Graph  Day  Texas  – January  14,  2017
  2. 2. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com • Last  year,  a  talk  at  Data  Day – Client  thought  they  had  a  graph  problem – Evaluated  graph  databases • Guess  what…   – queries  were  faster  in  Postgres • Did  they  really  have  a  graph  problem?  
  3. 3. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com What  type  of  graphs  are  we  talking  about? 3
  4. 4. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Property  Graphs  vs  RDF  Graphs 4 :Bob :Alice foaf:knows “Bob   Smith” foaf:name “Alice   Smith” foaf:name id1 id2 knowskey value name Bob   Smith key value name Alice Smith key value since 2005 :g1 2005 :since http://db-­‐engines.com/en/ranking/graph+dbms http://db-­‐engines.com/en/ranking/rdf+store • W3C  Standard • Based  on  Triples • Graph  Data  Model  for  the  Web  (URIs) • No  Standard  (Cypher,  Titan,   etc.) • Key/Values   on  Nodes  and  Edges
  5. 5. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data Warm   Data
  6. 6. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data Warm   Data Cold  Data • New   Project • New   Data • Should  I  use  a  Relational   DB  or  a  Graph  DB?
  7. 7. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data Warm   Data Warm  Data • Data  already  exists   • Applications  consuming   existing  data • Should  I  move  my  relational   data  to  a  Graph  DB? • Do  I  keep  two  copies   of  my  data  (relational   and  graph)?
  8. 8. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data Warm   Data Flexibility
  9. 9. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexible 9 :US_Constitution_1992/ section/123 “Excessive  bail   shall  not   be  required,   nor   excessive  fines  imposed,   nor  cruel   and  unusual   punishments   inflicted.” :text :US_Constitution_1992 “United   States  of  America   1789  (rev.  1992)” :text :isSectionOf :Cruelty :hasTopic “Prohibition   of  cruel   or  degrading   treatment” :label “inhumane   treatment” :keyword
  10. 10. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Data  and  Metadata  are  One 10 :US_Constitution_1992/ section/123 “Excessive  bail  shall  not  be   required,  nor  excessive   fines  imposed,  nor  cruel   and  unusual  punishments   inflicted.” :text :US_Constitution_1992 “United  States  of  America   1789  (rev.  1992)” :isSectionOf :Cruelty :hasTopic “Prohibition  of  cruel  or   degrading  treatment” :lab el “inhumane  treatment” :keyword :text :Section :Constitution:Topic :Rights _and_ Duties :Physical _Integrity _Rights :subClas s :subClas s :subClas s :hasTopic :isSectionOf :type :type
  11. 11. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility  in  RDBMS 11 id attr1 attr2 attr3 attr4 … attrn … id attribute value id attr1 val1 attr2 val2 attr3 val3 id value attr1 id value attr2 id value attr3 Copeland   and  Khoshafian.  A  decomposition   storage  model.  SIGMOD  1985 Agrawal  et  al.  Storage  and  Querying  of  E-­‐Commerce  Data.  VLDB  2001
  12. 12. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Query  Federation VirtualizeRelational  Data  as  (RDF)  Graphs 12 Virtualize  Relational   Databases  as  RDF   Graphs  using  R2RML Keep  your  legacy  data   in  the  RDBMS Run  graph  queries  over  the   virtual  graph  data Add  new  data  that   doesn’t  fit  into   the  schema  into  a   separate  graph Federate  queries  over   Virtualized  Graph  and   the  Real  Graph
  13. 13. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data -­‐ Graph  but depends   on   flexibility needs -­‐ RDF  vs   PG? -­‐ RDF  if   Metadata is  Key Warm   Data -­‐ Hybrid Relational/ RDF  but depends   on   flexibility needs -­‐ RDF+ R2RML Data  Integration
  14. 14. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Graphs  are  a  Common  denominator   14 <constitution id=“US_Constitution_1992”> <section id="US_Constitution_1992/section/123"> <text>Excessive bail shall ...</text> </section> <topic>Cruelty</topic> </constitution> “Excessive  bail   shall  not   be   required,   nor  excessive  fines   imposed,   nor  cruel and  unusual   punishments   inflicted.” id text topic 123 Excessive  bail   shall…   Cruelty :US_Constitution_1992/ section/123 “Excessive  bail  shall  not  be   required,  nor  excessive   fines  imposed,  nor  cruel   and  unusual  punishments   inflicted.” :text :Cruelty :hasTopic XML Text Tabular
  15. 15. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Integration 15 :US_Constitution_1992/ section/123 “Excessive  bail  shall  not  be   required,  nor  excessive   fines  imposed,  nor  cruel   and  unusual  punishments   inflicted.” :text :US_Constitution_1992 “United  States  of  America   1789  (rev.  1992)” :isSectionOf :Cruelty :hasTopic “Prohibition  of  cruel  or   degrading  treatment” :label “inhumane  treatment” :keyword :text :EighthAmendment_US Constitution :Farmer_vs_Brennan :lawsApplied “A  prison  official’s   ‘deliberate  indifference’  to   a  substantial  risk  of  a   serious  harm  to  an  inmate     violates  the  Eighth   Amendment” :holding :sameAs :Prisons_in _Indiana :LGBT_right _case_laws :subject :subject
  16. 16. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Integrate  Data  using  Graphs 16
  17. 17. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Query  Federation Virtually Integrate  Data  using  Graphs 17
  18. 18. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data -­‐ Graph  but depends   on   flexibility needs -­‐ RDF  vs   PG? -­‐ RDF  if   Metadata is  Key -­‐ RDF   Graphs   because   of  URIs!   -­‐ SPARQL has   federation Warm   Data -­‐ Hybrid Relational/ RDF  but depends   on   flexibility needs -­‐ RDF+ R2RML -­‐ Virtualize RDBMS  as  RDF   Semantics
  19. 19. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Semantics 19 :US_Constitution_1992/ section/123 “Excessive  bail  shall  not  be   required,  nor  excessive   fines  imposed,  nor  cruel   and  unusual  punishments   inflicted.” :text :Cruelty :hasTopi c “Prohibition  of  cruel  or   degrading  treatment” :lab el “inhumane  treatment” :keyword :Physical _Integrity _Rights :subClas s :hasTopic
  20. 20. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data -­‐ Graph  but depends   on   flexibility needs -­‐ RDF  vs   PG? -­‐ RDF  if   Metadata is  Key -­‐ RDF   Graphs   because   of  URIs!   -­‐ SPARQL has   federation -­‐ RDF  supports   inference  with   OWL  ontologies Warm   Data -­‐ Hybrid Relational/ RDF  but depends   on   flexibility needs -­‐ RDF+ R2RML -­‐ Virtualize RDBMS  as  RDF   -­‐ Limited inference   available  over   Virtual   Relational  RDF   graphs Provenance
  21. 21. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com :Bob :Alice foaf:knows “Bob   Smith” foaf:name “Alice   Smith” foaf:name id1 id2 knowskey value name Bob   Smith key value name Alice Smith Bob  Smith  knows  Alice  Smith :Bob :Alice foaf:knows “Bob   Smith” foaf:name “Alice   Smith” foaf:name id1 id2 knowskey value name Bob   Smith key value name Alice Smith key value since 2005 :g1 2005 :since Bob  Smith  knows  Alice  Smith  since  2005 :Bob :Alice foaf:knows “Bob   Smith” foaf:name “Alice   Smith” foaf:name :s1 2005 :since :Bob :Alice knowsSince2005 “Bob   Smith” foaf:name “Alice   Smith” foaf:name foaf:knows subProperty
  22. 22. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com id1 id2 knowskey value name Bob   Smith key value name Alice Smith key value since 2005 Juan  said  in  2017:  Bob  Smith  knows  Alice  Smith  since  2005 :Bob :Alice foaf:knows “Bob   Smith” foaf:name “Alice   Smith” foaf:name :s1 2005 :since :Juan :Event1 :actorInvovled :stated 2017 :createdEvent1 key value creat ed 2017 id3 key value name Juan id1 key value Prop knows International  Semantic  Web  Conference  2016
  23. 23. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data -­‐ Graph  but depends   on   flexibility needs -­‐ RDF  vs   PG? -­‐ RDF  if   Metadata is  Key -­‐ RDF   Graphs   because   of  URIs!   -­‐ SPARQL has   federation -­‐ RDF  supports   inference  with   OWL  ontologies -­‐ PG  if   statements   on  edges -­‐ Otherwise   RDF  vs  PG   vs  RDB? Warm   Data -­‐ Hybrid Relational/ RDF  but depends   on   flexibility needs -­‐ RDF+ R2RML -­‐ Virtualize RDBMS  as  RDF   -­‐ Limited inference   available  over   Virtual   Relational  RDF   graphs -­‐ Hybrid Relational/ RDF “Graphy”  Queries
  24. 24. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Traversal,  Navigation,  Reachability 24 :US_Constitution_1992/ section/123 “Excessive  bail  shall  not  be   required,  nor  excessive   fines  imposed,  nor  cruel   and  unusual  punishments   inflicted.” :text :US_Constitution_1992 “United  States  of  America   1789  (rev.  1992)” :isSectionOf :Cruelty :hasTopic “Prohibition  of  cruel  or   degrading  treatment” :lab el “inhumane  treatment” :keyword :text :EighthAmendment_US Constitution :Farmer_vs_Brennan :lawsApplie d “A  prison  official’s   ‘deliberate  indifference’  to   a  substantial  risk  of  a   serious  harm  to  an  inmate     violates  the  Eighth   Amendment” :holding :sameAs :Prisons_in _Indiana :LGBT_right _case_laws :subject :subject • Conjunctive  Query  (CQ) • Regular  Path  Queries  (RPQ) • regular  expression  over  edge  labels • Conjunctive  Regular  Path  Query  (CRPQ) • Union  Conjunctive  Regular  Path  Query  (UCRPQ) • Shortest  Path • Page  Rank • Graph  Algorithms  …   https://github.com/graphMark/gmark Bagan et  al.  gMark:  Schema-­‐Driven   Generation   of  Graphs  and  Queries.   Journal Transactions  on  Knowledge  and  Data  Engineering.  2017
  25. 25. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data -­‐ Graph  but depends   on   flexibility needs -­‐ RDF  vs   PG? -­‐ RDF  if   Metadata is  Key -­‐ RDF   Graphs   because   of  URIs!   -­‐ SPARQL has   federation -­‐ RDF  supports   inference  with   OWL  ontologies -­‐ PG  if   statements   on  edges -­‐ Otherwise   RDF  vs  PG   vs  RDB? -­‐ RDF and  PG   both  support   Warm   Data -­‐ Hybrid Relational/ RDF  but depends   on   flexibility needs -­‐ RDF+ R2RML -­‐ Virtualize RDBMS  as  RDF   -­‐ Limited inference   available  over   Virtual   Relational  RDF   graphs -­‐ Hybrid Relational/ RDF -­‐ Virtualize RDBMS  as   RDF  and   use   recursion   (?) -­‐ Move  to   Graph  (?) Graph  Visualizations
  26. 26. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com • Gruff • Linkurious • D3 • Tom  Sawyer • Keylines • …
  27. 27. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Flexibility Data   Integration Semantics Provenance “Graphy” Queries Graph Visualization Cold   Data -­‐ Graph  but depends   on   flexibility needs -­‐ RDF  vs   PG? -­‐ RDF  if   Metadata is  Key -­‐ RDF   Graphs   because   of  URIs!   -­‐ SPARQL has   federation -­‐ RDF  supports   inference  with   OWL  ontologies -­‐ PG  if   statements   on  edges  is   sufficient -­‐ Otherwise   RDF  vs  PG   vs  RDB? -­‐ RDF and  PG   both  support   -­‐ PG  seem  to   have  more   Graph  Viz tooling -­‐ RDF is  not   that  behind   though Warm   Data -­‐ Hybrid Relational/ RDF  but depends   on   flexibility needs -­‐ RDF+ R2RML -­‐ Virtualize RDBMS  as  RDF   -­‐ Limited inference   available  over   Virtual   Relational  RDF   graphs -­‐ Hybrid Relational/ RDF -­‐ Virtualize RDBMS  as   RDF  and   use   recursion   (?) -­‐ Move  to   Graph  (?) -­‐ Virtualize RDBMS  as   RDF  and   use  Viz tools  (?) -­‐ Move  to   Graph  (?) Conclusion
  28. 28. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com Takeaway:  Tipping  Point 28 Relational   Database Graphs • Flexible • Data  Integration • Semantics • Provenance • “Graphy”  Queries • Graph  Visualizations Be  skeptical! Ask  Why? Do  you  really  need  another  database?  
  29. 29. Smart Data for Smarter Business | © 2016 Capsenta | capsenta.com THANK  YOU Juan  Sequeda,  Ph.D Co-­‐Founder  – Capsenta juan@capsenta.com @juansequeda 29 Sequeda  J.  Integrating  Relational  Databases  with  the  Semantic  Web.  IOS  Press.  2016 http://www.iospress.nl/book/integrating-­‐relational-­‐databases-­‐with-­‐the-­‐semantic-­‐web/

×