Journal on Data Semantics

, Volume 1, Issue 3, pp 147–185 | Cite as

Mapping between RDF and XML with XSPARQL

  • Stefan Bischof
  • Stefan Decker
  • Thomas Krennwallner
  • Nuno LopesEmail author
  • Axel Polleres
Original Article


One promise of Semantic Web applications is to seamlessly deal with heterogeneous data. The Extensible Markup Language (XML) has become widely adopted as an almost ubiquitous interchange format for data, along with transformation languages like XSLT and XQuery to translate data from one XML format into another. However, the more recent Resource Description Framework (RDF) has become another popular standard for data representation and exchange, supported by its own query language SPARQL, that enables extraction and transformation of RDF data. Being able to work with XML and RDF using a common framework eliminates several unnecessary steps that are currently required when handling both formats side by side. In this paper we present the XSPARQL language that, by combining XQuery and SPARQL, allows to query XML and RDF data using the same framework and transform data from one format into the other. We focus on the semantics of this combined language and present an implementation, including discussion of query optimisations along with benchmark evaluation.


Query processing XML RDF SPARQL XQuery XSPARQL 


  1. 1.
    Abiteboul S, Hull R, Vianu V (1995) Foundations of databases. Addison-Wesley, New YorkzbMATHGoogle Scholar
  2. 2.
    Adida B, Birbeck M, McCarron S, Pemberton S (2008) RDFa in XHTML: syntax and processing. W3C recommendation, W3C.
  3. 3.
    Afanasiev L, Marx M (2008) An analysis of XQuery benchmarks. Inf Syst 33(2): 155–181CrossRefGoogle Scholar
  4. 4.
    Akhtar W, Kopecký J, Krennwallner T, Polleres A (2008) XSPARQL: traveling between the XML and RDF worlds—and avoiding the XSLT pilgrimage. In: ESWC’08. Springer, Berlin, pp 432–447Google Scholar
  5. 5.
    Angles R, Gutierrez C (2010) SQL nested queries in SPARQL. In: AMW’10,, vol 619Google Scholar
  6. 6.
    Battle S (2006) Gloze: XML to RDF and back again. In: Jena user conference’06Google Scholar
  7. 7.
    Beckett D, Berners-Lee T (2008) Turtle—terse RDF triple language.
  8. 8.
    Beckett D, Broekstra J (2008) SPARQL query results XML format. W3C recommendation, W3C.
  9. 9.
    Beckett D, McBride B (eds) (2004) RDF/XML syntax specification (Revised). W3C recommendation, W3C.
  10. 10.
    Berger S, Bry F, Furche T, Linse B, Schroeder A (2006) Beyond XML and RDF: the versatile Web query language Xcerpt. In: Carr L, Roure DD, Iyengar A, Goble CA, Dahlin M (eds) WWW. ACM, New York, pp 1053–1054Google Scholar
  11. 11.
    Berglund A, Boag S, Chamberlin D, Fernández MF, Kay M, Robie J, Siméon J (2010) XML path language (XPath) 2.0, 2nd edn. W3C recommendation, World Wide Web consortium.
  12. 12.
    Berrueta D, Labra JE, Herman I (2008) XSLT+SPARQL: scripting the semantic web with SPARQL embedded into XSLT stylesheets. In: Workshop on scripting for the semantic webGoogle Scholar
  13. 13.
    Beyer KS, Cochrane R, Josifovski V, Kleewein J, Lapis G, Lohman GM, Lyle R, Özcan F, Pirahesh H, Seemann N, Truong TC, der Linden BV, Vickery B, Zhang C (2005) System RX: one part relational, one part XML. In: Özcan F (ed) SIGMOD conference. ACM, New York, pp 347–358Google Scholar
  14. 14.
    Bikakis N, Gioldasis N, Tsinaraki C, Christodoulakis S (2009) Querying XML Data with SPARQL. In: DEXA’09, vol 5690. Springer, Berlin, pp 372–381Google Scholar
  15. 15.
    Bischof S (2010) Full XSPARQL grammar.
  16. 16.
    Bischof S (2012) Optimising XML-RDF data integration. In: Simperl E (ed) ESWC 2012. LNCS, vol 7295. Springer, Heidelberg, pp 838–843Google Scholar
  17. 17.
    Bohring H, Auer S (2005) Mapping XML to OWL ontologies. In: Leipziger Informatik-Tage, GI, vol 72, pp 147–156Google Scholar
  18. 18.
    Bray T, Paoli J, Sperberg-Mcqueen CM, Maler E, Yergeau F (2008) Extensible markup language (XML) 1.0, 5th edn. W3C recommendation, World Wide Web consortium.
  19. 19.
    Brickley D, Guha R (2004) RDF vocabulary description language 1.0: RDF schema. W3C recommendation, W3C.
  20. 20.
    Brickley D, Miller L (2007) FOAF vocabulary specification.
  21. 21.
    Carroll JJ, Stickler P (2004) TriX, RDF triples in XML. Tech. Rep. HPL-2003-268, HP Labs.
  22. 22.
    Chamberlin D, Robie J, Boag S, Fernández MF, Siméon J, Florescu D (2010) XQuery 1.0: an XML query language, 2nd edn. W3C recommendation, W3C.
  23. 23.
    Clark KG, Feigenbaum L, Torres E (2008) SPARQL protocol for RDF. W3C recommendation, W3C.
  24. 24.
    Connolly D (2007) Gleaning resource descriptions from dialects of languages (GRDDL). W3C recommendation, W3C.
  25. 25.
    Corby O, Kefi-Khelif L, Cherfi H, Gandon F, Khelif K (2009) Querying the semantic web of data using SPARQL, RDF and XML. Tech. Rep. 6847, Institut National de Recherche en Informatique et en AutomatiqueGoogle Scholar
  26. 26.
    Deursen DV, Poppe C, Martens G, Mannens E, Walle RVd (2008) XML to RDF conversion: a generic approach. In: AXMEDIS’08. IEEE, pp 138–144Google Scholar
  27. 27.
    Draper D, Fankhauser P, Fernández M, Malhotra A, Rose K, Rys M, Siméon J, Wadler P (2010) XQuery 1.0 and XPath 2.0 formal semantics, 2nd edn. W3C recommendation, W3C.
  28. 28.
    Droop M, Flarer M, Groppe J, Groppe S, Linnemann V, Pinggera J, Santner F, Schier M, Schopf F, Staffler H, Zugal S (2008) Embedding XPath queries into SPARQL queries. In: ICEIS’08, pp 5–14Google Scholar
  29. 29.
    Farrell J, Lausen H (2007) Semantic annotations for WSDL and XML schema. W3C recommendation, W3C.
  30. 30.
    Fernández MF, Malhotra A, Marsh J, Nagy M, Walsh N (2010) XQuery 1.0 and XPath 2.0 data model (XDM), 2nd edn. W3C recommendation, W3C.
  31. 31.
    Fischer P, Florescu D, Kaufmann M, Kossmann D (2011) Translating SPARQL and SQL to XQuery. In: XMLPrague’11, pp 81–98Google Scholar
  32. 32.
    Gearon P, Passant A, Polleres A (2011) SPARQL 1.1 update. W3C working draft, W3C.
  33. 33.
    Groppe S, Groppe J, Linnemann V, Kukulenz D, Hoeller N, Reinke C (2008) Embedding SPARQL into XQuery/XSLT. In: SAC’08. ACM, New York, pp 2271–2278Google Scholar
  34. 34.
    Grust T, Sakr S, Teubner J (2004) XQuery on SQL hosts. In: Nascimento MA, Özsu MT, Kossmann D, Miller RJ, Blakeley JA, Schiefer KB (eds) VLDB. Morgan Kaufmann, pp 252–263Google Scholar
  35. 35.
    Grust T, Rittinger J, Teubner J (2007) eXrQuy: order indifference in XQuery. In: Chirkova R, Dogac A, Özsu MT, Sellis TK (eds) ICDE. IEEE, pp 226–235Google Scholar
  36. 36.
    Grust T, Mayr M, Rittinger J (2010) Let SQL drive the XQuery workhorse (XQuery join graph isolation). In: EDBT’10, vol 426. ACM, pp 147–158Google Scholar
  37. 37.
    Hartig O, Heese R (2007) The SPARQL query graph model for query optimization. In: Franconi E, Kifer M, May W (eds) ESWC, vol 4519. Springer, Berlin, pp 564–578Google Scholar
  38. 38.
    Harris S, Seaborne A (2011) SPARQL 1.1 query language. W3C working draft, W3C.
  39. 39.
    Hayes P (2004) RDF semantics. W3C recommendation, W3C.
  40. 40.
    Iannella R (2010) Representing vCard Objects in RDF. W3C member submission
  41. 41.
    Katz H, Chamberlin D, Kay M, Wadler P, Draper D (2003) XQuery from the experts: a guide to the W3C XML query language. Addison-WesleyGoogle Scholar
  42. 42.
    Kay M (ed) (2007) XSL transformations (XSLT) version 2.0. W3C recommendation, W3C. http://
  43. 43.
    Koch C (2006) On the complexity of nonrecursive XQuery and functional query languages on complex values. ACM Trans Database Syst 31(4): 1215–1256CrossRefGoogle Scholar
  44. 44.
    Kopecký J, Vitvar T, Bournez C, Farrell J (2007) SAWSDL: semantic annotations for WSDL and XML schema. IEEE Internet Comput 11(6): 60–67CrossRefGoogle Scholar
  45. 45.
    Malhotra A, Melton J, Walsh N (eds) (2010) XQuery 1.0 and XPath 2.0 functions and operators, 2nd edn. W3C recommendation, W3C.
  46. 46.
    Manola F, Miller E (2004) RDF primer. W3C recommendation, W3C.
  47. 47.
    May N, Helmer S, Moerkotte G (2003) Three cases for query decorrelation in XQuery. In: Xsym’03, vol 2824. Springer, Berlin, pp 70–84Google Scholar
  48. 48.
    May N, Stuckenschmidt H (2007) Querying embedded RDF with XML technology: a feasibility study. In: XML Tage 2007. Freie University, BerlinGoogle Scholar
  49. 49.
    Passant A, Kopecký J, Corlosquet S, Berrueta D, Palmisano D, Polleres A (2009) XSPARQL: use cases. W3C member submission
  50. 50.
    Pérez J, Arenas M, Gutierrez C (2008) nSPARQL: a navigational language for RDF. In: ISWC’08, vol 5318. Springer, Berlin, pp 66–81Google Scholar
  51. 51.
    Pérez J, Arenas M, Gutierrez C (2009) Semantics and complexity of SPARQL. ACM Trans Database Syst 34(3): 1–45CrossRefGoogle Scholar
  52. 52.
    Polleres A (2007) From SPARQL to rules (and back). In: WWW’07Google Scholar
  53. 53.
    Polleres A, Scharffe F, Schindlauer R (2007) SPARQL++ for mapping between RDF vocabularies. In: ODBASE’07. Springer, BerlinGoogle Scholar
  54. 54.
    Prud’hommeaux E, Seaborne A (eds) (2008) SPARQL query language for RDF. W3C recommendation, W3C.
  55. 55.
    Robie J, Chamberlin D, Dyck M, Florescu D, Melton J, Siméon J (2011) XQuery update facility 1.0. W3C recommendation, W3C.
  56. 56.
    Rodrigues T, Rosa P, Cardoso J (2008) Moving from syntactic to semantic organizations using JXML2OWL. Comput Ind 59(8): 808–819CrossRefGoogle Scholar
  57. 57.
    Schmidt A, Waas F, Kersten ML, Carey MJ, Manolescu I, Busse R (2002) XMark: a benchmark for XML data management. In: VLDB’02. Morgan Kaufmann, pp 974–985Google Scholar
  58. 58.
    Walsh N (2003) RDF Twig: accessing RDF graphs in XSLT. In: Extreme markup languages’03Google Scholar
  59. 59.
    Zhou M, Wu Y (2010) XML-based RDF data management for efficient query processing. In: Dong XL, Naumann F (eds) Proceedings of the 13th international workshop on the web and databases 2010, WebDB 2010, Indianapolis, Indiana, USA, June 6, 2010Google Scholar

Copyright information

© Springer-Verlag 2012

Authors and Affiliations

  • Stefan Bischof
    • 1
  • Stefan Decker
    • 2
    • 3
  • Thomas Krennwallner
    • 4
  • Nuno Lopes
    • 2
    • 3
    Email author
  • Axel Polleres
    • 1
  1. 1.Siemens AG ÖsterreichViennaAustria
  2. 2.Digital Enterprise Research Institute (DERI)National University of IrelandGalwayIreland
  3. 3.IDA Business Park, Lower DanganGalwayIreland
  4. 4.Institute of Information SystemsVienna University of TechnologyViennaAustria

Personalised recommendations