Recursive Twig Pattern Query

XQuery is a language for querying XML data which is widely used on the Internet. In XQuery, user can define recursive functions for querying and processing XML data. XML twig pattern query is considered as core operation for querying XML data which has been studied intensively in recent years. More powerful recursive queries can be achieved via combining user-defined recursive function and twig pattern query. This paper proposes recursive twig pattern query (RTPQ) to extend traditional twig pattern query with recursion and an effective holistic twig matching algorithm for RTPQ. With the help of RTPQ, recursive function call can access its result instead of evaluating local twig pattern queries in each calling. Results of experiments show that this approach can improve query efficiency and eliminate redundant intermediate results.