The primary key of the sort is the number of literal characters in the full URI matching pattern.
...
The secondary key of the sort is the number of template expressions embedded within the pattern—that is, {id} or {id : .+}. This sort is in descending order.
...
The tertiary key of the sort is the number of nondefault template expressions. A default template expression is one that does not define a regular expression—that is, {id}.
/store/book/author $.store.book[*].author the authors of all books in the store
//author $..author all authors
/store/* $.store.* all things in store, which are some books and a red bicycle.
/store//price $.store..price the price of everything in the store.
//book[3] $..book[2] the third book
//book[last()] $..book[(@.length-1)]
$..book[-1:] the last book in order.
//book[position()<3] $..book[0,1]
$..book[:2] the first two books
//book[isbn] $..book[?(@.isbn)] filter all books with isbn number
//book[price<10] $..book[?(@.price<10)] filter all books cheapier than 10
//* $..* all Elements in XML document. All members of JSON structure.
R. Bunescu, and R. Mooney. Proceedings of the conference on Human Language Technology and Empirical Methods in Natural Language Processing, page 724--731. Stroudsburg, PA, USA, Association for Computational Linguistics, (2005)
M. Mintz, S. Bills, R. Snow, and D. Jurafsky. Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP: Volume 2-Volume 2, page 1003--1011. Association for Computational Linguistics, (2009)