  Document databases are becoming popular, but how to present complex document
query to obtain useful information from the document remains an important topic
to study. In this paper, we describe the design issues of a pattern-based
document database query language named JPQ. JPQ uses various expressive
patterns to extract and construct document fragments following a JSON-like
document data model. It adopts tree-like extraction patterns with a coherent
pattern composition mechanism to extract data elements from hierarchically
structured documents and maintain the logical relationships among the elements.
Based on these relationships, JPQ deploys a deductive mechanism to
declaratively specify the data transformation requests and considers also data
filtering on hierarchical data structure. We use various examples to show the
features of the language and to demonstrate its expressiveness and
declarativeness in presenting complex document queries.
