Skip to main content

Querying the Semantic Web: SPARQL

  • Reference work entry
Handbook of Semantic Web Technologies

Abstract

SPARQL – Simple Protocol And RDF Query Language – is the language, proposed by W3C, for querying RDF data published on the Web, both stored natively or viewed via middleware. SPARQL offers a syntactically SQL-like language for querying RDF graphs via pattern matching, as well as a simple communication protocol that can be used by clients for issuing SPARQL queries against endpoints.

The first section provides the reader with a scientific and technical overview of the SPARQL query language. Basic concepts, such as the notions of triple and graph patterns are presented first. The section, then, shows how to write simple queries, and progressively introduces the reader to the full expressive power of SPARQL.

The second section illustrates some examples of applications, progressing in a quasi-chronological order. It starts with “early days” applications, when RDF data were lacking and the Semantic Web practitioners applied semantic technologies to bibliographic and conference data. Next, it moves on to “first uptakes” in the area of bioscience, which can be considered as the earlier science adopting Semantic Web technologies. This section is concluded by the presentation of some large applications, showing SPARQL queries that nowadays can be issued against interlinked RDF repositories about music and about governmental data.

The third section is dedicated to SPARQL implementations, in particular to those ones that are mostly used and widely deployed. It also discusses the standard compliance of the implementations, based upon the W3C test suite.

Finally, the fourth section discusses some of the issues that characterize the current development of SPARQL. It presents foreseen extensions to the query language, in particular a proposal for remotely updating RDF graphs, four vocabularies for describing SPARQL endpoints, the behavior of SPARQL under different entailment regimes, three approaches for querying the entire Semantic Web with SPARQL, and three proposals for extending SPARQL to the management of streams of rapidly flowing information.

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 499.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 549.99
Price excludes VAT (USA)
  • Durable hardcover 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

References

  1. SPARQL+: ARC2 SPARQL extensions. http://arc.semsol.org/docs/v2/sparql+. Accessed 14 Feb 2011

  2. ARQ – Documentation and Resources – support for GROUP BY and counting. http://jena.sourceforge.net/ARQ/group-by.html. Accessed 14 Feb 2011

  3. OpenLink Virtuoso Universal Server: Documentation. Aggregates in SPARQL. http://docs.openlinksw.com/virtuoso/rdfsparqlaggregate.html. Accessed 14 Feb 2011

  4. Raimond, Y., Sinclair, P., Humfrey, N.J., Smethurst, M.: BBC programmes ontology. http://purl.org/ontology/po/ (2009). Accessed 14 Feb 2011

  5. Beckett, D., Broekstra, J. (ed.): SPARQL query results XML format, W3C Recommendation. World Wide Web Consortium (2008)

    Google Scholar 

  6. François, B., Marc-Alexandre, N., Nicole, T., Philippe, R., Jean, M.: Bio2RDF: towards a mashup to build bioinformatics knowledge systems. J. Biomed. Inform. 41(5), 706–716 (2008)

    Article  Google Scholar 

  7. Marc-Alexande, N., Michel, D., Francois, B.: Life science raw data now, W3C-HCLS F2F Meeting, Cambridge. http://www.slideshare.net/fbelleau/bio2rdf-w3c-hcls2009 (Apr 2009). Accessed 14 Feb 2011

  8. Freebase: A list of SPARQL endpoint provided by the Bio2RDF initiative. http://www.freebase.com/view/user/bio2rdf/public/sparql. Accessed 14 Feb 2011

  9. Stein, L.D.: Integrating biological databases. Nat. Rev. Genet. 4, 337–345 (2003). http://dx.doi.org/10.1038/nrg1065

    Google Scholar 

  10. Bizer, C., Cyganiak, R., Auer, S., Kobilarov, G.: DBpedia.org – querying wikipedia like a database. In: Proceedings of the 16th International Conference on World Wide Web (WWW 2007), Banff (2007)

    Google Scholar 

  11. Christian, B., Tom, H., Tim, B.-L.: Linked data – the story so far. Int. J. Semant. Web Inf. Syst. 5(3), 1–22 (2009)

    Article  Google Scholar 

  12. Chinnici, R., Moreau, J.-J., Ryman, A., Weerawarana, S. (ed.): Web Services Description Language (WSDL) version 2.0 part 1: core language, W3C Recommendation. World Wide Web Consortium (2007)

    Google Scholar 

  13. Clark, K.G., Feigenbaum, L., Torres, E. (eds.): SPARQL protocol for RDF, W3C Recommendation. World Wide Web Consortium (2008)

    Google Scholar 

  14. Barbieri, D.F., Braga, D., Ceri, S., Della Valle, E., Grossniklaus, M.: C-SPARQL: SPARQL for continuous querying. In: Proceedings of the 18th International World Wide Web Conference (WWW 2009), Madrid (2009)

    Google Scholar 

  15. OpenLink Virtuoso Universal Server: Documentation. Standard and user-defined aggregate functions. http://docs.openlinksw.com/virtuoso/aggregates.html

  16. Cyganiak, R., Bizer, C.: D2R server – publishing relational databases on the web as SPARQL endpoints. In: Proceedings of the 15th International World Wide Web Conference (WWW 2006), Edinburgh (2006)

    Google Scholar 

  17. Quilitz, B.: DARQ - federated queries with SPARQL. http://darq.sourceforge.net/index.html#Service_Descriptions (2006)

  18. Feigenbaum, L.: DAWG testcases, W3C. http://www.w3.org/2001/sw/DataAccess/tests/r2 (2004). Accessed 14 Feb 2011

  19. D2R Server: DBLP bibliography database. Freie Universität, Berlin. http://www4.wiwiss.fu-berlin.de/dblp/ (2006). Accessed 14 Feb 2011

  20. DBTune: DBTune website: http://dbtune.org/. Accessed 14 Feb 2011

  21. DCMI Usage Board: DCMI metadata terms. Dublin core metadata initiative. http://dublincore.org/documents/2006/12/18/dcmi-terms (2006)

  22. Garofalakis, M., Gehrke, J., Rastogi, R.: Data Stream Management: Processing High-Speed Data Streams (Data-Centric Systems and Applications). Springer, Secaucus (2007)

    Google Scholar 

  23. Faceted DBLP search engine. http://dblp.l3s.de/. Accessed 14 Feb 2011

  24. Fielding, R.T., Taylor, R.N.: Principled design of the modern web architecture. ACM Trans. Internet Technol. 2(2), 115–150 (2002)

    Article  Google Scholar 

  25. Becker, C., Bizer, C.: flickr™ wrappr: precise photo association. http://www4.wiwiss.fu-berlin.de/flickrwrappr/. Accessed 14 Feb 2011

  26. Brickley, D., Miller, L.: FOAF vocabulary specification. FOAF project. http://xmlns.com/foaf/spec/20070524.html (2007)

  27. Brickley, D.: WGS84 geo positioning: an RDF vocabulary. http://www.w3.org/2003/01/geo/ (2004). Accessed 14 Feb 2011

  28. guardian.co.uk: Free our data. http://www.guardian.co.uk/technology/free-our-data. Accessed 14 Feb 2011

  29. Hartig, O., Bizer C., Freytag, J.-C.: Executing SPARQL queries over the web of linked data. In: Proceedings of the Eighth International Semantic Web Conference (ISWC 2009), Chantilly. Lecture Notes in Computer Science, vol. 5823, pp. 293–309. Springer, Heidelberg (2009)

    Google Scholar 

  30. Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., Berners-Lee, T.: Hypertext Transfer Protocol – HTTP/1.1 (RFC 2616). In: Internet Engineering Task Force (IETF) (ed.). http://www.ietf.org/rfc/rfc2616 (1999)

  31. Kiryakov, A.: LDSR passes the modigliani test for semantic web. LarKC Blog Post. http://blog.larkc.eu/?p=1951 (2010)

  32. Kjernsmo, K., Passant, A.: SPARQL new features and rationale, W3C Working Draft. http://www.w3.org/TR/2009/WD-sparql-features-20090702/ (July 2009)

  33. Langegger, A., Woß, W., Blochl, M.: A semantic web middleware for virtual data integration on the web. In: Bechhofer, S., Hauswirth, M., Hoffmann, J., Koubarakis, M. (eds.) Proceedings of the Fifth European Semantic Web Conference (ESWC 2008), Tenerife. Lecture Notes in Computer Science, vol. 5021, pp. 493–507. Springer, Heidelberg (2008)

    Google Scholar 

  34. Gallizo, G., Kerrigan, M., Bradesko, L., Fortuna, B.: D5.2.1 rapid prototype of the LarKC. http://www.larkc.eu/wp-content/uploads/2008/01/larkc_d521_rapid-prototype-of-the-larkc.pdf (2009)

  35. Linking open data community project. http://esw.w3.org/topic/SweoIG/TaskForces/CommunityProjects/LinkingOpenData. Accessed 14 Feb 2011

  36. MacManus, R.: Modigliani test: the semantic web’s tipping point. ReadWriteWeb post. http://www.readwriteweb.com/archives/the_modigliani_test_semantic_web_tipping_point.php (2010)

  37. Giasson, F., Raimond, Y.: Music ontology specification. http://musicontology.com/ (2007)

  38. Nucleic Acids Res. 37, Web server issue. http://nar.oxfordjournals.org/content/vol37/suppl_ 2/index.dtl (2009)

  39. ARQ – Documentation and Resources - support for negation. http://jena.sourceforge.net/ARQ/negation.html. Accessed 14 Feb 2011

  40. Smith, M.K., Welty, C., McGuinness, D.L.: OWL web ontology language – guide, W3C Recommendation. http://www.w3.org/TR/owl-guide/ (Feb 2004)

  41. Motik, B., Grau, B.C., Horrocks, I., Wu, Z., Fokoue, A., Lutz, C.: OWL 2 web ontology language profiles, W3C Recommendation. http://www.w3.org/TR/owl2-profiles/ (Oct 2007)

  42. Pérez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. In: Cruz, I. F., Decker, S., Allemang, D., Preist, C., Schwabe, D., Mika, P., Uschold, M., Aroyo, L. (eds.) Proceedings of the Fifth International Semantic Web Conference (ISWC 2006), Athens, GA. Lecture Notes in Computer Science, vol. 4273, pp. 30–43. Springer, Heidelberg (2006)

    Google Scholar 

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

    Google Scholar 

  44. Prud’hommeaux, E., Seaborne, A. (ed.): SPARQL query language for RDF, W3C Working Draft. http://www.w3.org/TR/2006/WD-rdf-sparql-query-20061004/ (Oct 2006)

  45. Prud’hommeaux, E., Seaborne, A. (ed.): SPARQL query language for RDF, W3C Recommendation. World Wide Web Consortium (2008)

    Google Scholar 

  46. Quilitz, B., Leser, U.: Querying distributed RDF data sources with SPARQL. In: Bechhofer, S., Hauswirth, M., Hoffmann, J., Koubarakis, M. (eds.) Proceedings of the Fifth European Semantic Web Conference (ESWC 2008), Tenerife. Lecture Notes in Computer Science, vol. 5021, pp. 524–538. Springer, Heidelberg (2008)

    Google Scholar 

  47. Hayes, P.: RDF semantics, W3C Recommendation. http://www.w3.org/TR/rdf-mt/ (Feb 2004)

  48. RDF: Query Language and code. http://search.cpan.org/dist/RDF-Query/. Accessed 14 Feb 2011

  49. Duerst, M., Suignard, M.: Internationalized Resource Identifiers (IRIs) (RFC 3987). In: Internet Engineering Task Force (IETF) (ed.). http://www.ietf.org/rfc/rfc3987 (2005)

  50. Phillips, A., Davis, M.: RFC 4647 matching of language tags (2006)

    Google Scholar 

  51. Kifer, M., Boley, H.: RIF overview, W3C Working Draft. http://www.w3.org/TR/rif-overview/ (Oct 2009)

  52. Glaser, H., Millard, I.C.: RKB explorer: application and infrastructure. In: Proceedings of the Semantic Web Challenge 2007 co-located with ISWC 2007 + ASWC 2007, Busan (2007)

    Google Scholar 

  53. Clark, K.: SPARQL Service Advertisement and Discovery Language (SADDLE). http://www.w3.org/2001/sw/DataAccess/proto-wd/saddle.html (2005)

  54. Aduna, B.V.: The SeRQL query language (revision 3.0). http://www.openrdf.org/doc/sesame2/users/ch09.html (2002–2008)

  55. The Semantic Web Conference Corpus a.k.a. the Semantic Web Dog Food Corpus. http://data.semanticweb.org/. Accessed 14 Feb 2011

  56. Sheth, A.P., Larson, J.A.: Federated database systems for managing distributed, heterogeneous, and autonomous databases. ACM Comput. Surv. 22(3), 183–236 (1990)

    Article  Google Scholar 

  57. Oren, E., Delbru, R., Catasta, M., Cyganiak, R., Stenzhorn, H., Tummarello, G.: Sindice.com: a document-oriented lookup index for open linked data. Int. J. Metadata Semant. Ontol. 3(1), 37–52 (2008)

    Article  Google Scholar 

  58. Miles, A., Bechhofer, S.: SKOS Simple Knowledge Organization System, W3C Proposed Recommendation. http://www.w3.org/TR/2009/PR-skos-reference-20090615/ (June 2009)

  59. Glimm, B., Parsia, B.: SPARQL 1.1 entailment regimes, W3C Working Draft. http://www.w3.org/TR/2009/WD-sparql11-entailment-20091022/ (Oct 2009)

  60. Ogbuji, C.:, Uniform HTTP protocol for managing RDF graphs, W3C Working Draft. http://www.w3.org/TR/2009/WD-sparql11-http-rdf-update-20091022/ (Oct 2009)

  61. Johnston, S., Feigenbaum, L., SPARQL 1.1 protocol for RDF, W3C Working Draft. http://www.w3.org//TR/2009/WD-sparql11-protocol-20091022/ (Oct 2009)

  62. Harris, S., Seaborne, A., SPARQL 1.1 query, W3C Working Draft. http://www.w3.org/TR/2009/WD-sparql11-query-20091022/ (Oct 2009)

  63. Williams, G.T.: SPARQL 1.1 service description, W3C Working Draft. http://www.w3.org/TR/2009/WD-sparql11-service-description-20091022/ (Oct 2009)

  64. Schenk, S., Gearon, P.: SPARQL 1.1 update, W3C Working Draft. http://www.w3.org/TR/2009/WD-sparql11-update-20091022/ (Oct 2009)

  65. SPARQL implementation coverage report. http://www.w3.org/2001/sw/DataAccess/tests/implementations (2008). Accessed 14 Feb 2011

  66. Schmidt, M.: Foundations of SPARQL query optimization. Ph.D. thesis, Albert-Ludwigs-Universität Freiburg (Germany). http://www.informatik.uni-freiburg.de/˜mschmidt/docs/diss_final01122010.pdf. Accessed 14 Feb 2011

  67. Seaborne, A., Manjunath, G., Bizer, C. Breslin, J., Das, S., Davis, I., Harris, S., Idehen, K., Corby, O., Kjernsmo, K., Nowack, B.: SPARQL update – a language for updating RDF graphs, W3C Member Submission. http://www.w3.org/Submission/2008/SUBM-SPARQL-Update-20080715/ (July 2008)

  68. Bolles, A., Grawunder, M., Jacobi, J.: Streaming SPARQL – extending SPARQL to process data streams. In: Proceedings of the Fifth European Semantic Web Conference (ESWC 2008), Tenerife. Lecture Notes in Computer Science, vol. 5021, pp. 448–462. Springer, Heidelberg (2008)

    Google Scholar 

  69. ARQ - Documentation and Resources – support for nested SELECTs. http://jena.sourceforge.net/ARQ/sub-select.html. Accessed 14 Feb 2011

  70. Erling, O.: SPARQL extensions for subqueries. http://www.openlinksw.com/weblog/oerling/?id=1296. Accessed 14 Feb 2011

  71. Suchanek, F.M., Kasneci, G., Weikum, G.: YAGO: a large ontology from wikipedia and WordNet. J. Web Semant. 6(3), 203–217. (2008)

    Article  Google Scholar 

  72. Ding, L., Finin, T.W., Joshi, A., Pan, R., Cost, R.S., Peng, Y., Reddivari, P., Doshi, V., Sachs, J.: Swoogle: a search and metadata engine for the semantic web. In: Proceedings of the 13th ACM Conference on Information and Knowledge Management (CIKM 2004), Washington, DC, pp. 652–659. ACM, New York (2004)

    Google Scholar 

  73. Rodríguez, A., McGrath, R., Liu, Y., Myers, J.: Semantic management of streaming data. In: Proceedings of the Second International Workshop on Semantic Sensor Networks (SSN 2009), Collocated with the Eighth International Semantic Web Conference (ISWC 2009), Chantilly

    Google Scholar 

  74. Berners-Lee, T.: Putting government data online. http://www.w3.org/DesignIssues/GovData.html (2009)

  75. Beckett, D., Berners-Lee, T.: Turtle - terse RDF triple language, W3C Team Submission. http://www.w3.org/TeamSubmission/turtle/ (Jan 2008)

  76. UK Cabiet Office. Pioneer of the world wide web to advise the government on using data. http://www.cabinetoffice.gov.uk/newsroom/news_releases/2009/090610_web.aspx (2009)

  77. Obama, B.: Transparency and Open Government, memorandum for the heads of executive departments and agencies. http://www.whitehouse.gov/the_press_office/Transparency_and_Open_Government/ (2009)

  78. Alexander, K., Cyganiak, R., Hausenblas, M., Zhao, J.: Vocabulary of Interlinked Datasets (voiD). http://semanticweb.org/wiki/VoiD (2009)

  79. RDF Data Access Working Group. http://www.w3.org/2001/sw/DataAccess/. Accessed 14 Feb 2011

  80. d’Aquin, M., Motta, E., Sabou, M., Angeletou, S., Gridinoc, L., Lopez, V., Guidi, D.: Toward a new generation of semantic web applications. IEEE Intell. Syst. 23(3), 20–28 (2008)

    Article  Google Scholar 

  81. Malhotra, A., Melton, J., Walsh, N. (eds): XQuery 1.0 and XPath 2.0 functions and operators, W3C Recommendation. World Wide Web Consortium. http://www.w3.org/TR/2007/REC-xpath-functions-20070123/ (Jan 2007)

  82. Biron, P.V., Malhotra, A. (eds.): XML schema part 2: datatypes second edition, W3C Recommendation. http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/. Latest version http://www.w3.org/TR/xmlschema-2/ (Oct 2004)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Emanuele Della Valle .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this entry

Cite this entry

Valle, E.D., Ceri, S. (2011). Querying the Semantic Web: SPARQL. In: Domingue, J., Fensel, D., Hendler, J.A. (eds) Handbook of Semantic Web Technologies. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-92913-0_8

Download citation

Publish with us

Policies and ethics