Skip to main content

Navigational and Rule-Based Languages for Graph Databases

  • Chapter
  • First Online:
Reasoning Web: Logical Foundation of Knowledge Graph Construction and Query Answering (Reasoning Web 2016)

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 9885))

Included in the following conference series:

Abstract

One of the key differences between graph and relational databases is that on graphs we are much more interested in navigational queries. As a consequence, graph database systems are specifically engineered to answer these queries efficiently, and there is a wide body of work on query languages that can express complex navigational patterns.

The most commonly used way to add navigation into graph queries is to start with a basic pattern matching language and augment it with navigational primitives based on regular expressions. For example, the friend-of-a-friend relationship in a social network is expressed via the primitive (friend)+, which looks for paths of nodes connected via the friend relation. This expression can be then added to graph patterns, allowing us to retrieve, for example, all nodes A, B and C that have a common friend-of-a-friend.

But, in order to alleviate some of the drawbacks of isolating navigation in a set of primitives, we have recently witnessed an effort to study languages which integrate navigation and pattern matching in an intrinsic way. A natural candidate to use is Datalog, a well known declarative query language that extends first order logic with recursion, and where pattern matching and recursion can be arbitrarily nested to provide much more expressive navigational queries.

In this chapter we review the most common navigational primitives for graphs, and explain how these primitives can be embedded into Datalog. We then show current efforts to restrict Datalog in order to obtain a query language that is both expressive enough to express all these primitives, but at the same time feasible to use in practice. We illustrate how this works both over the base graph model and over the more general RDF format underlying the semantic web.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 49.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    These programs are sometimes referred to as stratified linear programs, or piecewise linear Programs [38].

  2. 2.

    To simplify the presentation in this chapter we only consider ground RDF graphs [24], i.e. RDF graphs which do not contain any blank nodes nor literals.

References

  1. Robinson, I., Webber, J., Eifrem, E., Databases, G.: New Opportunities for Connected Data. O’Reilly Media, Inc., Sebastopol (2015)

    Google Scholar 

  2. Martinez-Bazan, N., Gomez-Villamor, S., Escale-Claveras, F.: DEX: a high-performance graph database management system. In: 2011 IEEE 27th International Conference on Data Engineering Workshops (ICDEW), pp. 124–127 (2011)

    Google Scholar 

  3. Angles, R.: A comparison of current graph database models. In: 2012 IEEE 28th International Conference on Data Engineering Workshops (ICDEW), pp. 171–177. IEEE (2012)

    Google Scholar 

  4. Angles, R., Gutierrez, C.: Survey of graph database models. ACM Comput. Surv. (CSUR) 40(1), 1 (2008)

    Article  Google Scholar 

  5. Barceló Baeza, P.: Querying graph databases. In: PODS, pp. 175–188. ACM (2013)

    Google Scholar 

  6. Cruz, I., Mendelzon, A., Wood, P.: A graphical query language supporting recursion. In: ACM Special Interest Group on Management of Data 1987 Annual Conference (SIGMOD), pp. 323–330 (1987)

    Google Scholar 

  7. Gottlob, G., Koch, C., Pichler, R.: Efficient algorithms for processing XPath queries. ACM Trans. Database Syst. 30(2), 444–491 (2005)

    Article  Google Scholar 

  8. Fletcher, G.H., Gyssens, M., Leinders, D., Surinx, D., Van den Bussche, J., Van Gucht, D., Vansummeren, S., Wu, Y.: Relative expressive power of navigational querying on graphs. Inf. Sci. 298, 390–406 (2015)

    Article  MathSciNet  Google Scholar 

  9. Harris, S., Seaborne, A., Prud’hommeaux, E.: SPARQL 1.1 Query Language. W3C Recommendation (2013)

    Google Scholar 

  10. Klyne, G., Carroll, J.J.: Resource description framework (RDF): concepts and abstract syntax (2006)

    Google Scholar 

  11. Calvanese, D., De Giacomo, G., Lenzerini, M., Vardi, M.: Containment of conjunctive regular path queries with inverse. In: 7th International Conference on Principles of Knowledge Representation and Reasoning (KR), pp. 176–185 (2000)

    Google Scholar 

  12. Gottlob, G., Koch, C.: Logic-based web information extraction. SIGMOD Rec. 33(2), 87–94 (2004)

    Article  Google Scholar 

  13. Consens, M., Mendelzon, A.: GraphLog: a visual formalism for real life recursion. In: 9th ACM Symposium on Principles of Database Systems (PODS), pp. 404–416 (1990)

    Google Scholar 

  14. Rudolph, S., Krötzsch, M.: Flag & check: data access with monadically defined queries. In: Proceedings of the 32nd Symposium on Principles of Database Systems, pp. 151–162. ACM (2013)

    Google Scholar 

  15. Bourhis, P., Krötzsch, M., Rudolph, S.: Query containment for highly expressive datalog fragments. arXiv preprint arXiv:1406.7801 (2014)

  16. Bourhis, P., Krötzsch, M., Rudolph, S.: How to best nest regular path queries. In: Description Logics (2014)

    Google Scholar 

  17. Bourhis, P., Krötzsch, M., Rudolph, S.: Reasonable highly expressive query languages. In: IJCAI, pp. 2826–2832 (2015)

    Google Scholar 

  18. Kostylev, E.V., Reutter, J.L., Romero, M., Vrgoč, D.: SPARQL with property paths. In: Arenas, M., Corcho, O., Simperl, E., Strohmaier, M., d’Aquin, M., Srinivas, K., Groth, P., Dumontier, M., Heflin, J., Thirunarayan, K., Staab, S. (eds.) ISWC 2015. LNCS, vol. 9366, pp. 3–18. Springer, Heidelberg (2015). doi:10.1007/978-3-319-25007-6_1

    Chapter  Google Scholar 

  19. Bienvenu, M., Ortiz, M., Simkus, M.: Navigational queries based on frontier-guarded datalog: preliminary results. In: Alberto Mendelzon International Workshop on Foundations of Data Management, p. 162 (2015)

    Google Scholar 

  20. Libkin, L., Martens, W., Vrgoč, D.: Querying graphs with data. J. ACM 63(2), 14 (2016)

    Article  MathSciNet  Google Scholar 

  21. Abiteboul, S., Buneman, P., Suciu, D.: Data on the Web: From Relations to Semistructured Data and XML. Morgan Kauffman, Burlington (1999)

    Google Scholar 

  22. Calvanese, D., De Giacomo, G., Lenzerini, M., Vardi, M.: Rewriting of regular expressions and regular path queries. J. Comput. Syst. Sci. 64(3), 443–465 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  23. Mendelzon, A., Wood, P.: Finding regular simple paths in graph databases. SIAM J. Comput. 24(6), 1235–1258 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  24. Pérez, J., Arenas, M., Gutierrez, C.: nSPARQL: a navigational language for RDF. J. Web Semant. 8(4), 255–270 (2010)

    Article  Google Scholar 

  25. Barceló, P., Pérez, J., Reutter, J.L.: Relative expressiveness of nested regular expressions. In: AMW, pp. 180–195 (2012)

    Google Scholar 

  26. Bienvenu, M., Calvanese, D., Ortiz, M., Simkus, M.: Nested regular path queries in description logics. In: KR (2014)

    Google Scholar 

  27. Lenzerini, M.: Data integration: a theoretical perspective. In: PODS, pp. 233–246 (2002)

    Google Scholar 

  28. Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Boston (1995)

    MATH  Google Scholar 

  29. Gupta, A., Mumick, I.S., et al.: Maintenance of materialized views: problems, techniques, and applications. IEEE Data Eng. Bull. 18(2), 3–18 (1995)

    Google Scholar 

  30. Calvanese, D., Giacomo, G., Lenzerini, M., Vardi, M.Y.: View-based query answering and query containment over semistructured data. In: Ghelli, G., Grahne, G. (eds.) DBPL 2001. LNCS, vol. 2397, pp. 40–61. Springer, Heidelberg (2002). doi:10.1007/3-540-46093-4_3

    Chapter  Google Scholar 

  31. Meyer, A.R., Stockmeyer, L.J.: The equivalence problem for regular expressions with squaring requires exponential space. In: 13th Annual Symposium on Switching and Automata Theory, College Park, Maryland, USA, 25–27 October 1972, pp. 125–129 (1972)

    Google Scholar 

  32. Reutter, J.L.: Containment of nested regular expressions. arXiv preprint arXiv:1304.2637 (2013)

  33. Florescu, D., Levy, A., Suciu, D.: Query containment for conjunctive queries with regular expressions. In: 17th ACM Symposium on Principles of Database Systems (PODS), pp. 139–148 (1998)

    Google Scholar 

  34. Barceló, P., Pérez, J., Reutter, J.L.: Schema mappings and data exchange for graph databases. In: ICDT, TBD (2013)

    Google Scholar 

  35. Barceló, P., Libkin, L., Reutter, J.L.: Querying regular graph patterns. J. ACM (JACM) 61(1), 8 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  36. Chandra, A.K., Merlin, P.M.: Optimal implementation of conjunctive queries in relational data bases. In: Proceedings of the Ninth Annual ACM Symposium on Theory of Computing, pp. 77–90. ACM (1977)

    Google Scholar 

  37. Vardi, M.Y.: An automata-theoretic approach to linear temporal logic. In: Moller, F., Birtwistle, G. (eds.) Logics for Concurrency. LNCS, vol. 1043, pp. 238–266. Springer, Heidelberg (1996). doi:10.1007/3-540-60915-6_6

    Chapter  Google Scholar 

  38. Ullman, J.D.: Principles of Database and Knowledge-Base Systems. Computer Science Press, Rockville (1989)

    Google Scholar 

  39. Chaudhuri, S., Vardi, M.Y.: On the equivalence of recursive and nonrecursive datalog programs. In: Proceedings of the Eleventh ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, pp. 55–66. ACM (1992)

    Google Scholar 

  40. Courcelle, B.: The monadic second-order logic of graphs. I. Recognizable sets of finite graphs. Inf. Comput. 85(1), 12–75 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  41. Courcelle, B.: Recursive queries and context-free graph grammars. Theoret. Comput. Sci. 78(1), 217–244 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  42. Reutter, J.L., Romero, M., Vardi, M.Y.: Regular queries on graph databases. In: 18th International Conference on Database Theory (ICDT 2015), vol. 31, pp. 177–194 (2015)

    Google Scholar 

  43. Barcelo, P., Libkin, L., Lin, A.W., Wood, P.T.: Expressive languages for path queries over graph-structured data. ACM TODS 37(4), 31 (2012)

    Article  Google Scholar 

  44. Libkin, L., Martens, W., Vrgoč, D.: Querying graph databases with XPath. In: Proceedings of the 16th International Conference on Database Theory, pp. 129–140. ACM (2013)

    Google Scholar 

  45. Kostylev, E.V., Reutter, J.L., Vrgoč, D.: Containment of data graph queries. In: ICDT, pp. 131–142 (2014)

    Google Scholar 

  46. Libkin, L., Reutter, J., Vrgoč, D.: Trial for RDF: adapting graph query languages for RDF data. In: PODS, pp. 201–212. ACM (2013)

    Google Scholar 

  47. Arenas, M., Gutierrez, C., Pérez, J.: Foundations of RDF databases. In: Tessaris, S., Franconi, E., Eiter, T., Gutierrez, C., Handschuh, S., Rousset, M.-C., Schmidt, R.A. (eds.) Reasoning Web 2009. LNCS, vol. 5689, pp. 158–204. Springer, Heidelberg (2009). doi:10.1007/978-3-642-03754-2_4

    Chapter  Google Scholar 

  48. Kostylev, E.V., Reutter, J.L., Vrgoč, D.: Static analysis of navigational XPath over graph databases. Inf. Process. Lett. 116(7), 467–474 (2016)

    Article  MathSciNet  MATH  Google Scholar 

  49. Arenas, M., Gottlob, G., Pieris, A.: Expressive languages for querying the semantic web. In: Proceedings of the 33rd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS 2014, Snowbird, UT, USA, 22–27 June 2014, pp. 14–26 (2014). http://doi.acm.org/10.1145/2594538.2594555

  50. Gubichev, A., Bedathur, S.J., Seufert, S.: Sparqling kleene: fast property paths in RDF-3X. In: First International Workshop on Graph Data Management Experiences and Systems, GRADES 2013, Co-located with SIGMOD/PODS 2013, New York, NY, USA, 24 June 2013, p. 14 (2013)

    Google Scholar 

  51. Yakovets, N., Godfrey, P., Gryz, J.: Query planning for evaluating SPARQL property paths. In: Proceedings of the 2016 International Conference on Management of Data, SIGMOD Conference 2016, San Francisco, CA, USA, 26 June–01 July 2016, pp. 1875–1889 (2016)

    Google Scholar 

  52. Atzori, M.: Computing recursive SPARQL queries. In: 2014 IEEE International Conference on Semantic Computing, Newport Beach, CA, USA, 16–18 June 2014, pp. 258–259 (2014)

    Google Scholar 

  53. Reutter, J.L., Soto, A., Vrgoč, D.: Recursion in SPARQL. In: Arenas, M., et al. (eds.) ISWC 2015. LNCS, vol. 9366, pp. 19–35. Springer, Heidelberg (2015). doi:10.1007/978-3-319-25007-6_2

    Chapter  Google Scholar 

  54. Hartig, O., Pérez, J.: LDQL: a query language for the web of linked data. In: Arenas, M., et al. (eds.) ISWC 2015. LNCS, vol. 9366, pp. 73–91. Springer, Heidelberg (2015). doi:10.1007/978-3-319-25007-6_5

    Chapter  Google Scholar 

  55. Hartig, O., Pirrò, G.: A context-based semantics for SPARQL property paths over the web. In: Gandon, F., Sabou, M., Sack, H., d’Amato, C., Cudré-Mauroux, P., Zimmermann, A. (eds.) ESWC 2015. LNCS, vol. 9088, pp. 71–87. Springer, Heidelberg (2015). doi:10.1007/978-3-319-18818-8_5

    Chapter  Google Scholar 

  56. Fionda, V., Pirrò, G., Gutierrez, C.: NautiLOD: a formal language for the web of data graph. TWEB 9(1), 5:1–5:43 (2015)

    Article  Google Scholar 

  57. Berners-Lee, T.: Linked data (2006). http://www.w3.org/DesignIssues/LinkedData.html

  58. He, H., Singh, A.K.: Graphs-at-a-time: query language and access methods for graph databases. In: Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, pp. 405–418. ACM (2008)

    Google Scholar 

Download references

Acknowledgments

We would like to thank Pablo Barceló, Jorge Pérez, Miguel Romero, Moshe Vardi, Egor Kostlyev and Leonid Libkin for helpful discussions on the topics of this chapter, as several of the results presented here where published in papers co-authored with them. The authors are supported by the Millennium Nucleus Center for Semantic Web Research Grant NC120004.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Juan L. Reutter .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this chapter

Cite this chapter

Reutter, J.L., Vrgoč, D. (2017). Navigational and Rule-Based Languages for Graph Databases. In: Pan, J., et al. Reasoning Web: Logical Foundation of Knowledge Graph Construction and Query Answering. Reasoning Web 2016. Lecture Notes in Computer Science(), vol 9885. Springer, Cham. https://doi.org/10.1007/978-3-319-49493-7_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-49493-7_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-49492-0

  • Online ISBN: 978-3-319-49493-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics