thosp an algorithm for nesting property graphs
play

THoSP: an Algorithm for Nesting Property Graphs Giacomo Bergami 1 - PowerPoint PPT Presentation

THoSP: an Algorithm for Nesting Property Graphs Giacomo Bergami 1 Andr Petermann 2 Danilo Montesi 1 1 st Joint GRADES-NDA International Workshop, 2018 10th June 2018 Universit di Bologna 1 , Universitt Leipzig 2 Key Ideas Key Ideas


  1. THoSP: an Algorithm for Nesting Property Graphs Giacomo Bergami 1 André Petermann 2 Danilo Montesi 1 1 st Joint GRADES-NDA International Workshop, 2018 10th June 2018 Università di Bologna 1 , Universität Leipzig 2

  2. Key Ideas

  3. Key Ideas – Research Problem 1 An operator allowing to generalize the current “grouping” and “nesting” is missing. Nevertheless, current (G)DBMSs allow to express nesting operations, but their query languages’ plans do not allow to optimize the whole process by combining the following tasks: • path joins separately for both paterns. • grouping to create an id collection over the matched elements. 2 The general nesting algorithm could lead to an exponential evaluation time. 1/16

  4. Key Ideas – Use Case authorOf authorOf authorOf Paper ∗ Author src Author dst Author Paper ∗ Author src � = Author dst Edge Patern Vertex Patern 0 3 Author Paper AuthorOf name : Abigail 6 title : On Joining Graphs surname : Conner AuthorOf 7 2 4 Author Paper AuthorOf name : Cassie 8 title : Object Databases surname : Norman AuthorOf 9 1 5 Author Paper AuthorOf name : Baldwin 10 title : On Nesting Graphs surname : Oliver 2/16 Input Bibliography Network

  5. Key Ideas – Desired Result coauthorship coauthorship 0 2 1 Author Author Author name : Abigail name : Cassie name : Baldwin surname : Norman surname : Conner surname : Oliver ǫ ( 0 → 2 ) , ǫ ( 2 → 0 ) ǫ ( 0 → 1 ) , ǫ ( 1 → 0 ) ǫ ( 1 ) ǫ ( 0 ) ǫ ( 2 ) 3 5 4 Paper Paper Paper title : On Joining title : Object title : On Nesting Graphs Databases Graphs Expected result 3/16

  6. Key Ideas – Research Goals 1 As for graph joins, the data model must enhance the serialization of both operands and graph result. 4/16

  7. Key Ideas – Research Goals 1 As for graph joins, the data model must enhance the serialization of both operands and graph result. 2 The logical graph nesting operator must be general enough to support both the THoSP algorithm and other graph summarization tasks. 4/16

  8. Key Ideas – Research Goals 1 As for graph joins, the data model must enhance the serialization of both operands and graph result. 2 The logical graph nesting operator must be general enough to support both the THoSP algorithm and other graph summarization tasks. 3 Grouping can be avoided by defining a nesting index , through which the containment is associated to the container. This can be achieved by extending the Graph Join’s data structures with the aforementioned data structure. 4/16

  9. Logical Model

  10. Logical Model – Design (1) The nested (property) graph data model is an extension of the logical model for graph joins. Therefore, we want to preserve the same assumptions: The resulting nested graph is not a materialized view (as in SQL’s SELECT ). The nested graph is serialized by only using the ID information. Atribute, values and labels can be completely reconstructed from these informations and the patern rewriting information. 5/16

  11. Logical Model – Design (2) The following modelling choices allow the reconstruction of the required pieces of information: Vertices and edges are distinctly identified by ids ( N 2 ). A nested graph database is a property graph, where each vertex and edge may contain ( nest ) another property graph ( ν , ǫ ). Each vertex or edge within the graph can be considered as a possible graph operand. 6/16

  12. Logical Model – Definition Graph Nesting A nested graph database is a nested graph, where each vertex and edge may represent a graph. Given a nested graph G = ( V , E ) , a vertex patern g V , a edge patern g E vertex patern containing grouping references: � η keep ( G ) = { v ∈ V | g V ( v ) = ∅ , keep } ∪ ι ( g V ( G )) , ι � { e ∈ E | g E ( e ) = ∅ , keep } ∪ ι ( g E ( G )) where ι is an indexing function associating to each matched graph into one new single identifier not appearing in G , and keep is set to true whether the non-traversed vertices and edges must be preserved into the final graph. The newly generated nested graph is inserted into the graph database which also contains G . Values associated to both nested vertices and edges are determined by user defined functions. 7/16

  13. THoSP Algorithm

  14. THoSP Algorithm – Physical Model Motivations: 1 Reduce the number of graph visiting times by visiting the subpatern first, and then extending the visit to the remaining paterns. 2 Represent the nested graph as an adjacency list enriched with an external nesting index. The algorithm uses the same principles that were adopted for implementing graph joins: Use memory mapping (OS buffering). Serialized graphs represent vertices associated to both ingoing and outgoing edges. No additional indexing structures are exploited. 8/16

  15. THoSP Algorithm – Example 3 0 Paper Author AuthorOf title : On Joining name : Abigail 6 surname : Conner Graphs AuthorOf 4 2 7 Paper Author AuthorOf title : Object name : Cassie 8 surname : Norman Databases AuthorOf 5 1 9 Paper Author AuthorOf title : On Nesting name : Baldwin 10 surname : Oliver Graphs 9/16

  16. THoSP Algorithm – Example 3 0 Paper Author AuthorOf title : On Joining name : Abigail 6 surname : Conner Graphs AuthorOf 4 2 7 Paper Author AuthorOf title : Object name : Cassie 8 surname : Norman Databases AuthorOf 5 1 9 Paper Author AuthorOf title : On Nesting name : Baldwin 10 surname : Oliver Graphs 3 Paper title : On Joining Graphs 9/16

  17. THoSP Algorithm – Example 3 0 Paper Author AuthorOf title : On Joining name : Abigail 6 surname : Conner Graphs f r O o h u t A 4 2 7 Paper Author AuthorOf title : Object name : Cassie 8 surname : Norman Databases AuthorOf 5 1 9 Paper Author AuthorOf title : On Nesting name : Baldwin 10 surname : Oliver Graphs 0 Author name : Abigail surname : Conner ǫ ( 0 ) 3 Paper title : On Joining Graphs 9/16

  18. THoSP Algorithm – Example 3 0 Paper Author AuthorOf title : On Joining name : Abigail 6 surname : Conner Graphs f r O o h u t A 4 2 7 Paper Author AuthorOf title : Object name : Cassie 8 surname : Norman Databases AuthorOf 5 1 9 Paper Author AuthorOf title : On Nesting name : Baldwin 10 surname : Oliver Graphs 0 2 Author Author name : Abigail name : Cassie surname : Conner surname : Norman ǫ ( 0 ) 3 Paper title : On Joining Graphs 9/16

  19. THoSP Algorithm – Example 3 0 Paper Author AuthorOf title : On Joining name : Abigail 6 surname : Conner Graphs f O r h o t u A 4 2 7 Paper Author AuthorOf name : Cassie title : Object 8 surname : Norman Databases AuthorOf 5 1 9 Paper Author AuthorOf title : On Nesting name : Baldwin 10 surname : Oliver Graphs coauthorship 0 2 Author Author name : Abigail name : Cassie surname : Conner surname : Norman ǫ ( 0 → 2 ) , ǫ ( 2 → 0 ) ǫ ( 0 ) 3 Paper title : On Joining Graphs 9/16

  20. THoSP Algorithm – Example 3 0 Paper Author AuthorOf title : On Joining name : Abigail 6 surname : Conner Graphs f O r h o t u A 4 2 7 Paper Author AuthorOf name : Cassie title : Object 8 surname : Norman Databases AuthorOf 5 1 9 Paper Author AuthorOf title : On Nesting name : Baldwin 10 surname : Oliver Graphs coauthorship 0 2 Author Author name : Abigail name : Cassie surname : Conner surname : Norman ǫ ( 0 → 2 ) , ǫ ( 2 → 0 ) ǫ ( 0 ) ǫ ( 2 ) 3 4 Paper Paper title : On Joining title : Object Graphs Databases 9/16

  21. THoSP Algorithm – Example 3 0 Paper Author AuthorOf title : On Joining name : Abigail 6 surname : Conner Graphs f O r h o t u A 4 2 7 Paper Author AuthorOf name : Cassie title : Object 8 surname : Norman Databases AuthorOf 5 1 9 Paper Author AuthorOf title : On Nesting name : Baldwin 10 surname : Oliver Graphs coauthorship 0 2 1 Author Author Author name : Abigail name : Cassie name : Baldwin surname : Conner surname : Norman surname : Oliver ǫ ( 0 → 2 ) , ǫ ( 2 → 0 ) ǫ ( 0 ) ǫ ( 1 ) ǫ ( 2 ) 3 4 Paper Paper title : On Joining title : Object Graphs Databases 9/16

  22. THoSP Algorithm – Example 3 0 Paper Author AuthorOf title : On Joining name : Abigail 6 surname : Conner Graphs f O r h o t u A 4 2 7 Paper Author AuthorOf name : Cassie title : Object 8 surname : Norman Databases AuthorOf 5 1 9 Paper Author AuthorOf title : On Nesting name : Baldwin 10 surname : Oliver Graphs coauthorship 0 2 1 Author Author Author name : Abigail name : Cassie name : Baldwin surname : Conner surname : Norman surname : Oliver coauthorship ǫ ( 0 → 2 ) , ǫ ( 2 → 0 ) ǫ ( 0 → 1 ) , ǫ ( 1 → 0 ) ǫ ( 0 ) ǫ ( 1 ) ǫ ( 2 ) 3 4 Paper Paper title : On Joining title : Object Graphs Databases 9/16

  23. THoSP Algorithm – Example 3 0 Paper Author AuthorOf title : On Joining name : Abigail 6 surname : Conner Graphs f O r h o t u A 4 2 7 Paper Author AuthorOf name : Cassie title : Object 8 surname : Norman Databases AuthorOf 5 1 9 Paper Author AuthorOf title : On Nesting name : Baldwin 10 surname : Oliver Graphs coauthorship 0 2 1 Author Author Author name : Abigail name : Cassie name : Baldwin surname : Conner surname : Norman surname : Oliver coauthorship ǫ ( 0 → 2 ) , ǫ ( 2 → 0 ) ǫ ( 0 → 1 ) , ǫ ( 1 → 0 ) ǫ ( 1 ) ǫ ( 0 ) ǫ ( 2 ) 3 4 5 Paper Paper Paper title : On Joining title : Object title : On Nesting Graphs Databases Graphs 9/16

  24. Experimental Evaluation

Recommend


More recommend