Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Semantics and complexity of SPARQL

Published: 03 September 2009 Publication History

Abstract

SPARQL is the standard language for querying RDF data. In this article, we address systematically the formal study of the database aspects of SPARQL, concentrating in its graph pattern matching facility. We provide a compositional semantics for the core part of SPARQL, and study the complexity of the evaluation of several fragments of the language. Among other complexity results, we show that the evaluation of general SPARQL patterns is PSPACE-complete. We identify a large class of SPARQL patterns, defined by imposing a simple and natural syntactic restriction, where the query evaluation problem can be solved more efficiently. This restriction gives rise to the class of well-designed patterns. We show that the evaluation problem is coNP-complete for well-designed patterns. Moreover, we provide several rewriting rules for well-designed patterns whose application may have a considerable impact in the cost of evaluating SPARQL queries.

References

[1]
Abiteboul, S., Hull, R., and Vianu, V. 1995. Foundations of Databases. Addison-Wesley.
[2]
Abiteboul, S., Kanellakis, P., and Grahne, G. 1991. On the representation and querying of sets of possible worlds. Theor. Comput. Sci. 78, 1, 158--187.
[3]
Angles, R. and Gutierrez, C. 2008. The expressive power of sparql. In Proceedings of the International Semantic Web Conference (ISWC), 114--129.
[4]
Arenas, M., Gutierrez, C., Parsia, B., Pérez, J., Polleres, A., and Seaborne, A. 2007. SPARQL—Where are we? Current state, theory and practice. Full day tutorial, European Semantic Web Conference.
[5]
ARQ, 2006. A SPARQL processor for Jena, version 1.3 March 2006, Hewlett-Packard Development Company. http://jena.sourceforge.net/ARQ.
[6]
Beeri, C., Fagin, R., Maier, D., and Yannakakis, M. 1983. On the desirability of acyclic database schemes. J. ACM 30, 3, 479--513.
[7]
Bhargava, G., Goel, P., and Iyer, B. 1995. Hypergraph based reorderings of outer join queries with complex predicates. In Proceedings of the SIGMOD International Conference of Management of Data, 304--315.
[8]
Chandra, A. and Merlin, P. 1977. Optimal implementation of conjunctive queries in relational data bases. In Proceedings of the Symposium on the Theory of Computing (STOC), 77--90.
[9]
Chen, L., Gupta, A., and Kurul, E. 2005. A semantic-aware RDF query algebra. In Proceedings of the International Conference on Management of Data (COMAD).
[10]
Cyganiak, R. 2005. A relational algebra for sparql. Tech. rep. HPL-2005-170, HP-Labs. http://www.hpl.hp.com/techreports/2005/HPL-2005-170.html.
[11]
de Bruijn, J., Franconi, E., and Tessaris, S. 2005. Logical reconstruction of normative RDF. In Proceedings of the OWL—Experiences and Directions Workshop (OWLED).
[12]
Durst, M. and Suignard, M. 2005. Rfc 3987, internationalized resource identifiers (IRIS). http://www.ietf.org/rfc/rfc3987.txt.
[13]
Frasincar, F., Houben, G.-J., Vdovjak, R., and Barna, P. 2004. RAL: An algebra for querying RDF. World Wide Web 7, 1, 83--109.
[14]
Furche, T., Linse, B., Bry, F., Plexousakis, D., and Gottlob, G. 2006. RDF querying: Language constructs and evaluation methods compared. In Reasoning Web, 1--52.
[15]
Galindo-Legaria, C. A. and Rosenthal, A. 1997. Outerjoin simplification and reordering for query optimization. ACM Trans. Datab. Syst. 22, 1, 43--73.
[16]
Garey, M. R. and Johnson, D. S. 1979. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman.
[17]
Gottlob, G., Leone, N., and Scarcello, F. 2001. The complexity of acyclic conjunctive queries. J. ACM 48, 3, 431--498.
[18]
Gutierrez, C., Hurtado, C. A., and Mendelzon, A. O. 2004. Foundations of semantic Web databases. In Proceedings of the ACM Symposium on Principles of Database Systems (PODS), 95--106.
[19]
Haase, P., Broekstra, J., Eberhart, A., and Volz, R. 2004. A comparison of RDF query languages. In Proceedings of the International Semantic Web Conference (ISWC), 502--517.
[20]
Harris, S. and Shadbolt, N. 2005. SPARQL query processing with conventional relational database systems. In Proceedings of the WISE Workshops, 235--244.
[21]
Imielinski, T. and Lipski, W. 1984. Incomplete information in relational databases. J. ACM 31, 4, 761--791.
[22]
Karvounarakis, G., Alexaki, S., Christophides, V., Plexousakis, D., and Scholl, M. 2002. RQL: A declarative query language for RDF. In Proceedings of the International Conference on World Wide Web (WWW), 592--603.
[23]
Klyne, G., Carroll, J. J., and McBride, B. 2004. Resource description framework (RDF): Concepts and abstract syntax. W3C recommendation. http://www.w3.org/TR/rdf-concepts/.
[24]
Manola, F. and Miller, E. 2004. RDF primer, W3C recommendation. http://www.w3.org/TR/rdf-concepts/.
[25]
Marin, D. 2004. A formalization of RDF (applications de la logique á la sémantique du Web). Tech. rep., École Polytechnique, Universidad de Chile. Department of Computer Science, Universidad de Chile, TR/DCC-2006-8.
[26]
Pérez, J., Arenas, M., and Gutierrez, C. 2006a. Semantics and complexity of SPARQL. In Proceedings of the International Semantic Web Conference (ISWC). 30--43.
[27]
Pérez, J., Arenas, M., and Gutierrez, C. 2006b. Semantics of SPARQL. Tech. rep., Universidad de Chile. Department of Computer Science, Universidad de Chile, TR/DCC-2006-17.
[28]
Polleres, A. 2007. From SPARQL to rules (and back). In Proceedings of the International Conference on World Wide Web (WWW), 787--796.
[29]
Prud'hommeaux, E. and Seaborne, A. 2008. SPARQL query language for RDF. W3C recommendation. http://www.w3.org/TR/rdf-sparql-query/.
[30]
Robertson, E. L. 2004. Triadic relations: An algebra for the semantic Web. In Proceedings of the International Workshop on Semantic Web and Databases (SWDB), 91--108.
[31]
Schmidt, M., Meier, M., and Lausen, G. 2008. Foundations of SPARQL query optimization. http://arxiv.org/abs/0812.3788.
[32]
Seaborne, A. 2006. Personal communication.
[33]
Serfiotis, G., Koffina, I., Christophides, V., and Tannen, V. 2005. Containment and minimization of RDF/S query patterns. In Proceedings of the International Semantic Web Conference (ISWC), 607--623.
[34]
Vardi, M. Y. 1982. The complexity of relational query languages (extended abstract). In Proceedings of the Symposium on the Theory of Computing (STOC), 137--146.
[35]
Yannakakis, M. 1981. Algorithms for acyclic database schemes. In Proceedings of the International Conference on Very Large Data Bases (VLDB), 82--94.
[36]
Zaniolo, C. 1984. Database relations with null values. J. Comput. Syst. Sci. 28, 1, 142--166.

Cited By

View all
  • (2025)ULKB Logic: A HOL-based framework for reasoning over knowledge graphsScience of Computer Programming10.1016/j.scico.2025.103263242(103263)Online publication date: May-2025
  • (2025)FTPComplEx: A flexible time perspective approach to temporal knowledge graph completionEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.109717139(109717)Online publication date: Jan-2025
  • (2024)You have interrupted me again!: making voice assistants more dementia-friendly with incremental clarificationFrontiers in Dementia10.3389/frdem.2024.13430523Online publication date: 12-Mar-2024
  • Show More Cited By

Index Terms

  1. Semantics and complexity of SPARQL

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Transactions on Database Systems
    ACM Transactions on Database Systems  Volume 34, Issue 3
    August 2009
    269 pages
    ISSN:0362-5915
    EISSN:1557-4644
    DOI:10.1145/1567274
    Issue’s Table of Contents
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 03 September 2009
    Accepted: 01 June 2009
    Revised: 01 December 2008
    Received: 01 April 2008
    Published in TODS Volume 34, Issue 3

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Complexity
    2. RDF
    3. SPARQL
    4. query language
    5. semantic Web

    Qualifiers

    • Research-article
    • Research
    • Refereed

    Funding Sources

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)280
    • Downloads (Last 6 weeks)42
    Reflects downloads up to 24 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2025)ULKB Logic: A HOL-based framework for reasoning over knowledge graphsScience of Computer Programming10.1016/j.scico.2025.103263242(103263)Online publication date: May-2025
    • (2025)FTPComplEx: A flexible time perspective approach to temporal knowledge graph completionEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.109717139(109717)Online publication date: Jan-2025
    • (2024)You have interrupted me again!: making voice assistants more dementia-friendly with incremental clarificationFrontiers in Dementia10.3389/frdem.2024.13430523Online publication date: 12-Mar-2024
    • (2024)A survey on SPARQL query relaxation under the lens of RDF reificationSemantic Web10.3233/SW-243621(1-48)Online publication date: 20-Sep-2024
    • (2024)smart-KG: Partition-Based Linked Data Fragments for querying knowledge graphsSemantic Web10.3233/SW-24357115:5(1791-1835)Online publication date: 9-Oct-2024
    • (2024)Similarity joins and clustering for SPARQLSemantic Web10.3233/SW-24354015:5(1701-1732)Online publication date: 9-Oct-2024
    • (2024)An ontological approach for representing declarative mapping languagesSemantic Web10.3233/SW-22322415:1(191-221)Online publication date: 12-Jan-2024
    • (2024)Information extraction from automotive reports for ontology populationApplied Ontology: An Interdisciplinary Journal of Ontological Analysis and Conceptual Modeling10.3233/AO-23000219:2(113-142)Online publication date: 1-Jun-2024
    • (2024)Consistent query answering over SHACL constraintsProceedings of the 21st International Conference on Principles of Knowledge Representation and Reasoning10.24963/kr.2024/1(2-13)Online publication date: 2-Nov-2024
    • (2024)Um método para conversão de modelos de processos de negócio em grafos de conhecimento semânticos para auxílio em tomadas de decisãoTransinformação10.1590/2318-0889202436e24813636Online publication date: 2024
    • Show More Cited By

    View Options

    Login options

    Full Access

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media