The Multiset Semantics of SPARQL Patterns

  • Renzo AnglesEmail author
  • Claudio Gutierrez
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9981)


The paper determines the algebraic and logic structure of the multiset semantics of the core patterns of SPARQL. We prove that the fragment formed by AND, UNION, OPTIONAL, FILTER, MINUS and SELECT corresponds precisely to both, the intuitive multiset relational algebra (projection, selection, natural join, arithmetic union and except), and the multiset non-recursive Datalog with safe negation.


Relational Algebra Graph Pattern Derivation Tree SPARQL Query Triple Pattern 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.



The authors have funding from Millennium Nucleus Center for Semantic Web Research under Grant NC120004. The authors thank useful feedback from O. Hartig and anonymous reviewers.


  1. 1.
    Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Boston (1995)zbMATHGoogle Scholar
  2. 2.
    Albert, J.: Algebraic properties of bag data types. In: Proceedings of the International Conference on Very Large Data Bases (VLDB), pp. 211–219 (1991)Google Scholar
  3. 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)CrossRefGoogle Scholar
  4. 4.
    Angles, R., Gutierrez, C.: Negation in SPARQL. In: Alberto Mendelzon International Workshop on Foundations of Data Management (AMW) (2016)Google Scholar
  5. 5.
    Cyganiak, R.: A relational algebra for SPARQL. Technical report HPL-2005-170, HP Labs (2005)Google Scholar
  6. 6.
    Date, C.J.: Date on Database: Writings 2000–2006. APress, New York (2006)Google Scholar
  7. 7.
    Dayal, U., Goodman, N., Katz, R.H.: An extended relational algebra with control over duplicate elimination. In: Proceedings of the Symposium on Principles of Database Systems (PODS), pp. 117–123. ACM (1982)Google Scholar
  8. 8.
    Green, T.J.: Bag semantics. In: Encyclopedia of Database Systems, pp. 201–206 (2009)Google Scholar
  9. 9.
    Grumbach, S., Libkin, L., Milo, T., Wong, L.: Query languages for bags: expressive power and complexity. SIGACT News 27(2), 30–44 (1996)CrossRefGoogle Scholar
  10. 10.
    Harris, S., Seaborne, A.: SPARQL 1.1 Query Language - W3C Recommendation, 21 March 2013.
  11. 11.
    Hogan, A., Arenas, M., Mallea, A., Polleres, A.: Everything you always wanted to know about blank nodes. J. Web Semant. 27(1), 42–69 (2014)CrossRefGoogle Scholar
  12. 12.
    Kaminski, M., Kostylev, E.V., Grau, B.C.: Semantics and expressive power of subqueries and aggregates in SPARQL 1.1. In: Proceedings of the International Conference on World Wide Web (WWW), pp. 227–238. ACM (2016)Google Scholar
  13. 13.
    Kontchakov, R., Kostylev, E.V.: On expressibility of non-monotone operators in SPARQL. In: International Conference on the Principles of Knowledge Representation and Reasoning (2016)Google Scholar
  14. 14.
    Lamperti, G., Melchiori, M., Zanella, M.: On multisets in database systems. In: Calude, C.S., Pun, G., Rozenberg, G., Salomaa, A. (eds.) Multiset Processing. LNCS, vol. 2235, pp. 147–216. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  15. 15.
    Levene, M., Loizou, G.: A Guided Tour of Relational Databases and Beyond. Springer, Heidelberg (1999)CrossRefzbMATHGoogle Scholar
  16. 16.
    Libkin, L., Wong, L.: Some properties of query languages for bags. In: Proceedings of the International Workshop on Database Programming Languages (DBPL) - Object Models and Languages, pp. 97–114 (1994)Google Scholar
  17. 17.
    Libkin, L., Wong, L.: Query languages for bags and aggregate functions. J. Comput. Syst. Sci. 55(2), 241–272 (1997)MathSciNetCrossRefzbMATHGoogle Scholar
  18. 18.
    Melton, J., Simon, A.R.: SQL:1999. Understanding Relational Language Components. Morgan Kaufmann Publishers, Burlington (2002)Google Scholar
  19. 19.
    Mumick, I.S., Pirahesh, H., Ramakrishnan, R.: The magic of duplicates and aggregates. In: Proceedings of the International Conference on Very Large Data Bases (VLDB), pp. 264–277 (1990)Google Scholar
  20. 20.
    Mumick, I.S., Shmueli, O.: Finiteness properties of database queries. In: Australian Database Conference, pp. 274–288 (1993)Google Scholar
  21. 21.
    Pérez, J., Arenas, M., Gutierrez, C.: Semantics of SPARQL. Technical Report TR/DCC-2006-17, Department of Computer Science, University of Chile (2006)Google Scholar
  22. 22.
    Pérez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. ACM Trans. Database Syst. (TODS) 34(3), 1–45 (2009)CrossRefGoogle Scholar
  23. 23.
    Polleres, A.: From SPARQL to rules (and back). In: Proceedings of the 16th International World Wide Web Conference (WWW), pp. 787–796. ACM (2007)Google Scholar
  24. 24.
    Polleres, A.: How (well) do datalog, SPARQL and RIF interplay? In: Barceló, P., Pichler, R. (eds.) Datalog 2.0 2012. LNCS, vol. 7494, pp. 27–30. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  25. 25.
    Prud’hommeaux, E., Seaborne, A.: SPARQL query language for RDF. W3C Recommendation, 15 January 2008.
  26. 26.
    Schenk, S.: A SPARQL semantics based on datalog. In: Hertzberg, J., Beetz, M., Englert, R. (eds.) KI 2007. LNCS (LNAI), vol. 4667, pp. 160–174. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  27. 27.
    Schmidt, M., Meier, M., Lausen, G.: Foundations of SPARQL query optimization. In: Proceedings of the International Conference on Database Theory, pp. 4–33. ACM (2010)Google Scholar

Copyright information

© Springer International Publishing AG 2016

Authors and Affiliations

  1. 1.Department of Computer ScienceUniversidad de TalcaTalcaChile
  2. 2.Department of Computer ScienceUniversidad de ChileSantiagoChile
  3. 3.Center for Semantic Web ResearchSantiagoChile

Personalised recommendations