Efficient Approximation of Well-Designed SPARQL Queries

  • Zhenyu Song
  • Zhiyong Feng
  • Xiaowang ZhangEmail author
  • Xin Wang
  • Guozheng Rao
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9998)


Query response time often influences user experience in the real world. However, the time of answering a SPARQL query with its all exact solutions in large scale RDF dataset possibly exceeds users’ tolerable waiting time, especially when it contains the OPT operations since the OPT operation is the least conventional operator in SPARQL. So it becomes essential to make a trade-off between the query response time and the accuracy of their solutions. That is, partial answers can be provided for users to reduce the response query time within their tolerable waiting time. In this paper, based on the depth of the OPT operation occurring in a query, we propose an approach to obtain its all approximate queries with less depth of the OPT operation. Although queries are approximated in this method, it remains the “non-optional” query patterns from users. This paper mainly discusses those queries with well-designed patterns since the OPT operation in a well-designed pattern is really “optional”. We remove “optional” triple patterns with less depth of the OPT operation and then obtain approximate queries with different depths of the OPT operation. Furthermore, we evaluate the approximate query efficiency and solutions precision with the degree of approximation. It shows that users can keep the balance between query efficiency and solutions precision by changing the degree of approximation.


RDF SPARQL Well-designed patterns Approximate queries 



This work is supported by the program of the National Key Research and Development Program of China under 2016YFB1000603 and the National Natural Science Foundation of China (NSFC) under 61502336, 61373035. Xiaowang Zhang is supported by the Tianjin Thousand Young Talents Program.


  1. 1.
    Abiteboul, S., Richard, H., Vianu, V.: Foundations of Databases. Addison Wesley, Reading (1995)zbMATHGoogle Scholar
  2. 2.
    Barcelo, P., Pichler, R., Skritek, S.: Efficient evaluation and approximation of well-designed pattern trees. In: Proceedings of PODS 2015, pp. 131–144. ACM (2015)Google Scholar
  3. 3.
    Broekstra, J., Kampman, A., Harmelen, F.: Sesame: a generic architecture for storing and querying RDF and RDF schema. In: Horrocks, I., Hendler, J. (eds.) ISWC 2002. LNCS, vol. 2342, pp. 54–68. Springer, Heidelberg (2002). doi: 10.1007/3-540-48005-6_7 CrossRefGoogle Scholar
  4. 4.
    Han, X., Feng, Z., Zhang, X., Wang, X., Rao, G., Jiang, S.: On the statistical analysis of practical SPARQL queries. In: Proceedings of WebDB (2016).
  5. 5.
    Carroll, J.J., Dickinson, I., Dollin, C., Reynolds, D., Seaborne, A., Wilkinson, K.: Jena: implementing the semantic web recommendations. In: Proceedings of WWW 2004, pp. 74–83 (2004)Google Scholar
  6. 6.
    Kaminski, M., Kostylev, E.V.: Beyond well-designed SPARQL. In: Proceedings of ICDT 2016, pp. 5:1–5:18 (2016)Google Scholar
  7. 7.
    Klyne, G., Jeremy, C.J., McBride, B.: Resource description framework (RDF): concepts and abstract syntax. W3C Recommendation (2004)Google Scholar
  8. 8.
    Letelier, A., Prez, J., Pichler, R., Skritek, S.: Static analysis, optimization of semantic web queries. Proc. PODS 38(4), 84–87 (2012)MathSciNetGoogle Scholar
  9. 9.
    Nah, F.H.: A study on tolerable waiting time: How long are web users willing to wait? Behav. Inf. Technol. 23(3), 153–163 (2003)CrossRefGoogle Scholar
  10. 10.
    Prez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. ACM Trans. Database Syst. 34(3), 30–43 (2009)Google Scholar
  11. 11.
    Prud’Hommeaux, E., Seaborne, A.: SPARQL query language for RDF. W3C Recommendation (2008)Google Scholar
  12. 12.
    Saleem, M., Ali, M.I., Hogan, A., Mehmood, Q., Ngomo, A.C.N.: LSQ: the linked SPARQL queries dataset. In: Arenas, M., et al. (eds.) ISWC 2015. LNCS, vol. 9367, pp. 261–269. Springer, Heidelberg (2015). doi: 10.1007/978-3-319-25010-6_15 CrossRefGoogle Scholar
  13. 13.
    Wood, P.: Query languages for graph databases. SIGMOD Rec. 41(1), 50–60 (2012)CrossRefGoogle Scholar
  14. 14.
    Zhang, X., Van den Bussche, J.: On the primitivity of operators in SPARQL. Inf. Process. Lett. 114(9), 480–485 (2014)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Zhang, X., Van den Bussche, J.: On the power of SPARQL in expressing navigational queries. Comput. J. 58(11), 2841–2851 (2016)CrossRefGoogle Scholar
  16. 16.
    Zhang, X., Van den Bussche, J., Picalausa, F.: On the satisfiability problem for SPARQL patterns. J. Artif. Intell. Res. 56, 403–428 (2016)zbMATHGoogle Scholar

Copyright information

© Springer International Publishing AG 2016

Authors and Affiliations

  • Zhenyu Song
    • 1
    • 2
  • Zhiyong Feng
    • 1
    • 2
  • Xiaowang Zhang
    • 1
    • 2
    Email author
  • Xin Wang
    • 1
    • 2
  • Guozheng Rao
    • 1
    • 2
  1. 1.School of Computer Science and TechnologyTianjin UniversityTianjinChina
  2. 2.Tianjin Key Laboratory of Cognitive Computing and ApplicationTianjinChina

Personalised recommendations