Skip to main content

The Challenge of Optional Matching in SPARQL

  • Conference paper
  • First Online:
Foundations of Information and Knowledge Systems (FoIKS 2016)

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

Included in the following conference series:

  • 1052 Accesses

Abstract

Conjunctive queries are arguably the most widely used querying mechanism in practice and the most intensively studied one in database theory. Answering a conjunctive query (CQ) comes down to matching all atoms of the CQ simultaneously into the database. As a consequence, a CQ fails to provide any answer if the pattern described by the query does not exactly match the data. CQs might thus be too restrictive as a querying mechanism for data on the web, which is considered as inherently incomplete. The semantic web query language SPARQL therefore contains the OPTIONAL operator as a crucial feature. It allows the user to formulate queries which try to match parts of the query over the data if available, but do not destroy answers of the remaining query otherwise. In this article, we have a closer look at this optional matching feature of SPARQL. More specifically, we will survey several results which have recently been obtained for an interesting fragment of SPARQL – the so-called well-designed SPARQL graph patterns.

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 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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.

    We use here the algebraic-style notation from [29] rather than the official SPARQL syntax of [33]. In particular, we explicitly use an AND operator (rather than comma-separated lists) to denote conjunctions.

References

  1. Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison Wesley, Boston (1995). http://www.bibsonomy.org/bibtex/224822a68f8997f802f178bb7b146c6ff/algebradresden

    MATH  Google Scholar 

  2. Ahmetaj, S., Fischl, W., Pichler, R., Simkus, M., Skritek, S.: Towards reconciling SPARQL and certain answers. In: Proceedings of the WWW 2015, pp. 23–33. ACM (2015)

    Google Scholar 

  3. Angles, R., Gutierrez, C.: The expressive power of SPARQL. In: Sheth, A.P., Staab, S., Dean, M., Paolucci, M., Maynard, D., Finin, T., Thirunarayan, K. (eds.) ISWC 2008. LNCS, vol. 5318, pp. 114–129. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  4. Aranda, C.B., Arenas, M., Corcho, Ó., Polleres, A.: Federating queries in SPARQL 1.1: syntax, semantics and evaluation. J. Web Sem. 18(1), 1–17 (2013)

    Article  Google Scholar 

  5. Arenas, M., Pérez, J.: Querying semantic web data with SPARQL. In: Proceedings of the PODS 2011, pp. 305–316. ACM (2011)

    Google Scholar 

  6. Baader, F., Calvanese, D., McGuinness, D.L., Nardi, D., Patel-Schneider, P.F. (eds.): The Description Logic Handbook: Theory, Implementation, and Applications. Cambridge University Press, Cambridge (2003)

    MATH  Google Scholar 

  7. Barceló, P., Libkin, L., Romero, M.: Efficient approximations of conjunctive queries. SIAM J. Comput. 43(3), 1085–1130 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  8. Barceló, P., Pichler, R., Skritek, S.: Efficient evaluation and approximation of well-designed pattern trees. In: Proceedings of the PODS 2015, pp. 131–144. ACM (2015)

    Google Scholar 

  9. Calì, A., Gottlob, G., Kifer, M.: Taming the infinite chase: Query answering under expressive relational constraints. In: Proceedings of the KR 2008, pp. 70–80. AAAI Press (2008)

    Google Scholar 

  10. Calvanese, D., De Giacomo, G., Lembo, D., Lenzerini, M., Rosati, R.: Tractable reasoning and efficient query answering in description logics: The DL-Lite family. J. Autom. Reason. 39(3), 385–429 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  11. Chandra, A.K., Merlin, P.M.: Optimal implementation of conjunctive queries in relational data bases. In: Proceedings of the STOC 1977, pp. 77–90. ACM (1977)

    Google Scholar 

  12. Chekuri, C., Rajaraman, A.: Conjunctive query containment revisited. Theor. Comput. Sci. 239(2), 211–229 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  13. Cyganiak, R., Wood, D., Lanthaler, M.: RDF 1.1 concepts and abstract syntax. W3C Recommendation, W3C (2014). http://www.w3.org/TR/rdf11-concepts

  14. Glimm, B., Ogbuji, C.: SPARQL 1.1 Entailment Regimes. W3C Recommendation, W3C, March 2013. http://www.w3.org/TR/sparql11-entailment

  15. Gottlob, G., Leone, N., Scarcello, F.: Hypertree decompositions and tractable queries. J. Comput. Syst. Sci. 64(3), 579–627 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  16. Greco, S., Spezzano, F., Trubitsyna, I.: Checking chase termination: Cyclicity analysis and rewriting techniques. IEEE Trans. Knowl. Data Eng. 27(3), 621–635 (2015)

    Article  Google Scholar 

  17. Grohe, M., Marx, D.: Constraint solving via fractional edge covers. ACM Trans. Algor. 11(1), 4 (2014)

    MathSciNet  MATH  Google Scholar 

  18. Harris, S., Seaborne, A.: SPARQL 1.1 Query Language. W3C Recommendation, W3C, March 2013. http://www.w3.org/TR/sparql11-query

  19. Kaminski, M., Kostylev, E.V.: Beyond well-designed SPARQL. In: Proceedings of the ICDT 2016 (to appear, 2016)

    Google Scholar 

  20. Kanza, Y., Nutt, W., Sagiv, Y.: Querying incomplete information in semistructured data. J. Comput. Syst. Sci. 64(3), 655–693 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  21. Klug, A.C.: On conjunctive queries containing inequalities. J. ACM 35(1), 146–160 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  22. Kostylev, E.V., Reutter, J.L., Romero, M., Vrgoč, D.: SPARQL with Property Paths. In: Arenas, M., et al. (eds.) The Semantic Web - ISWC 2015. LNCS, vol. 9366, pp. 3–18. Springer, Heidelberg (2015)

    Chapter  Google Scholar 

  23. Kostylev, E.V., Reutter, J.L., Ugarte, M.: CONSTRUCT queries in SPARQL. In: Proceedings of the ICDT 2015. LIPIcs, vol. 31, pp. 212–229 (2015)

    Google Scholar 

  24. Kröll, M., Pichler, R., Skritek, S.: On the complexity of enumerating the answers to well-designed pattern trees. In: Proceedings of the ICDT 2016 (to appear, 2016)

    Google Scholar 

  25. Letelier, A., Pérez, J., Pichler, R., Skritek, S.: Static analysis and optimization of semantic web queries. ACM Trans. Database Syst. 38(4), 25 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  26. Meier, M.: On the termination of the chase algorithm. Ph.D. Thesis, University of Freiburg (2010). http://www.freidok.uni-freiburg.de/volltexte/7590/

  27. Motik, B., Grau, B.C., Horrocks, I., Wu, Z., Fokoue, A., Lutz, C.: Owl 2 web ontology language: Profiles. W3C working draft, W3C, October 2008. http://www.w3.org/TR/2008/WD-owl2-profiles-20081008/

  28. Pérez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. In: Cruz, I., Decker, S., Allemang, D., Preist, C., Schwabe, D., Mika, P., Uschold, M., Aroyo, L.M. (eds.) ISWC 2006. LNCS, vol. 4273, pp. 30–43. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  29. Pérez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. ACM Trans. Database Syst. 34(3), 1–45 (2009)

    Article  Google Scholar 

  30. Pichler, R., Skritek, S.: Containment and equivalence of well-designed SPARQL. In: Proceedings of the PODS 2014, pp. 39–50. ACM (2014)

    Google Scholar 

  31. Pichler, R., Skritek, S.: On the hardness of counting the solutions of SPARQL queries. In: Proceedings of the AMW 2014. CEUR Workshop Proceedings, vol. 1189. CEUR-WS.org (2014)

    Google Scholar 

  32. Polleres, A.: From SPARQl to rules (and back). In: Proceedings of the WWW 2007, pp. 787–796. ACM (2007)

    Google Scholar 

  33. Prud’hommeaux, E., Seaborne, A.: SPARQL Query Language for RDF. W3C Recommendation, W3C (2008). http://www.w3.org/TR/rdf-sparql-query/

  34. Sagiv, Y., Yannakakis, M.: Equivalences among relational expressions with the union and difference operators. J. ACM 27(4), 633–655 (1980)

    Article  MathSciNet  MATH  Google Scholar 

  35. Schmidt, M., Meier, M., Lausen, G.: Foundations of SPARQL query optimization. In: Proceedings of the ICDT 2010, pp. 4–33. ACM (2010)

    Google Scholar 

  36. Yannakakis, M.: Algorithms for acyclic database schemes. In: Proceedings of the VLDB 1981, pp. 82–94. IEEE Computer Society (1981)

    Google Scholar 

Download references

Acknowledgments

This work was supported by the Vienna Science and Technology Fund (WWTF), project ICT12-15 and by the Austrian Science Fund (FWF): P25207-N23 and W1255-N23.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Reinhard Pichler .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Ahmetaj, S., Fischl, W., Kröll, M., Pichler, R., Šimkus, M., Skritek, S. (2016). The Challenge of Optional Matching in SPARQL. In: Gyssens, M., Simari, G. (eds) Foundations of Information and Knowledge Systems. FoIKS 2016. Lecture Notes in Computer Science(), vol 9616. Springer, Cham. https://doi.org/10.1007/978-3-319-30024-5_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-30024-5_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-30023-8

  • Online ISBN: 978-3-319-30024-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics