Semantics and Complexity of SPARQL

  • Jorge Pérez
  • Marcelo Arenas
  • Claudio Gutierrez
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4273)


SPARQL is the W3C candidate recommendation query language for RDF. In this paper we address systematically the formal study of SPARQL, concentrating in its graph pattern facility. We consider for this study simple RDF graphs without special semantics for literals and a simplified version of filters which encompasses all the main issues. We provide a compositional semantics, prove there are normal forms, prove complexity bounds, among others that the evaluation of SPARQL patterns is PSPACE-complete, compare our semantics to an alternative operational semantics, give simple and natural conditions when both semantics coincide and discuss optimization procedures.


Normal Form Resource Description Framework Query Language Relational Algebra Parse Tree 
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.


  1. 1.
    ARQ - A SPARQL Processor for Jena, version 1.3, Hewlett-Packard Development Company (March 2006),
  2. 2.
    Chen, L., Gupta, A., Kurul, M.E.: A Semantic-aware RDF Query Algebra. In: COMAD 2005 (2005)Google Scholar
  3. 3.
    Cyganiak, R.: A Relational Algebra for Sparql. HP-Labs Technical Report, HPL-2005-170,
  4. 4.
    de Bruijn, J., Franconi, E., Tessaris, S.: Logical Reconstruction of normative RDF. In: OWLED 2005, Galway, Ireland (November 2005)Google Scholar
  5. 5.
    Franconi, E., Tessaris, S.: The Sematics of SPARQL. Working Draft (November 2, 2005),
  6. 6.
    Frasincar, F., Houben, C., Vdovjak, R., Barna, P.: RAL: An algebra for querying RDF. In: WISE 2002 (2002)Google Scholar
  7. 7.
    Galindo-Legaria, C.A., Rosenthal, A.: Outerjoin Simplification and Reordering for Query Optimization. TODS 22(1), 43–73 (1997)CrossRefGoogle Scholar
  8. 8.
    Gutierrez, C., Hurtado, C., Mendelzon, A.: Foundations of Semantic Web Databases. In: PODS 2004, pp. 95–106 (2004)Google Scholar
  9. 9.
    Haase, P., Broekstra, J., Eberhart, A., Volz, R.: A Comparison of RDF Query Languages. In: McIlraith, S.A., Plexousakis, D., van Harmelen, F. (eds.) ISWC 2004. LNCS, vol. 3298, pp. 502–517. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  10. 10.
    Harris, S.: Sparql query processing with conventional relational database systems. In: SSWS 2005 (2005)Google Scholar
  11. 11.
    Klyne, G., Carroll, J.J., McBride, B.: Resource Description Framework (RDF): Concepts and Abstract Syntax. W3C Rec. (February 10, 2004),
  12. 12.
    Manola, F., Miller, E., McBride, B.: RDF Primer, W3C Rec. (February 10, 2004)Google Scholar
  13. 13.
    Marin, D.: RDF Formalization, Santiago de Chile, Tech. Report Univ. Chile, TR/DCC-2006-8 (2004),
  14. 14.
    Patel-Schneider, P., Hayes, P., Horrocks, I.: OWL Web Ontology Language Semantics and Abstract Syntax. W3C Recommendation (February 10, 2004),
  15. 15.
    Prud’hommeaux, E., Seaborne, A.: SPARQL Query Language for RDF. W3C Candidate Rec. (April 6, 2006),
  16. 16.
    Robertson, E.L.: Triadic Relations: An Algebra for the Semantic Web. In: Bussler, C.J., Tannen, V., Fundulaki, I. (eds.) SWDB 2004. LNCS, vol. 3372, pp. 91–108. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  17. 17.
    Seaborne, A.: Personal Communication (April 13, 2006)Google Scholar
  18. 18.
    Serfiotis, G., Koffina, I., Christophides, V., Tannen, V.: Containment and Minimization of RDF/S Query Patterns. In: Gil, Y., Motta, E., Benjamins, V.R., Musen, M.A. (eds.) ISWC 2005. LNCS, vol. 3729, pp. 607–623. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  19. 19.
    Vardi, M.: The Complexity of Relational Query Languages (Extended Abstract). In: STOC 1982, pp. 137–146 (1982)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Jorge Pérez
    • 1
  • Marcelo Arenas
    • 2
  • Claudio Gutierrez
    • 3
  1. 1.Universidad de TalcaChile
  2. 2.Pontificia Universidad Católica de ChileChile
  3. 3.Universidad de ChileChile

Personalised recommendations